xml_parse_into_struct segmentation fault
xml_parse_into_struct did not check parser->level before using it as an offset, causing invalid memory access when parsing XML input.
- Fixed in 6 days
- Paid in 6 days
- Disclosed after 3.5 years
https://bugs.php.net/bug.php?id=72099
Invalid memory access while parsing XML input using xml_parse_into_struct, parser->level wasn't being checked and then used as an offset parser->ltags[parser->level-1].
Reported to developers on 2016-04-25, fixed 2016-04-25 and released at 2016-04-28, affected PHP 5.5 , 5.6 and 7.
http://php.net/ChangeLog-5.php#5.5.35 http://php.net/ChangeLog-5.php#5.6.21 http://php.net/ChangeLog-7.php#7.0.6
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The parser's level counter was used as an array index without first verifying it was within bounds.
What the attacker needed
Ability to supply XML input to xml_parse_into_struct
The fix
The bug was fixed by adding a check on parser->level before using it as an offset.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
PHP's XML parsing function used a nesting level value as an array offset without checking it, causing invalid memory access.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.