Critical Vulnerability in node-xml2js: Insecure JSON Key Handling

node-xml2js Updated 02 Oct 2025

Summary

05/04/2023
N/A
Yes i
Unrated
Not published

DEBIAN-CVE-2023-0842: xml2js version 0.4.23 allows an external attacker to edit or add new properties to an object. Affects node-xml2js versions < 0.2.8-1.1+deb11u1. Fixed in 0.2.8-1.1+deb11u1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

node-xml2js is a popular JavaScript library used for converting XML to JavaScript objects and vice versa. It is widely utilized in applications that require XML parsing and manipulation. The library's ease of use and flexibility make it a go-to choice for developers. However, a recent vulnerability has been identified that compromises its security, allowing unauthorized modifications to object properties.

Vulnerability Detail

The vulnerability in node-xml2js, identified as CVE-2023-0842, arises from improper validation of incoming JSON keys. This flaw allows an external attacker to edit or add new properties to an object by manipulating the proto property. The implications of this vulnerability are significant, as it can lead to unauthorized access and manipulation of application data, potentially compromising the integrity and security of the application.

How To Fix

Minimum fixed version

0.2.8-1.1+deb11u1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade node-xml2js

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, developers can implement additional validation checks on incoming JSON keys to prevent unauthorized modifications. This can be done by sanitizing input data before processing it with node-xml2js.

Conclusion

The vulnerability CVE-2023-0842 in the node-xml2js package poses significant security risks due to improper JSON key validation. It is crucial for developers to update their packages to the patched versions and consider implementing additional validation checks as a temporary measure. Monitoring tools like Vulert can assist in identifying vulnerabilities in real-time.

See every vulnerability recorded for node-xml2js →

Share this vulnerability

FAQ

CVE-2023-0842 is a vulnerability in the node-xml2js library that allows attackers to manipulate object properties due to improper validation of JSON keys.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without any signup.

The risks include unauthorized access to application data and the ability for attackers to manipulate object properties, which can compromise application integrity.

Yes, patches are available for various Debian versions. Ensure to update to the specified patched versions to mitigate the vulnerability.

If immediate updates are not possible, implement input validation checks as a temporary workaround to mitigate the risk until a proper update can be applied.

Related vulnerabilities

Recent vulnerabilities recorded for node-xml2js.

How To Fix

Minimum fixed version

0.2.8-1.1+deb11u1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade node-xml2js

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback