CVE-2021-3666:
body-parser-xml vulnerable to Prototype Pollution
7.6
CVSS Score
3.0
Basic Information
CVE ID
GHSA ID
EPSS Score
0.57376%
CWE
Published
9/14/2021
Updated
1/28/2023
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
body-parser-xml | npm | < 2.0.3 | 2.0.3 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stemmed from the XML parser's output being directly assigned to req.body without prototype pollution safeguards. The patch added explicit deletion of proto, constructor, and prototype properties before assignment. The original vulnerable code path was the unconditional 'req.body = xml || req.body' line in index.js, which failed to sanitize prototype chain manipulation vectors. The tests added in test.js confirm the attack vectors targeted these prototype-related properties.