Out of bounds read in PHP XML parser with XML_OPTION_SKIP_TAGSTART
Key facts
- Attack vector
- —
- Privileges required
- —
- User interaction
- —
- Attack complexity
- —
- Impact type
- —
- Confidentiality · integrity · availability
- —
- Fix status
- Fixed
No CVSS vector from any source. Fix status from GitHub.
Summary
The php-src XML parser in PHP reads past the end of a buffer when XML_OPTION_SKIP_TAGSTART is set to a high value. Affected are php-src versions before 8.1.32, before 8.2.28, before 8.3.18 and before 8.4.5. An attacker who can supply XML with shorter tag names than expected can trigger the out of bounds read, which can leak heap contents.
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
Description from the GitHub advisory
This is a reocurrence of bug #72714 . ### Impact Out of bounds read can leak heap contents. ```php <?php $sample = "<?xml version=\"1.0\"?><test><child/></test>"; $parser = xml_parser_create(); xml_parser_set_option($parser, XML_OPTION_SKIP_TAGSTART, 100); $res = xml_parse_into_struct($parser,$sample,$vals,$index); var_dump($vals); ``` If we set `XML_OPTION_SKIP_TAGSTART` to a high value, we can read out of bounds. It doesn't even have to be a crazy high value, as long as an attacker can supply XML with shorter tag names than expected they can trigger an OOB read. I coincidentally came across this by reviewing `xml.c`, I noticed this is a reocurrence of https://bugs.php.net/bug.php?id=72714 This was originally fixed in https://github.com/php/php-src/commit/9164dc11e2323b8b80c389bb13d70789799b44fc, but it seems the fix was either incomplete or not merged properly. Granted, this option is rarely used. ### Workarounds Don't use `XML_OPTION_SKIP_TAGSTART`.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | php-src | < 8.1.32 | 8.1.32 | Patch available | GHSA-wg4p-4hqh-c3g9 |
| — | php-src | < 8.2.28 | 8.2.28 | Patch available | GHSA-wg4p-4hqh-c3g9 |
| — | php-src | < 8.3.18 | 8.3.19 | Patch available | GHSA-wg4p-4hqh-c3g9 |
| — | php-src | < 8.4.5 | 8.4.5 | Patch available | GHSA-wg4p-4hqh-c3g9 |
- php-src Vendor— Affected < 8.1.32 Fixed in 8.1.32 Patch available GHSA-wg4p-4hqh-c3g9
- php-src Vendor— Affected < 8.2.28 Fixed in 8.2.28 Patch available GHSA-wg4p-4hqh-c3g9
- php-src Vendor— Affected < 8.3.18 Fixed in 8.3.19 Patch available GHSA-wg4p-4hqh-c3g9
- php-src Vendor— Affected < 8.4.5 Fixed in 8.4.5 Patch available GHSA-wg4p-4hqh-c3g9
Remediation
Upgrade php-src to 8.1.32, 8.2.28, 8.3.19 or 8.4.5, depending on the branch in use. As a workaround, do not use XML_OPTION_SKIP_TAGSTART.
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
- Fix · GHSA-wg4p-4hqh-c3g9 php-src Fixed in 8.1.32 Advisory →
- Fix · GHSA-wg4p-4hqh-c3g9 php-src Fixed in 8.2.28 Advisory →
- Fix · GHSA-wg4p-4hqh-c3g9 php-src Fixed in 8.3.19 Advisory →
- Fix · GHSA-wg4p-4hqh-c3g9 php-src Fixed in 8.4.5 Advisory →
Timeline
- 2026-11-12 Threatist record created from GHSA-wg4p-4hqh-c3g9
References
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences