SiteShadow
Back to vulnerability library
Detected byCWE-aware static analysis

CWE-112 Missing XML Validation

Coverage: 4 rules in the SiteShadow rule registry target this CWE (registry v2.0.0). Regex 2Other-pattern 2 Also: Taint and heuristic analyzers may also detect related flows (see coverage for the authoritative list) Registry tagging shows intent, for sample-level behaviour and benchmarked gaps see known gaps.

What this means

SiteShadow flagged XML parsing without validation/constraints. XML inputs can be malformed, oversized, or crafted to trigger dangerous parser features if not handled carefully.

Why it matters

Unvalidated XML can allow XXE or malformed inputs.

Safer examples

1) Use safe XML parsing defaults

Disable DTD/external entity resolution and enforce size limits (see CWE-611).

2) Validate against an XML schema when applicable (XSD)

from lxml import etree

xml_doc = etree.fromstring(xml_bytes)
schema = etree.XMLSchema(etree.parse("schema.xsd"))
schema.assertValid(xml_doc)

3) Prefer simpler formats when possible

If you control both sides, JSON + schema validation can reduce XML-specific risk.

How SiteShadow detects it (high level)

References

---

← Back to Vulnerability Library

Catch this in your code with SiteShadow.

Every released SiteShadow scanner is free, including full project analysis, reports, patterns, dashboard access, and configured organization SSO.