{"vuln_id":"GHSA-p3x9-6h7p-cgfc","aliases":["CVE-2025-1219"],"description":"libxml streams use wrong `content-type` header when requesting a redirected resource","published_at":"2025-03-13T17:44:17Z","modified_at":"2025-03-13T17:44:17Z","first_seen_at":"2026-11-22T14:05:37.616629Z","severity":"medium","severity_source":"ghsa","cvss_score":null,"cvss_vector":null,"cwe":[],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":null,"epss_percentile":null,"nvd_status":null,"enriched_at":null,"links":{"nvd":"https://github.com/advisories/GHSA-p3x9-6h7p-cgfc"},"matched_alias":null,"items":[{"id":12656,"source":{"id":"gh-php-src","name":"PHP releases (GitHub php/php-src tags)"},"title":"GHSA-p3x9-6h7p-cgfc / CVE-2025-1219: libxml streams use wrong `content-type` header when requesting a redirected resource","summary":"libxml streams use wrong `content-type` header when requesting a redirected resource ### Summary When requesting a HTTP resource using the DOM or SimpleXML extensions, the wrong `content-type` header is used to determine the charset when the requested resource performs a redirect. ### Details When the HTTP stream wrapper follows a redirect, it does not clear the list of captured headers before performing the following requests. This means in the returned array containing the response headers, the headers of multiple requests are stored one after each other. The final request comes last in this array. The `php_libxml_input_buffer_create_filename()` / `php_libxml_sniff_charset_from_stream()` function scans the header array from top to bottom, returning after finding the first `content-type` header. This `content-type` header does not necessarily belong to the response that corresponds to the HTML body that is being parsed. ### PoC redirect.php ``` querySelector('body')->textContent, 'Example')) { throw new Exception('Refusing to store example content'); } var_dump(\\str_contains($document->saveHtml(), 'Example')); // bool(true) ``` ### Impact This allows an attacker to cause a document to be parsed incorrectly, changing its meaning and possibly bypassing validation. When exporting such a document with `->saveHtml()` the document will be returned with the original charset. Users that request documents via HTTP using the DOM or SimpleXML extensions are impacted. Patched: 8.1.32, 8.2.28, 8.3.19, 8.4.5","url":"https://github.com/php/php-src/security/advisories/GHSA-p3x9-6h7p-cgfc","published_at":"2025-03-13T17:44:17Z","updated_at":"2025-03-13T17:44:17Z","fetched_at":"2026-11-22T14:05:37.431191Z","severity":"medium","cvss_score":5.3,"epss":0.00749,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":"php","product":"php-src","vuln_id":"CVE-2025-1219","vuln_ids":["CVE-2025-1217","CVE-2025-1219","CVE-2025-1734","CVE-2025-1736","CVE-2025-1861","GHSA-P3X9-6H7P-CGFC"],"tags":["repo-advisory","security","repo:php/php-src","stack"],"cluster_id":11765,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/12656","html":"https://vulnwatch.ve1ve2.com/item/12656"}}]}