[Bug 2222] New: GatewayPorts=no should not rewrite localhost addresses in port-forward requests

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Mon Apr 7 21:10:15 EST 2014


https://bugzilla.mindrot.org/show_bug.cgi?id=2222

            Bug ID: 2222
           Summary: GatewayPorts=no should not rewrite localhost addresses
                    in port-forward requests
           Product: Portable OpenSSH
           Version: 6.5p1
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P5
         Component: sshd
          Assignee: unassigned-bugs at mindrot.org
          Reporter: hanwenn at gmail.com

If GatewayPorts = no, then forwarding a port listener for a given port
(ssh -R option), will disregard the address field in the request, and
expand the address number with getaddrinfo().

getaddrinfo() will expand the localhost address as IPv6 and IPv4 in
some order, and sshd returns success if listening on either address
succeeded, without mentioning the address being used.

If other services are listening on only IPv4 (but not IPv6), this may
lead to a situation where a request for forwarding 127.0.0.1:PORTNUMBER
succeeds, but the forwarded port is only on [::1]:PORT-NUMBER. 

This is confusing (we spent a couple of days debugging the fallout of
this). Moreover, if the sshd is running on a multi-user system, a
malicious user may use this to intercept or modify the traffic over the
forwarded port.

Suggested fix: do not call discard the incoming address in
channel_setup_fwd_listener() if it is either 127.0.0.1 or ::1

-- 
You are receiving this mail because:
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list