The flaw, tracked as CVE-2025-1219, involves the incorrect handling of the content-type header when a redirected resource is requested, leading to security risks such as document misinterpretation and validation bypass.
The vulnerability affects PHP versions:
The issue arises when the HTTP stream wrapper follows a redirect. Instead of clearing previously captured headers before executing subsequent requests, it appends the headers from multiple requests into a single array.
This results in an array containing headers from all requests, with the headers from the final request placed last.
The function php_libxml_input_buffer_create_filename() or php_libxml_sniff_charset_from_stream() scans this array for a content-type header to determine the charset of the response.
However, it processes the headers sequentially from top to bottom and stops at the first content-type header it encounters.
According to the PHP report, This header may not correspond to the final response containing the HTML body being parsed. Consequently, documents may be parsed with an incorrect charset, leading to potential security issues.
This vulnerability can allow attackers to manipulate how documents are parsed by exploiting incorrect charset detection. For instance:
->saveHtml() could result in unintended outputs with the original charset preserved.Applications using PHP’s DOM or SimpleXML extensions for HTTP requests are particularly vulnerable.
A proof-of-concept (PoC) demonstrates how this vulnerability can be exploited:
redirect.php) sends a content-type header specifying a charset (utf-16) and redirects to another resource.content-type header is incorrectly used for parsing instead of that of the final response.This behavior can lead to incorrect parsing and validation bypasses, as shown in scenarios where exported HTML content retains its original charset despite being manipulated.
PHP developers have addressed this issue in the following versions:
To protect against CVE-2025-1219, users are strongly advised to update their PHP installations to one of the patched versions listed above:
php -v.CVE-2025-1219 highlights a critical flaw in how PHP handles HTTP redirects using libxml streams, posing risks for applications that parse documents via HTTP requests. The vulnerability underscores the importance of regularly updating software to address emerging security threats.
Are You from SOC/DFIR Team? - Try Free Malware Research with ANY.RUN - Start Now
The post Critical PHP Vulnerability Let Hackers Bypass the Validation To Load Malicious Content appeared first on Cyber Security News.
In September, Donald Trump claimed that "the United States is getting a tremendous fee" for…
ABILENE, Texas (KTAB/KRBC) - Two men in Abilene, a father and son, were arrested Friday…
According to Reuters, Meta is looking to offset spending on AI and data centers with…
Hulu has decided to scrap Buffy the Vampire Slayer: New Sunnydale, its planned continuation series…
Jostling a folded piece of paper, holding it marooned in the air, selectman Beth Blair…
Boscawen voters cruised through a speedy town meeting Friday night, one with so little controversy…
This website uses cookies.