Vulnerability library
Security checkSeptember 02, 2026

xmldom: XML fragment injection via invalid EntityReference.nodeName during requireWellFormed serialization

Understand the exposure, see the recommended fix, and check whether your own website has related weaknesses.

Medium severitynpm@xmldom/xmldom

Check your website

Find this and other vulnerabilities with a free scan.

Your scan runs on your computer. No account required.

Description

An EntityReference node can be created with an invalid, attacker-controlled name through Document.createEntityReference(name). When this node is serialized directly with:

the invalid nodeName is emitted into the serialized XML fragment without validation or escaping.

This can produce real XML markup in the serialized output.

Recommendation

Update the @xmldom/xmldom package to the latest compatible version. Followings are version details:

  • Affected version(s): **>= 0.9.0, <= 0.9.11 >= 0.7.0, <= 0.8.14**
  • Patched version(s): **0.9.12 0.8.15**

References

Could your website be exposed too?

SmartScanner can check your website for xmldom: XML fragment injection via invalid EntityReference.nodeName during requireWellFormed serialization and gives you actionable findings to investigate.

Start a free scan

Related Issues

See something that needs correcting? Let us knowUpdated September 02, 2026