This vulnerability occurs when a system's socket configuration allows multiple applications to bind to the same network port simultaneously. This can let a malicious process hijack or impersonate legitimate services running on that port.
The core of the issue lies in the SO_REUSEADDR socket option. On most operating systems, when this option is set, the bind() system call allows a new process to bind to a port even if it's already in use by another process that bound to INADDR_ANY (all interfaces). This effectively bypasses the typical port reservation mechanism. As a result, an attacker can create a socket that binds specifically to the server's IP address on an unprivileged port. This lets them intercept or 'steal' incoming UDP packets or TCP connection requests intended for the original, legitimate service, leading to denial of service, data theft, or spoofing attacks.
Impact: Read Application Data
Packets from a variety of network services may be stolen or the services spoofed.
c
/unlink the socket if already bound to avoid an error when bind() is called/*
c