When setting up any kind of server application (such as a web server, IRC server, etc) you can usually bind the application to particular IP addresses or hostnames. This tells the application to 'listen' on those addresses.
If I were to bind to an IP address that I do not control, what would be the potential security risks? Of course no requests would ever reach my application, but could there be any other risks or edge-cases?
Regarding binding to a hostname, in some cases this will likely result in a DNS query of the hostname been sent, which would result in potentially malicious DNS record information being returned, as well as the information disclosure/privacy violations, etc. Are there any other risks here?
An example of this situation is when starting a local PHP development server. If I intend to type
php -S 127.0.0.1:8080 but I misspell the IP causing PHP to bind to an arbitrary IP that I do not control. This particular risk can be mitigate by using localhost:8080 (which if mistyped would be just invalid) or setting a Bash alias.
Through proper code review and good security practise, this will likely never actually happen. I'm just interested in the theory.