| Summary: | sshd and -R port forwardings on 127.0.0.0/8 | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Portable OpenSSH | Reporter: | florianhilgenberg | ||||
| Component: | sshd | Assignee: | Assigned to nobody <unassigned-bugs> | ||||
| Status: | NEW --- | ||||||
| Severity: | enhancement | CC: | djm, gbo, jaime.higgins | ||||
| Priority: | P5 | ||||||
| Version: | 6.6p1 | ||||||
| Hardware: | Other | ||||||
| OS: | Linux | ||||||
| Attachments: |
|
||||||
|
Description
florianhilgenberg
2015-09-27 06:07:12 AEST
I have concerns about security with set GatewayPorts to other settings than no. So I am going to increase the importance on this issue. Created attachment 2720 [details]
add GatewayPortsAddresses option
Maybe we could provide a filter to take a list of allowed bind addresses. E.g.
GatewayPorts clientspecified
GatewayPortsAddresses 127.0.0.0/8,2033::/24
untested patch attached.
I have tested this patch against the version of OpenSSH distributed in Ubuntu 16.04 (7.2p2). It works quite well, but I had to make some small changes:
On line 1353, I believe it should be:
if (arg == NULL || *arg == '\0')
instead of:
if (arg == NULL || *arg != '\0')
I was also wondering why we cannot enforce these limitations for the loopback addresses as well?
if (type == SSH_CHANNEL_RPORT_LISTENER && !is_loopback &&
fwd_opts->gateway_ports_explicit != NULL &&
addr_match_cidr_list(ntop,
fwd_opts->gateway_ports_explicit) != 1) {
Hello, Wanted to comment that I too have found this bug. It still exists in the most recent sshd servers I have available to me to try this on (at work). Unfortunately, recompiling the server from edited source code isn't an option for me - nor is editing the server's config file (work's security restrictions). It seems like Gerik has a solution that could be included in future releases. Is there any chance this could get assigned to someone [much more competent/capable than I] so it could be pulled into future releases? I have to end by saying: Holy cow you guys are awesome for coding/developing sshd so well! Thank you so much! |