CVE-2021-42260
High · 7.5CVSS
7.5
EPSS
3.3%
Published
Oct 11, 2021
CISA due date
—
Cloudanix analysis
A problem in a common XML reading tool lets attackers send bad data that freezes programs and stops them from working.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Denial Of Service
- Component
- Library
- Class
- Denial of service
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
The flaw triggers an infinite loop inside TiXmlParsingData::Stamp when processing a crafted UTF-8 lead byte sequence (TIXML_UTF_LEAD_0), consuming CPU until the process is terminated or the system is exhausted.
Why it matters to the business
Services that accept untrusted XML input can be forced offline, causing outages, delayed processing, and potential loss of availability for dependent applications and users.
How an attack unfolds
An attacker crafts a minimal XML document containing the triggering byte sequence and sends it to any application that parses XML with the vulnerable TinyXML library; the parser enters the loop and never returns, resulting in denial of service.
How to fix it
Replace TinyXML with a maintained fork or alternative XML parser; if an upstream fix exists beyond version 2.6.2, upgrade all affected packages; otherwise apply strict input sanitization or size limits before parsing.
How to confirm the fix worked
Attempt to parse the known triggering XML snippet in a controlled environment and confirm the parser returns or times out instead of looping; re-test after any library update or wrapper change.
Typical attack path
- Identify an endpoint or service that ingests XML using TinyXML
- Craft a minimal XML payload containing the TIXML_UTF_LEAD_0 byte pattern
- Transmit the payload over the network or via local file upload
- Observe sustained high CPU usage or process hang confirming the loop
How to detect it
Review application and system logs for processes that become unresponsive while handling XML; correlate with sudden CPU saturation on services known to use TinyXML; inspect any available stack traces pointing to TiXmlParsingData::Stamp.
What your security team should do
- Inventory all software that statically or dynamically links TinyXML
- Prioritize replacement or upgrade on any internet-facing or multi-tenant systems
- Add XML schema validation and size limits in front of the parser as a temporary control
- Monitor for anomalous CPU spikes on hosts running affected parsers
The record
TinyXML through 2.6.2 has an infinite loop in TiXmlParsingData::Stamp in tinyxmlparser.cpp via the TIXML_UTF_LEAD_0 case. It can be triggered by a crafted XML message and leads to a denial of service.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Chainguard | tinyxml | 0 | 2.6.2-r1 |
| Chainguard | tinyxml-dev | 0 | 2.6.2-r1 |
| Debian:10 | tinyxml | 0 | 2.6.2-4+deb10u1 |
| Debian:11 | tinyxml | 0 | 2.6.2-4+deb11u1 |
| Debian:12 | tinyxml | 0 | 2.6.2-6 |
| Debian:13 | tinyxml | 0 | 2.6.2-6 |
| Debian:9 | tinyxml | 0 | 2.6.2-4+deb9u1 |
| Mageia:8 | tinyxml | 0 | 2.6.2-12.1.mga8 |
| Ubuntu:20.04:LTS | tinyxml | 0 | 2.6.2-4+deb10u1build0.20.04.1 |
| Ubuntu:22.04:LTS | tinyxml | 0 | 2.6.2-6 |
| Ubuntu:Pro:16.04:LTS | tinyxml | 0 | 2.6.2-3ubuntu0.1~esm1 |
| Ubuntu:Pro:18.04:LTS | tinyxml | 0 | 2.6.2-4ubuntu0.18.04.1~esm1 |
| Wolfi | tinyxml | 0 | 2.6.2-r1 |
| Wolfi | tinyxml-dev | 0 | 2.6.2-r1 |
| openSUSE:Leap 15.2 | tinyxml | 0 | 2.6.2-lp152.4.3.1 |
| openSUSE:Leap 15.3 | tinyxml | 0 | 2.6.2-3.3.1 |
Related vulnerabilities
- CVE-2023-34194 StringEqual in TiXmlDeclaration::Parse in tinyxmlparser.cpp in TinyXML through 2.6.2 has… Also affects tinyxml
- CVE-2023-40458 Loop with Unreachable Exit Condition ('Infinite Loop') vulnerability in Sierra Wireless… Also affects tinyxml
- CVE-2026-110354 HAProxy 3 before 3.4.6 allows a remote unauthenticated attacker to cause a denial of… CWE-835
- CVE-2026-113794 pypdf is a free and open-source pure-python PDF library. CWE-835
- CVE-2026-113792 pypdf is a free and open-source pure-python PDF library. CWE-835
- CVE-2026-113793 pypdf is a free and open-source pure-python PDF library. CWE-835
- CVE-2026-112406 Pillow is a Python imaging library. CWE-835
- CVE-2026-112391 Pillow is a Python imaging library. CWE-835