Bug 3010 - sshd_config ListenAddress: Netmask is misinterpreted as Port
Summary: sshd_config ListenAddress: Netmask is misinterpreted as Port
Status: CLOSED DUPLICATE of bug 2335
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: sshd (show other bugs)
Version: 7.6p1
Hardware: Other Linux
: P5 enhancement
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-16 00:23 AEST by Kurt Stieger
Modified: 2021-04-23 15:04 AEST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kurt Stieger 2019-05-16 00:23:41 AEST
Seen on Ubuntu 18.04 (openssh-server, 1:7.6p1-4ubuntu0.2, amd64)

If an IPv4 ListenAddress is configured with netmask suffix (eg. 10.0.0.1/24) the netmask part is used as listening port.

```
$ cat /tmp/sshd_test_conf 
ListenAddress 10.0.0.1/24

$ /usr/sbin/sshd -d -f /tmp/sshd_test_conf 
debug1: sshd version OpenSSH_7.6, OpenSSL 1.0.2n  7 Dec 2017
debug1: private host key #0: ssh-rsa SHA256:...
debug1: private host key #1: ecdsa-sha2-nistp256 SHA256:...
debug1: private host key #2: ssh-ed25519 SHA256:...
debug1: rexec_argv[0]='/usr/sbin/sshd'
debug1: rexec_argv[1]='-d'
debug1: rexec_argv[2]='-f'
debug1: rexec_argv[3]='/tmp/sshd_test_conf'
debug1: Set /proc/self/oom_score_adj from 0 to -1000
debug1: Bind to port 24 on 10.0.0.1.
Server listening on 10.0.0.1 port 24.
```
For sure, this configuration is wrong, in this case it should be ignored. Starting the service on a port wich was (wrongly) meant as netmask seems to be wrong.
Comment 1 Jakub Jelen 2019-05-16 01:15:56 AEST

*** This bug has been marked as a duplicate of bug 2335 ***
Comment 2 Damien Miller 2021-04-23 15:04:37 AEST
closing resolved bugs as of 8.6p1 release