CVE-2021-42260

7.5 HIGH

📋 TL;DR

CVE-2021-42260 is an infinite loop vulnerability in TinyXML's parsing function that can be triggered by a specially crafted XML message. This leads to denial of service by consuming excessive CPU resources. Any application using vulnerable versions of TinyXML to parse untrusted XML input is affected.

💻 Affected Systems

Products:
  • TinyXML library
  • Applications embedding TinyXML
Versions: TinyXML through version 2.6.2
Operating Systems: All operating systems using TinyXML
Default Config Vulnerable: ⚠️ Yes
Notes: Any application using TinyXML to parse XML is vulnerable if it processes untrusted input. The vulnerability is in the library itself, not dependent on specific configurations.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete denial of service for applications using TinyXML, potentially causing system instability or crashes due to infinite CPU consumption.

🟠

Likely Case

Application hangs or becomes unresponsive when processing malicious XML input, requiring restart to recover functionality.

🟢

If Mitigated

With input validation and proper XML sanitization, the risk is reduced but not eliminated without patching.

🌐 Internet-Facing: HIGH - Applications accepting XML input from untrusted sources (APIs, web forms, file uploads) are directly exploitable.
🏢 Internal Only: MEDIUM - Internal applications processing XML from controlled sources have lower risk but could still be exploited via compromised internal systems.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

The exploit requires sending a crafted XML message to trigger the infinite loop. Proof of concept is available in the bug report.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: TinyXML version after 2.6.2

Vendor Advisory: https://sourceforge.net/p/tinyxml/bugs/141/

Restart Required: Yes

Instructions:

1. Update TinyXML to version after 2.6.2. 2. Recompile applications using the library. 3. Restart affected services. 4. For packaged distributions, use system package manager updates.

🔧 Temporary Workarounds

XML Input Validation

all

Implement strict validation and sanitization of XML input before processing with TinyXML

Process Isolation

linux

Run XML parsing in isolated processes with resource limits to prevent system-wide impact

# Example for Linux using systemd
[Service]
CPUQuota=50%
# Example using ulimit
ulimit -t 30

🧯 If You Can't Patch

  • Implement network-level filtering to block or inspect XML traffic to vulnerable applications
  • Deploy application-level WAF rules to detect and block malicious XML patterns

🔍 How to Verify

Check if Vulnerable:

Check TinyXML version in use. If version <= 2.6.2 and application processes XML, it is vulnerable.

Check Version:

# For Linux packages: dpkg -l | grep tinyxml OR rpm -qa | grep tinyxml
# For source builds: check version in tinyxml.h or compile output

Verify Fix Applied:

Verify TinyXML version is > 2.6.2 and test with known malicious XML payloads to ensure no infinite loop occurs.

📡 Detection & Monitoring

Log Indicators:

  • Application logs showing hangs or timeouts during XML processing
  • High CPU usage spikes correlated with XML input processing

Network Indicators:

  • Unusually large or malformed XML payloads sent to applications
  • Repeated XML submissions to trigger DoS

SIEM Query:

source="application.log" AND ("XML parse timeout" OR "high cpu" OR "infinite loop")

🔗 References

📤 Share & Export