Miggo Logo

CVE-2021-3666:
body-parser-xml vulnerable to Prototype Pollution

7.6

CVSS Score
3.0

Basic Information

EPSS Score
0.57376%
Published
9/14/2021
Updated
1/28/2023
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
body-parser-xmlnpm< 2.0.32.0.3

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot 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.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

*o*y-p*rs*r-xml is vuln*r**l* to Improp*rly *ontroll** Mo*i*i**tion o* O*j**t Prototyp* *ttri*ut*s ('Prototyp* Pollution').

Reasoning

T** vuln*r**ility st*mm** *rom t** XML p*rs*r's output **in* *ir**tly *ssi*n** to r*q.*o*y wit*out prototyp* pollution s****u*r*s. T** p*t** ***** *xpli*it **l*tion o* __proto__, *onstru*tor, *n* prototyp* prop*rti*s ***or* *ssi*nm*nt. T** ori*in*l v