{"vuln_id":"CVE-2025-1220","aliases":["CVE-2025-1735","CVE-2025-6491","GHSA-3cr5-j632-f35r"],"description":"php8.2 - security update","published_at":"2025-07-03T12:27:07Z","modified_at":"2026-11-20T01:19:10.771314Z","first_seen_at":"2026-11-21T19:15:06.060499Z","severity":"medium","severity_source":"cvss","cvss_score":5.3,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","cwe":["CWE-918"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":0.0074,"epss_percentile":0.55509,"nvd_status":null,"enriched_at":null,"links":{"nvd":"https://nvd.nist.gov/vuln/detail/CVE-2025-1220"},"matched_alias":null,"items":[{"id":480,"source":{"id":"debian-php","name":"Debian 12 php8.2 (package vulnerabilities)"},"title":"php8.2 (Debian:12): DSA-5967-1 / CVE-2025-1220 - php8.2 - security update","summary":"Affected: Debian:12:php8.2\n\nFixed in: 8.2.29-1~deb12u1","url":"https://osv.dev/vulnerability/DSA-5967-1","published_at":"2025-07-28T00:00:00Z","updated_at":"2026-11-20T01:19:10.771314Z","fetched_at":"2026-11-21T19:15:05.963725Z","severity":"high","cvss_score":7.5,"epss":0.01157,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":"php","product":"php8.2","vuln_id":"CVE-2025-1220","vuln_ids":["CVE-2025-1094","CVE-2025-1220","CVE-2025-1735","CVE-2025-6491","DSA-5967-1","GHSA-3CR5-J632-F35R","GHSA-453J-Q27H-5P8X","GHSA-HRWM-9436-5MV3"],"tags":["package-watch","pkg:php8.2","fix-available"],"cluster_id":362,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/480","html":"https://vulnwatch.ve1ve2.com/item/480"}},{"id":11932,"source":{"id":"debian13-php","name":"Debian 13 php8.4 (package vulnerabilities)"},"title":"php8.4 (Debian:13): DEBIAN-CVE-2025-1220 / CVE-2025-1220 - In PHP versions:8.1.* before 8.1.33, 8.2.* before 8.2.29, 8.3.* before 8.3.23, 8.4.* before 8.4.10 some functions like fsockopen() lack validation that the hos…","summary":"In PHP versions:8.1.* before 8.1.33, 8.2.* before 8.2.29, 8.3.* before 8.3.23, 8.4.* before 8.4.10 some functions like fsockopen() lack validation that the hostname supplied does not contain null characters. This may lead to other functions like parse_url() treat the hostname in different way, thus opening way to security problems if the user code implements access checks before access using such functions.\n\nAffected: Debian:12:php8.2, Debian:13:php8.4, Debian:14:php8.4\n\nFixed in: 8.4.10-1\n\nReferences:\nhttps://security-tracker.debian.org/tracker/CVE-2025-1220","url":"https://osv.dev/vulnerability/DEBIAN-CVE-2025-1220","published_at":"2025-07-13T23:15:22.773000Z","updated_at":"2026-09-01T20:05:40.557637Z","fetched_at":"2026-11-22T13:39:48.366415Z","severity":"medium","cvss_score":5.3,"epss":0.0074,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":"php","product":"php8.4","vuln_id":"CVE-2025-1220","vuln_ids":["CVE-2025-1220","CVE-2025-1735","CVE-2025-6491","DEBIAN-CVE-2025-1220","GHSA-3CR5-J632-F35R"],"tags":["package-watch","pkg:php8.4","stack","debian13","fix-available"],"cluster_id":362,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/11932","html":"https://vulnwatch.ve1ve2.com/item/11932"}},{"id":536,"source":{"id":"debian-php","name":"Debian 12 php8.2 (package vulnerabilities)"},"title":"php8.2 (Debian:12): DEBIAN-CVE-2025-1220 / CVE-2025-1220 - In PHP versions:8.1.* before 8.1.33, 8.2.* before 8.2.29, 8.3.* before 8.3.23, 8.4.* before 8.4.10 some functions like fsockopen() lack validation that the hos…","summary":"In PHP versions:8.1.* before 8.1.33, 8.2.* before 8.2.29, 8.3.* before 8.3.23, 8.4.* before 8.4.10 some functions like fsockopen() lack validation that the hostname supplied does not contain null characters. This may lead to other functions like parse_url() treat the hostname in different way, thus opening way to security problems if the user code implements access checks before access using such functions.\n\nAffected: Debian:12:php8.2, Debian:13:php8.4, Debian:14:php8.4\n\nFixed in: 8.2.29-1~deb12u1\n\nReferences:\nhttps://security-tracker.debian.org/tracker/CVE-2025-1220","url":"https://osv.dev/vulnerability/DEBIAN-CVE-2025-1220","published_at":"2025-07-13T23:15:22.773000Z","updated_at":"2026-09-01T20:05:40.557637Z","fetched_at":"2026-11-21T19:15:05.963806Z","severity":"medium","cvss_score":5.3,"epss":0.0074,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":"php","product":"php8.2","vuln_id":"CVE-2025-1220","vuln_ids":["CVE-2025-1220","CVE-2025-1735","CVE-2025-6491","DEBIAN-CVE-2025-1220","GHSA-3CR5-J632-F35R"],"tags":["package-watch","pkg:php8.2","fix-available"],"cluster_id":362,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/536","html":"https://vulnwatch.ve1ve2.com/item/536"}},{"id":12637,"source":{"id":"gh-php-src","name":"PHP releases (GitHub php/php-src tags)"},"title":"GHSA-3cr5-j632-f35r / CVE-2025-1220: Null byte termination in hostnames","summary":"Null byte termination in hostnames ### Summary `fsockopen()` doesn't regard `hostname` as well, `hostname` is terminated at the null byte. This can cause Server Side Request Forgery in general case. ### Details During `fsockopen` is being called `hostname` is passed directly to the low-level C function calls. [/etc/standard/fsock.c:50](https://github.com/php/php-src/blob/80637d11b39b26f32fc2fbf5150c9564dd30edd5/ext/standard/fsock.c#L50) ```c static void php_fsockopen_stream(INTERNAL_FUNCTION_PARAMETERS, int persistent) { char *host; size_t host_len; zend_long port = -1; zval *zerrno = NULL, *zerrstr = NULL; double timeout; bool timeout_is_null = 1; #ifndef PHP_WIN32 time_t conv; #else long conv; #endif struct timeval tv; char *hashkey = NULL; php_stream *stream = NULL; int err; char *hostname = NULL; size_t hostname_len; zend_string *errstr = NULL; ZEND_PARSE_PARAMETERS_START(1, 5) Z_PARAM_STRING(host, host_len) Z_PARAM_OPTIONAL Z_PARAM_LONG(port) Z_PARAM_ZVAL(zerrno) Z_PARAM_ZVAL(zerrstr) Z_PARAM_DOUBLE_OR_NULL(timeout, timeout_is_null) ZEND_PARSE_PARAMETERS_END(); // ... stream = php_stream_xport_create(hostname, hostname_len, REPORT_ERRORS, STREAM_XPORT_CLIENT | STREAM_XPORT_CONNECT, hashkey, &tv, NULL, &errstr, &err); ``` When `fsockopen()` is called, it retrieves hostname from first parameter, into `host` and `host_len`. `host` can contain null bytes in the middle of the string, but `host_len` can be used to prevent unexpected null termination. These two `host` and `host_len` is passed to `php_stream_xport_create()` [/main/streams/transports.c:_php_stream_xporet_create()](https://github.com/php/php-src/blob/80637d11b39b26f32fc2fbf5150c9564dd30edd5/main/streams/transports.c#L97) ```c orig_path = name; for (p = name; isalnum((int)*p) || *p == '+' || *p == '-' || *p == '.'; p++) { n++; } if ((*p == ':') && (n > 1) && !strncmp(\"://\", p, 3)) { protocol = name; name = p + 3; namelen -= n + 3; } else { protocol = \"tcp\"; n = 3; } ``` After TCP factory is selected, `php_network_getaddresses()` is called, but still null bytes or any control characters are not processed. This will lead Server Side Request Forgery. While other url-related functions like [parse_url](https://github.com/php/php-src/blob/80637d11b39b26f32fc2fbf5150c9564dd30edd5/ext/standard/url.c#L319) has processing logic using `zend_string` type and `iscntrl()` check. This difference can be used to trigger SSRF in general case. For example, one developer can write following reasonable code. ```php","url":"https://github.com/php/php-src/security/advisories/GHSA-3cr5-j632-f35r","published_at":"2025-07-03T12:27:07Z","updated_at":"2026-05-19T20:16:40Z","fetched_at":"2026-11-22T14:05:37.431180Z","severity":"medium","cvss_score":5.3,"epss":0.0074,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":"php","product":"php-src","vuln_id":"CVE-2025-1220","vuln_ids":["CVE-2025-1220","CVE-2025-1735","CVE-2025-6491","GHSA-3CR5-J632-F35R"],"tags":["repo-advisory","CWE-918","security","repo:php/php-src","stack"],"cluster_id":11746,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/12637","html":"https://vulnwatch.ve1ve2.com/item/12637"}}]}