CVE-2023-0842: xml2js is vulnerable to prototype pollution
5.3
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.4845%
CWE
Published
4/5/2023
Updated
3/14/2024
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| xml2js | npm | < 0.5.0 | 0.5.0 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from using {} (which inherits from Object.prototype) instead of Object.create(null) when creating parsed objects. The commit 581b19a explicitly addresses this by replacing all {} initializations with Object.create(null) in the parser's element/attribute/child object creation paths. These functions handled raw XML input without prototype validation, making them entry points for __proto__ injection in vulnerable versions (<0.5.0).