SiteShadow
Back to vulnerability library

CWE-112 Missing XML Validation

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

Request access View coverage