CVE-2026-8532
Overview
Background
- libexpat
- The streaming XML parser vendored in Chromium as
third_party/expat, whoseREADME/METADATAversion 2.7.1 the scanner report flags as affected by CVE-2026-25210. - `TAG` buffer
- Every open start tag has a
TAGrecord whosebuf/bufEndhold the converted element name, starting atINIT_TAG_BUF_SIZEbytes (expat/lib/xmlparse.c:3475-3480). - `XmlConvert`
- Converts the raw tag name from the input encoding into
XML_Char, writing throughtoPtrup to the limit(ICHAR *)tag->bufEnd - 1(:3497-3498). - `SIZE_MAX`
- The largest
size_tvalue, so multiplying any size aboveSIZE_MAX / 2by 2 wraps around.
Root Cause Analysis
9c2d990389e6. An earlier analysis was withdrawn because it had been written against a dependency roll (6154446fccef).For XML_TOK_START_TAG_NO_ATTS / XML_TOK_START_TAG_WITH_ATTS tokens, the parser converts the raw tag name into tag->buf in a loop (expat/lib/xmlparse.c:3490-3515). The enclosing function is doContent, which is not shown in the excerpt but is named in libexpat’s changelog for CVE-2026-25210 (inferred). When the converted name does not fit, the loop doubles the buffer size with const size_t bufSize = (size_t)(tag->bufEnd - tag->buf) * 2; (:3505) and has no overflow check. If the current size is above SIZE_MAX / 2, bufSize wraps to a smaller value, possibly zero, and REALLOC (:3507) can succeed with a block smaller than the data already converted. The code then sets tag->bufEnd = temp + bufSize (:3511) and toPtr = (XML_Char *)temp + convLen (:3512), so toPtr can point past the new allocation. The later write *toPtr = XML_T('\0') (:3517) and any further XmlConvert output would then land out of bounds (inferred for the converter’s internal limit handling).
The fix adds if (SIZE_MAX / 2 < (size_t)(tag->bufEnd - tag->buf)) return XML_ERROR_NO_MEMORY; just before the multiplication. This only makes the code stricter: a doubling that would wrap is rejected with an error, and nothing else is accepted that was not accepted before.
size_t fits, so a wrapped, smaller size could be passed to REALLOC while the code went on assuming the buffer had grown. The fix rejects the doubling when it would exceed SIZE_MAX.Attack Path
- Supply XML to a libexpat consumer The attacker gets XML parsed by a component that uses Chromium’s bundled expat. Which Chrome component parses untrusted XML with expat is not shown in the material (inferred).
- Use an extremely long element name
A start tag whose converted name keeps doubling
tag->buf(:3505-3511) until its size passesSIZE_MAX / 2. That needs more than half the address space, so in practice only 32-bit builds come into question (inferred). - Wrapped reallocation
bufSizewraps,REALLOCreturns a block that is too small, andtoPtris placed beyond it (:3512). - Out-of-bounds write
Further conversion output or the terminator write at
:3517lands outside the allocation (inferred).
Impact Assessment
SIZE_MAX / 2 bytes, which is unrealistic on 64-bit and very hard on 32-bit (inferred). The vendor rates it high severity, and the advisory does not report in-the-wild exploitation.Files Changed
expat/lib/xmlparse.c
Audit Directions
- Geometric buffer growthLook for other
size * 2/size << 1growth patterns inexpat/lib/xmlparse.c(attribute arrays, string pools, namespace bindings), and make sure each one has aSIZE_MAX-based guard before the multiplication. - `int` length truncation next to `size_t` growth
convLen = (int)(toPtr - (XML_Char *)tag->buf)(:3499) narrows a pointer difference toint. Check whether lengths aboveINT_MAXcan produce a negative or truncatedstrLenor offset. - Vendored-library version driftTrack
third_party/expatagainst upstream security releases. This issue was found by version matching, not by a Chromium-side report.
Patch
diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
index ee18a87..d8c54c3 100644
--- a/expat/lib/xmlparse.c
+++ b/expat/lib/xmlparse.c
@@ -3502,6 +3502,8 @@
tag->name.strLen = convLen;
break;
}
+ if (SIZE_MAX / 2 < (size_t)(tag->bufEnd - tag->buf))
+ return XML_ERROR_NO_MEMORY;
const size_t bufSize = (size_t)(tag->bufEnd - tag->buf) * 2;
{
char *temp = REALLOC(parser, tag->buf, bufSize);
Original Bug Report
Vulnerability: CVE-2026-25210 affecting GitOnBorg::chromium::chromium::src
Hello,
This is a vulnerability bug regarding packages in:
Git-on-Borg: - https://chromium.git.corp.google.com/chromium/src
A security vulnerability in one of your packages has been detected by our automated security scanner using information in your package’s metadata file. See go/vuln-monitoring for more details.
Software name and version number matching can be imprecise, i.e. this vulnerability might not apply to your package - see Remediation Requirements for how to proceed.
Vulnerabilities
Vulnerabilities were detected by matching your package version against vulnerability feeds.
Your package version was sourced from Ecosystem Specific Identifier (ESI) or Common Platform Enumeration (CPE) identifiers in the following files:
README.*orMETADATAfile in this directory
As of now, the following advisories were detected in your package:
| Identifier | Advisory | Current Version | Recommended Action |
|---|---|---|---|
cpe:2.3:a:libexpat_project:libexpat:2.7.1:*:*:*:*:*:*:* |
CVE-2026-25210 | 2.7.1 | Upgrade to version 2.7.4 or later |
Remediation Requirements
- Update the package past the vulnerable version(s) listed above.
- If the vulnerability is a true positive but a fix cannot be implemented within the SLO, file an exception request at: go/vuln-slo-exceptions.
- If you cannot update due to technical blockers, AND the package is not affected by the vulnerability, follow the steps in: go/third-party-package-remediation-playbook#not-affected.
- Update the CPE and/or Ecosystem Specific Identifiers (ESI) versions to reflect the updated version.
- Mark the bug as Fixed once remediation is complete. Ensure remediation is complete within the SLO specified at go/vuln-slo. It is expected that this P1 vulnerability is mitigated within 2 weeks.
If you cannot update past the vulnerable versions, see go/third-party-package-remediation-playbook for instructions on how to handle back-ported patches, false positives, and other special cases.
Support & Feedback
See go/third-party-package-vuln-support for FAQ and support paths.
Please use this Vulnstore link to see the latest detection times of the vulnerabilities associated with this bug and if vulnerabilities are still being detected. We aim to scan daily, however the frequency may differ from scanner to scanner (in Vulnstore, click on the title and switch to the Tracking tab to see all detection timestamps).
<details>
<summary>Template Debug Information</summary>
- Template identifier: tpp
</details>
Reported for SCARAB Remediation ID: 21354f76-4d31-4e8e-9410-781637a918ad
- http://go/vulnstore-bug/CjgKDAiAyeHcBhCgq66TAhIoCAEyJDIxMzU0Zjc2LTRkMzEtNGU4ZS05NDEwLTc4MTYzN2E5MThhZBIVASua-UGEpVgGPMN7ExalLXroz7nx
- https://chromium.git.corp.google.com/chromium/src
- https://chromium.git.corp.google.com/chromium/src/+/refs/heads/main/third_party/expat
- https://nvd.nist.gov/vuln/detail/CVE-2026-25210