Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CWE-605 (对同一端口的多重绑定) — Vulnerability Class 3

3 vulnerabilities classified as CWE-605 (对同一端口的多重绑定). AI Chinese analysis included.

CWE-605 represents a network-level weakness where multiple sockets bind to the same port, enabling service hijacking or spoofing. This vulnerability typically arises when developers improperly configure the SO_REUSEADDR socket option, allowing a malicious process to bind to a specific address that a legitimate server previously bound to INADDR_ANY. Attackers exploit this by launching a secondary service on the targeted port, effectively stealing traffic or injecting malicious responses before the intended application can process them. To mitigate this risk, developers must strictly manage socket options, ensuring SO_REUSEADDR is used only when necessary and paired with appropriate access controls. Furthermore, implementing strict firewall rules and validating source addresses can prevent unauthorized processes from intercepting network connections, thereby preserving service integrity and preventing unauthorized access to sensitive data streams.

MITRE CWE Description
When multiple sockets are allowed to bind to the same port, other services on that port may be stolen or spoofed. On most systems, a combination of setting the SO_REUSEADDR socket option, and a call to bind() allows any process to bind to a port to which a previous process has bound with INADDR_ANY. This allows a user to bind to the specific address of a server bound to INADDR_ANY on an unprivileged port, and steal its UDP packets/TCP connection.
Common Consequences (1)
Confidentiality, IntegrityRead Application Data
Packets from a variety of network services may be stolen or the services spoofed.
Mitigations (1)
PolicyRestrict server socket address to known local addresses.
Examples (1)
This code binds a server socket to port 21, allowing the server to listen for traffic on that port.
void bind_socket(void) { int server_sockfd; int server_len; struct sockaddr_in server_address; /*unlink the socket if already bound to avoid an error when bind() is called*/ unlink("server_socket"); server_sockfd = socket(AF_INET, SOCK_STREAM, 0); server_address.sin_family = AF_INET; server_address.sin_port = 21; server_address.sin_addr.s_addr = htonl(INADDR_ANY); server_len = sizeof(struct sockaddr_in); bind(server_sockfd, (struct sockaddr *) &s1, server_len); }
Bad · C

Vulnerabilities classified as CWE-605 (对同一端口的多重绑定) represent 3 CVEs. The CWE taxonomy describes the weakness; review individual CVEs for product-specific impact.