{"id":"CVE-2017-7189","aliases":["EUVD-2017-16227","GHSA-3mh5-9253-628p","UBUNTU-CVE-2017-7189"],"status":"published","title":"main/streams/xp_socket.c in PHP 7.x before 2017-03-07 misparses fsockopen calls, such as by...","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.","severity":{"version":"3.0","score":7.5,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"high","assessor":"primary","from":"nvd"},"epss":{"day":"2026-11-09","score":0.02425,"percentile":0.84316,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":false},"cwes":["CWE-20"],"published":"2019-07-10T14:41:35Z","modified":"2026-10-21T23:00:11Z","affected":[{"source":"osv","ecosystem":"Ubuntu:Pro:14.04:LTS","package":"php5","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["5.5.3+dfsg-1ubuntu2","5.5.3+dfsg-1ubuntu3","5.5.6+dfsg-1ubuntu1","5.5.6+dfsg-1ubuntu2","5.5.8+dfsg-2ubuntu1","5.5.9+dfsg-1ubuntu1","5.5.9+dfsg-1ubuntu2","5.5.9+dfsg-1ubuntu3","5.5.9+dfsg-1ubuntu4","5.5.9+dfsg-1ubuntu4.1","5.5.9+dfsg-1ubuntu4.2","5.5.9+dfsg-1ubuntu4.3","5.5.9+dfsg-1ubuntu4.4","5.5.9+dfsg-1ubuntu4.5","5.5.9+dfsg-1ubuntu4.6","5.5.9+dfsg-1ubuntu4.7","5.5.9+dfsg-1ubuntu4.9","5.5.9+dfsg-1ubuntu4.11","5.5.9+dfsg-1ubuntu4.12","5.5.9+dfsg-1ubuntu4.13","5.5.9+dfsg-1ubuntu4.14","5.5.9+dfsg-1ubuntu4.16","5.5.9+dfsg-1ubuntu4.17","5.5.9+dfsg-1ubuntu4.19","5.5.9+dfsg-1ubuntu4.20","5.5.9+dfsg-1ubuntu4.21","5.5.9+dfsg-1ubuntu4.22","5.5.9+dfsg-1ubuntu4.23","5.5.9+dfsg-1ubuntu4.24","5.5.9+dfsg-1ubuntu4.25","5.5.9+dfsg-1ubuntu4.26","5.5.9+dfsg-1ubuntu4.27","5.5.9+dfsg-1ubuntu4.29","5.5.9+dfsg-1ubuntu4.29+esm1","5.5.9+dfsg-1ubuntu4.29+esm2","5.5.9+dfsg-1ubuntu4.29+esm3","5.5.9+dfsg-1ubuntu4.29+esm4","5.5.9+dfsg-1ubuntu4.29+esm5","5.5.9+dfsg-1ubuntu4.29+esm6","5.5.9+dfsg-1ubuntu4.29+esm8","5.5.9+dfsg-1ubuntu4.29+esm10","5.5.9+dfsg-1ubuntu4.29+esm11","5.5.9+dfsg-1ubuntu4.29+esm12","5.5.9+dfsg-1ubuntu4.29+esm13","5.5.9+dfsg-1ubuntu4.29+esm14","5.5.9+dfsg-1ubuntu4.29+esm15","5.5.9+dfsg-1ubuntu4.29+esm16","5.5.9+dfsg-1ubuntu4.29+esm17","5.5.9+dfsg-1ubuntu4.29+esm18"]},{"source":"osv","ecosystem":"Ubuntu:Pro:16.04:LTS","package":"php7.0","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["7.0.1-5","7.0.1-6","7.0.2-1","7.0.2-3","7.0.2-4","7.0.2-5","7.0.3-2","7.0.3-3","7.0.3-9ubuntu1","7.0.4-5ubuntu1","7.0.4-5ubuntu2","7.0.4-7ubuntu1","7.0.4-7ubuntu2","7.0.4-7ubuntu2.1","7.0.8-0ubuntu0.16.04.1","7.0.8-0ubuntu0.16.04.2","7.0.8-0ubuntu0.16.04.3","7.0.13-0ubuntu0.16.04.1","7.0.15-0ubuntu0.16.04.1","7.0.15-0ubuntu0.16.04.2","7.0.15-0ubuntu0.16.04.4","7.0.18-0ubuntu0.16.04.1","7.0.22-0ubuntu0.16.04.1","7.0.25-0ubuntu0.16.04.1","7.0.28-0ubuntu0.16.04.1","7.0.30-0ubuntu0.16.04.1","7.0.32-0ubuntu0.16.04.1","7.0.33-0ubuntu0.16.04.1","7.0.33-0ubuntu0.16.04.2","7.0.33-0ubuntu0.16.04.3","7.0.33-0ubuntu0.16.04.4","7.0.33-0ubuntu0.16.04.5","7.0.33-0ubuntu0.16.04.6","7.0.33-0ubuntu0.16.04.7","7.0.33-0ubuntu0.16.04.9","7.0.33-0ubuntu0.16.04.11","7.0.33-0ubuntu0.16.04.12","7.0.33-0ubuntu0.16.04.14","7.0.33-0ubuntu0.16.04.15","7.0.33-0ubuntu0.16.04.16","7.0.33-0ubuntu0.16.04.16+esm1","7.0.33-0ubuntu0.16.04.16+esm2","7.0.33-0ubuntu0.16.04.16+esm3","7.0.33-0ubuntu0.16.04.16+esm4","7.0.33-0ubuntu0.16.04.16+esm5","7.0.33-0ubuntu0.16.04.16+esm6","7.0.33-0ubuntu0.16.04.16+esm7","7.0.33-0ubuntu0.16.04.16+esm8","7.0.33-0ubuntu0.16.04.16+esm9","7.0.33-0ubuntu0.16.04.16+esm10","7.0.33-0ubuntu0.16.04.16+esm11","7.0.33-0ubuntu0.16.04.16+esm12","7.0.33-0ubuntu0.16.04.16+esm13","7.0.33-0ubuntu0.16.04.16+esm14","7.0.33-0ubuntu0.16.04.16+esm15","7.0.33-0ubuntu0.16.04.16+esm16","7.0.33-0ubuntu0.16.04.16+esm17","7.0.33-0ubuntu0.16.04.16+esm18","7.0.33-0ubuntu0.16.04.16+esm19","7.0.33-0ubuntu0.16.04.16+esm20","7.0.33-0ubuntu0.16.04.16+esm21","7.0.33-0ubuntu0.16.04.16+esm22"]},{"source":"osv","ecosystem":"Ubuntu:Pro:18.04:LTS","package":"php7.2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["7.2.1-1ubuntu2","7.2.2-1ubuntu1","7.2.2-1ubuntu2","7.2.3-1ubuntu1","7.2.5-0ubuntu0.18.04.1","7.2.7-0ubuntu0.18.04.1","7.2.7-0ubuntu0.18.04.2","7.2.10-0ubuntu0.18.04.1","7.2.15-0ubuntu0.18.04.1","7.2.15-0ubuntu0.18.04.2","7.2.17-0ubuntu0.18.04.1","7.2.19-0ubuntu0.18.04.1","7.2.19-0ubuntu0.18.04.2","7.2.24-0ubuntu0.18.04.1","7.2.24-0ubuntu0.18.04.2","7.2.24-0ubuntu0.18.04.3","7.2.24-0ubuntu0.18.04.4","7.2.24-0ubuntu0.18.04.6","7.2.24-0ubuntu0.18.04.7","7.2.24-0ubuntu0.18.04.8","7.2.24-0ubuntu0.18.04.9","7.2.24-0ubuntu0.18.04.10","7.2.24-0ubuntu0.18.04.11","7.2.24-0ubuntu0.18.04.12","7.2.24-0ubuntu0.18.04.13","7.2.24-0ubuntu0.18.04.15","7.2.24-0ubuntu0.18.04.16","7.2.24-0ubuntu0.18.04.17","7.2.24-0ubuntu0.18.04.17+esm1","7.2.24-0ubuntu0.18.04.17+esm2","7.2.24-0ubuntu0.18.04.17+esm3","7.2.24-0ubuntu0.18.04.17+esm4","7.2.24-0ubuntu0.18.04.17+esm5","7.2.24-0ubuntu0.18.04.17+esm6","7.2.24-0ubuntu0.18.04.17+esm7","7.2.24-0ubuntu0.18.04.17+esm8","7.2.24-0ubuntu0.18.04.17+esm9","7.2.24-0ubuntu0.18.04.17+esm10","7.2.24-0ubuntu0.18.04.17+esm11","7.2.24-0ubuntu0.18.04.17+esm12","7.2.24-0ubuntu0.18.04.17+esm13","7.2.24-0ubuntu0.18.04.17+esm14"]},{"source":"osv","ecosystem":"Ubuntu:Pro:20.04:LTS","package":"php7.4","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["7.4.3-4build1","7.4.3-4build2","7.4.3-4ubuntu1","7.4.3-4ubuntu1.1","7.4.3-4ubuntu2.2","7.4.3-4ubuntu2.4","7.4.3-4ubuntu2.5","7.4.3-4ubuntu2.6","7.4.3-4ubuntu2.7","7.4.3-4ubuntu2.8","7.4.3-4ubuntu2.9","7.4.3-4ubuntu2.10","7.4.3-4ubuntu2.11","7.4.3-4ubuntu2.12","7.4.3-4ubuntu2.13","7.4.3-4ubuntu2.15","7.4.3-4ubuntu2.16","7.4.3-4ubuntu2.17","7.4.3-4ubuntu2.18","7.4.3-4ubuntu2.19","7.4.3-4ubuntu2.20","7.4.3-4ubuntu2.22","7.4.3-4ubuntu2.23","7.4.3-4ubuntu2.24","7.4.3-4ubuntu2.26","7.4.3-4ubuntu2.28","7.4.3-4ubuntu2.29","7.4.3-4ubuntu2.29+esm1","7.4.3-4ubuntu2.29+esm2","7.4.3-4ubuntu2.29+esm3","7.4.3-4ubuntu2.29+esm4","7.4.3-4ubuntu2.29+esm5"]},{"source":"osv","ecosystem":"Ubuntu:22.04:LTS","package":"php8.1","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["8.1.0~rc4-1ubuntu2","8.1.0-1","8.1.2-1ubuntu1","8.1.2-1ubuntu2","8.1.2-1ubuntu2.1","8.1.2-1ubuntu2.2","8.1.2-1ubuntu2.3","8.1.2-1ubuntu2.4","8.1.2-1ubuntu2.5","8.1.2-1ubuntu2.6","8.1.2-1ubuntu2.8","8.1.2-1ubuntu2.9","8.1.2-1ubuntu2.10","8.1.2-1ubuntu2.11","8.1.2-1ubuntu2.13","8.1.2-1ubuntu2.14","8.1.2-1ubuntu2.15","8.1.2-1ubuntu2.17","8.1.2-1ubuntu2.18","8.1.2-1ubuntu2.19","8.1.2-1ubuntu2.20","8.1.2-1ubuntu2.21","8.1.2-1ubuntu2.22","8.1.2-1ubuntu2.23","8.1.2-1ubuntu2.24","8.1.2-1ubuntu2.25","8.1.2-1ubuntu2.26","8.1.2-1ubuntu2.27","8.1.2-1ubuntu2.28"]}],"products":[{"vendor":"php","product":"php"}],"references":[{"url":"https://github.com/php/php-src/commit/bab0b99f376dac9170ac81382a5ed526938d595a","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","fix"]},{"url":"https://bugs.php.net/bug.php?id=74192","tags":["x_refsource_MISC","x_transferred","Permissions Required","Vendor Advisory","report"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2017-7189"},{"url":"https://github.com/advisories/GHSA-3mh5-9253-628p"},{"url":"https://ubuntu.com/security/CVE-2017-7189","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2017-7189","tags":["report"]}],"sources":{"cve":[{"id":"CVE-2017-7189","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.","status":"published","published":"2019-07-10T14:41:35Z","modified":"2024-08-05T15:56:36.063Z","updated_at":"2026-11-02T14:33:20.488433Z"}],"euvd":[{"id":"EUVD-2017-16227","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.","status":"published","published":"2019-07-10T14:41:35Z","modified":"2024-08-05T15:56:36Z","updated_at":"2026-11-03T02:39:09.41676Z"}],"ghsa":[{"id":"GHSA-3mh5-9253-628p","title":"main/streams/xp_socket.c in PHP 7.x before 2017-03-07 misparses fsockopen calls, such as by...","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.","status":"published","published":"2022-05-24T16:49:51Z","modified":"2024-04-04T01:13:44Z","cvss":[{"version":"3.0","score":7.5,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"high"}],"cwes":["CWE-20"],"updated_at":"2026-11-02T14:55:56.17809Z"}],"nvd":[{"id":"CVE-2017-7189","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.","status":"published","published":"2019-07-10T15:15:11.163Z","modified":"2026-06-17T01:23:50.297Z","cvss":[{"version":"3.0","score":7.5,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"high","assessor":"primary"},{"version":"2.0","score":5,"vector":"AV:N/AC:L/Au:N/C:P/I:N/A:N","level":"medium","assessor":"primary"}],"cwes":["CWE-20"],"updated_at":"2026-11-02T14:04:20.074898Z"}],"osv":[{"id":"CVE-2017-7189","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.","status":"published","published":"2019-07-10T15:15:11.163Z","modified":"2026-10-20T13:19:34.720816677Z","cvss":[{"version":"3.0","score":7.5,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"high"}],"updated_at":"2026-11-02T15:44:06.412595Z"},{"id":"UBUNTU-CVE-2017-7189","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.","status":"published","published":"2019-07-10T15:15:00Z","modified":"2026-10-21T23:00:11.482710267Z","cvss":[{"version":"3.0","score":7.5,"vector":"CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"high"}],"updated_at":"2026-11-02T15:54:15.773974Z"}]}}
