Critical Object Manipulation Vulnerability in xml2js Package

node-xml2js Updated 02 Oct 2025

Summary

05/04/2023
N/A
Yes i
Medium
5.3

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

The xml2js package is a widely used Node.js library that facilitates the conversion of XML data into JavaScript objects. It is known for its ease of use and flexibility, allowing developers to handle XML data efficiently in their applications. However, the package has a significant vulnerability that arises from improper validation of incoming JSON keys, specifically allowing external attackers to manipulate object properties.

Vulnerability Detail

The vulnerability, identified as CVE-2023-0842, allows an external attacker to edit or add new properties to an object due to the lack of proper validation for incoming JSON keys. This flaw enables the modification of the proto property, which can lead to prototype pollution. The ramifications of this vulnerability are serious, as it can potentially allow attackers to execute arbitrary code, escalate privileges, or disrupt application functionality. The vulnerability affects multiple versions of the xml2js package across different Debian ecosystems.

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

If an immediate upgrade is not feasible, consider implementing input validation to sanitize incoming JSON keys and prevent manipulation of the proto property. This can be done by checking the keys against a whitelist or using libraries that provide secure object manipulation methods.

Conclusion

The xml2js package has a critical vulnerability (CVE-2023-0842) that allows external manipulation of object properties due to improper validation of JSON keys. It is crucial to update the package to a secure version to mitigate the risks associated with this vulnerability. Additionally, implementing input validation can serve as a temporary workaround.

See every vulnerability recorded for node-xml2js →

Share this vulnerability

FAQ

CVE-2023-0842 is a vulnerability in the xml2js package that allows external 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 requiring any signup.

The risks include arbitrary code execution, privilege escalation, and disruption of application functionality due to prototype pollution.

The CVSS score for CVE-2023-0842 is 5.3, indicating a moderate severity level.

If you find your application is vulnerable, report it to your development team immediately and follow the steps outlined in the 'how to fix' section to mitigate the risk.

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