CVE-2026-142213: xml2js through 0.6.2 XML Injection via Builder CDATA Escaping

Published Dec 2, 2026
·
Updated

xml2js through 0.6.2 contains an XML injection vulnerability that allows attackers to break out of CDATA sections because escapeCDATA() in lib/builder.js only escapes the first ]]> sequence. Attackers controlling string values serialized with the cdata option can include a second ]]> to inject arbitrary elements and attributes, altering downstream XML parsing.

Affected Software

1 affected component
npm/xml2js<=0.6.2

Event History

Dec 2, 2026
CVE Published
via MITRE·04:50 PM
Data Sourced
via MITRE·04:50 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·05:17 PM
DescriptionSeverityWeakness
Event
via NVD·05:17 PM

Frequently Asked Questions

1

Which applications are exposed to this issue?

Applications using npm/xml2js through 0.6.2 are exposed when they serialize attacker-controlled string values with the builder's cdata option enabled. The impact occurs when the resulting XML is subsequently parsed or consumed by a downstream component.

2

What does an attacker need to exploit it?

An attacker must be able to control a string value that the application serializes into a CDATA section. The supplied value must contain a second ]]> sequence, allowing the attacker to close the CDATA section and inject XML elements or attributes.

3

Is a default xml2js configuration affected?

The described vulnerable path specifically requires use of the cdata option during serialization. The provided information does not establish that applications not using this option are affected.

4

How can I determine whether my application is affected?

Check whether your dependency uses xml2js version 0.6.2 or earlier and whether calls to its XML builder enable the cdata option for values influenced by external input. Review downstream XML consumers to determine whether injected elements or attributes could alter processing.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203