---
id: "CVE-2026-118370"
kind: "vulnerability"
aliases: ["CVE-2026-118370"]
title: "libexpat: attribute count overflow lets crafted XML corrupt heap memory"
severity: "high"
cvss: 8.2
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["c", "libexpat", "linux-distros", "package", "php", "python", "xml-parsing"]
not_affected_if: ["trusted-input-only"]
published_at: "2026-10-28T03:17:13+00:00"
first_seen_at: "2026-10-28T03:31:02+00:00"
updated_at: "2026-10-28T03:32:26+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-118370", "first_seen_at": "2026-10-28T03:31:02+00:00"}]
---

# libexpat: attribute count overflow lets crafted XML corrupt heap memory

libexpat, the XML parser library, has a signed integer overflow in storeAtts() that an attacker can trigger with a multi-gigabyte XML document containing a start tag with over 2^30 attributes. The result is an out-of-bounds heap write that crashes the application or corrupts memory.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Run `pkg-config --modversion expat` or check the bundled libexpat version in each application that parses XML from untrusted sources.
- Find which services parse XML from outside the network, such as uploads, feeds, SOAP or SAML endpoints.

## Fix

- Upgrade libexpat to a release later than `2.9.0` once the upstream fix is published; the sources do not name the fixed version.
- Apply distribution or vendor libexpat updates as they ship.

## Timeline

- 2026-10-28T03:31:02+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-118370

## From the sources

libexpat through 2.9.0 contains a signed integer overflow vulnerability in storeAtts() in lib/xmlparse.c that allows attackers to trigger out-of-bounds writes via oversized attribute counts. Attackers can supply a multi-gigabyte document with a start tag carrying over 2^30 attributes to overflow attIndex and nPrefixes, crashing applications or corrupting heap memory.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
