Security Advisory

CVE-2022-40303: libxml2 XML_PARSE_HUGE Overflow

Last updated:
  • CVE-2022-40303

CVE-2022-40303 is an integer overflow in libxml2: parsing a multi-gigabyte XML document with the XML_PARSE_HUGE option overflows several counters, so the parser accesses an array at a negative 2 GB offset and usually crashes. It affects libxml2 before 2.10.3, NVD scores it 7.5, and Siemens lists affected SCALANCE and SIMATIC firmware.

Vulnerability summary

CVSS base score

7.5

High severity

EPSS score (FIRST)

41.4%

Probability of exploitation in the wild in the next 30 days

CISA KEV catalog

No

Not listed

Published

Vulnerability ID: CVE-2022-40303 · Source: NVD

Affected components

ComponentCPEVersion range
libxml2 (XML_PARSE_HUGE)cpe:2.3:a:xmlsoft:libxml2:*:*:*:*:*:*:*:*before 2.10.3 (fixed in 2.10.3, 14 October 2022)
Siemens SCALANCE W700 IEEE 802.11ax family—before V3.0.0 (fixed in V3.0.0, per SSA-769027)
Siemens TIM 1531 IRC and SIPLUS TIM 1531 IRC—before V2.4.8 (fixed in V2.4.8, per SSA-337522)
Siemens SIMATIC CP 1542SP-1, CP 1542SP-1 IRC and CP 1543SP-1—before V2.3 (fixed in V2.3, per SSA-625862)

What does this mean for affected devices?

CVE-2022-40303 is an integer overflow (CWE-190) in libxml2's parser. NVD's description: in libxml2 before 2.10.3, "when parsing a multi-gigabyte XML document with the XML_PARSE_HUGE parser option enabled, several integer counters can overflow. This results in an attempt to access an array at a negative 2GB offset, typically leading to a segmentation fault." NVD's Primary CVSS 3.1 score is 7.5, vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H, an availability impact (NVD).

The upstream fix, credited to a report from Maddie Stone of Google Project Zero, does more than widen the counters: it also imposes size limits when XML_PARSE_HUGE is set, capping names at XML_MAX_TEXT_LENGTH (10 million bytes) and other content at XML_MAX_HUGE_LENGTH (1 billion bytes). libxml2 2.10.3 (14 October 2022) shipped it; its NEWS file lists "[CVE-2022-40303] Fix integer overflows with XML_PARSE_HUGE" next to CVE-2022-40304, a dictionary corruption bug fixed in the same release.

Siemens ProductCERT names industrial devices that ship the vulnerable library, scoring the CVE 7.5. SSA-769027 covers SCALANCE W700 IEEE 802.11ax access points and clients (WAB762-1, WAM763-1, WAM766-1, WUB762-1, WUM763-1 and WUM766-1 variants) before V3.0.0, fixed in V3.0.0. SSA-337522 covers the TIM 1531 IRC telecontrol module and its SIPLUS variant before V2.4.8. SSA-625862 covers SIMATIC CP 1542SP-1, CP 1542SP-1 IRC and CP 1543SP-1 communication processors and their SIPLUS ET 200SP variants before V2.3.

Reachability turns on one parser flag. The overflow needs a multi-gigabyte document parsed with XML_PARSE_HUGE, which relaxes libxml2's built-in size limits. For a device, look for code that passes XML_PARSE_HUGE (or the HUGE option of a language binding) on input that arrives from the network, such as a SOAP, NETCONF or configuration-import handler; without the flag, libxml2 applies its default size limits to such input. The Debian tracker marks bullseye fixed in 2.9.10+dfsg-6.7+deb11u3 (DSA-5271-1), so a "2.9.10" version string can still carry the patch.

This CVE is not in the CISA KEV catalog as of 2026-11-16 (catalog version 2026.11.13, CISA KEV). FIRST EPSS gives it 0.414, the 98.7th percentile, in its 2026-11-15 dataset (FIRST EPSS).

The fix is libxml2 2.10.3 or later, or the backported patch; dropping XML_PARSE_HUGE for untrusted input also removes the path. Our zlib, Expat and libxml2 vulnerabilities in embedded firmware guide explains how to find libxml2 in an image from its version string and which parser options to review, and the memory corruption fix guide covers integer overflow fixes in C parsers.

How to fix this class of issueThis advisory's weakness class is Memory corruption. Our practical guide covers how to detect, fix, verify and disclose it: How to fix memory corruption in embedded firmware.

Evidence

  • libxml2 before 2.10.3: multi-gigabyte XML with XML_PARSE_HUGE overflows integer counters, negative 2GB offset, typically a segfault; NVD Primary CVSS 3.1 7.5 (A:H); CWE-190. — NVD
  • Fix commit (2022-10-14) also imposes size limits with XML_PARSE_HUGE: names to XML_MAX_TEXT_LENGTH (10 million bytes), other content to XML_MAX_HUGE_LENGTH (1 billion bytes); reported by Maddie Stone, Google Project Zero. — libxml2 commit c846986
  • v2.10.3 (Oct 14 2022) security: CVE-2022-40304 dict corruption, CVE-2022-40303 integer overflows with XML_PARSE_HUGE. — libxml2 NEWS
  • SCALANCE W700 802.11ax (WAB762-1, WAM763-1, WAM766-1, WUB762-1, WUM763-1, WUM766-1) before V3.0.0 affected, fix V3.0.0; Siemens CVSS 7.5. — Siemens SSA-769027
  • TIM 1531 IRC and SIPLUS TIM 1531 IRC before V2.4.8 affected, fix V2.4.8. — Siemens SSA-337522
  • SIMATIC CP 1542SP-1, CP 1542SP-1 IRC, CP 1543SP-1 and SIPLUS ET 200SP variants before V2.3 affected, fix V2.3. — Siemens SSA-625862
  • Debian bullseye fixed in 2.9.10+dfsg-6.7+deb11u3 (DSA-5271-1). — Debian Security Tracker
  • Not in the CISA KEV catalog version 2026.11.13 as of 2026-11-16. — CISA KEV
  • EPSS 0.41365, percentile 0.98694, dataset 2026-11-15. — FIRST EPSS

Related advisories

Sources

  1. NVD
  2. libxml2 commit c846986: fix integer overflows with XML_PARSE_HUGE
  3. libxml2 NEWS (v2.10.3)
  4. Siemens SSA-769027 (SCALANCE W700 802.11ax before V3.0.0)
  5. Siemens SSA-337522 (TIM 1531 IRC before V2.4.8)
  6. Siemens SSA-625862 (SIMATIC CP 1542SP-1 and CP 1543SP-1 before V2.3)
  7. Debian Security Tracker
  8. CISA KEV
  9. CISA KEV data (catalog JSON)
  10. FIRST EPSS

Frequently asked questions

Does CVE-2022-40303 affect libxml2 without XML_PARSE_HUGE?

The overflow NVD describes needs a multi-gigabyte document parsed with the XML_PARSE_HUGE option enabled; that option relaxes the default size limits that otherwise stop such input (per NVD and the libxml2 fix commit).

Which Siemens devices are affected by CVE-2022-40303?

SSA-769027 lists SCALANCE W700 IEEE 802.11ax devices before V3.0.0, SSA-337522 lists TIM 1531 IRC before V2.4.8, and SSA-625862 lists SIMATIC CP 1542SP-1 and CP 1543SP-1 before V2.3 (per Siemens ProductCERT).

Which libxml2 release fixes CVE-2022-40303?

libxml2 2.10.3, released 14 October 2022, together with CVE-2022-40304. The fix also caps names at 10 million bytes and other content at 1 billion bytes when XML_PARSE_HUGE is set (per libxml2 NEWS and the fix commit).

Is CVE-2022-40303 in the CISA KEV catalog?

No, it is absent from catalog version 2026.11.13 as of 2026-11-16. FIRST EPSS gives it 0.414, the 98.7th percentile, in the 2026-11-15 dataset (per CISA KEV and FIRST EPSS).