What’s Vulnerable › Vulnerabilities
CVE-2017-7189
- Severity: high (CVSS 7.5 v3.0)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 2.4% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2019-07-10 · updated 2026-06-17
- Weakness: CWE-20
Description
main/streams/xp_socket.c in PHP 7.x before 2017-03-07 misparses fsockopen calls, such as by interpreting fsockopen('127.0.0.1:80', 443) as if the address/port were 127.0.0.1:80:443, which is later truncated to 127.0.0.1:80. This behavior has a security risk if the explicitly provided port number (i.e., 443 in this example) is hardcoded into an application as a security policy, but the hostname argument (i.e., 127.0.0.1:80 in this example) is obtained from untrusted input.
Affected products
- PHP: from 7.0.0 before 7.0.16 — fixed in 7.0.16
How to fix
Upgrade to a fixed version: PHP 7.0.16. Check the vendor advisory for mitigations.
References
- https://bugs.php.net/bug.php?id=74192
- https://github.com/php/php-src/commit/bab0b99f376dac9170ac81382a5ed526938d595a
- https://bugs.php.net/bug.php?id=74192
- https://github.com/php/php-src/commit/bab0b99f376dac9170ac81382a5ed526938d595a
Get alerted when CVE-2017-7189 or the next vulnerability affects your stack