Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-5371

git does not disable X11 forwarding when executes ssh, so it may hang when cloning remote repositories

Linking RHIVOS CVEs to...Migration: Automation ...Sync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Normal Normal
    • None
    • rhel-8.5.0
    • git
    • None
    • Moderate
    • rhel-base-utils-core
    • ssg_core_services
    • 8
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • If docs needed, set a value
    • None
    • 57,005

      Description of problem:

      • User has "ForwardX11 yes" in ~/.ssh/config or in /etc/ssh/ssh_config
      • Git server runs on RHEL 8.5
      • User attempts to clone a repository over ssh
      • Git hangs

      Version-Release number of selected component (if applicable):

      • RHEL 8.5
      • dbus-1.12.8-14.el8.x86_64
      • git-2.27.0-1.el8.x86_64
      • openssh-clients-8.0p1-10.el8.x86_64
      • openssh-server-8.0p1-10.el8.x86_64

      How reproducible:

      Always

      Steps to Reproduce:

      Using same machine and user for server and client, for simplicity:

      1. Enable X11 forwarding for SSH server and client

      1. echo ForwardX11 yes >> /etc/ssh/ssh_config
      2. echo ForwardX11 yes >> /etc/ssh/sshd_config
      3. systemctl restart sshd.service

      2. Create git repository

      1. mkdir /opt/test-repo
      2. chown test-user:test-user /opt/test-repo

      Run below commands as "test-user" on a gnome-terminal

      $ cd /opt/test-repo
      $ git init
      $ git commit -m test

      3. Try to clone the repository over ssh

      Rum below commands on a gnome-terminal (must have a DISPLAY)

      $ git clone localhost:/opt/test-repo

      Actual results:

      Cloning into 'test-repo'...
      test-user@localhost's password:
      remote: Enumerating objects: 3, done.
      remote: Counting objects: 100% (3/3), done.
      remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
      Receiving objects: 100% (3/3), done.
      [hang, must be interrupted with Ctrl-C]

      Expected results:

      No hang

      Additional info:

      It' caused by bug 1940067: With dbus 1.12.8-12.el8_3 ssh session executing
      single command hang (which in its turn is a regression of bug 1874282).

      So ssh hangs after running git-upload-pack at the server side.

      It is possible to circumvent the bug with a system-wide configuration to
      make git run ssh with the "-x" argument, which disables X11 forwarding:

      1. git config --system core.sshCommand 'ssh -x'

      git should always run ssh with the "-x" argument to prevent errors related
      to X11 forwarding, which has been a problematic feature.

              opohorel@redhat.com Ondrej Pohorelsky
              rhn-support-casantos Carlos Santos
              Ondrej Pohorelsky Ondrej Pohorelsky
              RHEL SST CS base utils QE Bot RHEL SST CS base utils QE Bot
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: