anchao opened a new pull request #4603:
URL: https://github.com/apache/incubator-nuttx/pull/4603
## Summary
net/tcp: sanity check for the listen address
TCP stack only checks the visitor's port number on listening port,
which will cause external links to arbitrarily access local resources in the
nuttx system:
```
client NUTTX server (192.168.1.101)
listen (127.0.0.1):8888
connect (192.168.1.101:8888) -> accept (127.0.0.1):8888 (success)
<-- here is the issue.
listen (0.0.0.0):8889
connect (192.168.1.101:8889) -> accept (0.0.0.0):8889 (success)
listen (192.168.1.101):8890
connect (192.168.1.101:8890) -> accept (192.168.1.101):8890 (success)
```
In this PR we added an address check on listener port and reject malicious
connections if the address check failure
```
client NUTTX server (192.168.1.101)
listen (127.0.0.1):8888
connect (192.168.1.101:8888) -> accept (127.0.0.1):8888 (Reject)
```
## Impact
tcp stack accept
## Testing
tcp test connect to the nuttx
```
client NUTTX server (192.168.1.101)
listen (127.0.0.1):8888
connect (192.168.1.101:8888) -> accept (127.0.0.1):8888 (Reject)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]