---
title: "GHSA-x3cc-x39p-42qx: fast-xml-parser vulnerable to Prototype Pollution through tag or attribute name"
description: "Moderate severity. fast-xml-parser vulnerable to Prototype Pollution through tag or attribute name. Affects fast-xml-parser; fixed in 4.1.2."
url: https://inlinr.com/advisories/GHSA-x3cc-x39p-42qx
lang: en
---

[Packages](https://inlinr.com/packages) / [fast-xml-parser](https://inlinr.com/packages/fast-xml-parser) / [Security](https://inlinr.com/packages/fast-xml-parser/security)

Moderate Vulnerability GHSA-x3cc-x39p-42qx CVE-2021-26920 CVE-2023-26920 GHSA-793h-6f7r-6qvm Published 13 Jun 2023

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

Your version 

Affected releases · [fast-xml-parser](https://inlinr.com/packages/fast-xml-parser)

- 4.x 4.0.0 – 4.1.1 Fixed in 4.1.2
- 3.x and older 1.0.0 – 3.21.1 No fix, no longer updated

On 4.x, the newest line:

```
npm install fast-xml-parser@4.1.2
```

Every release on a timeline

5.x 

1. Not affected

5.0.0 – 5.12.1  
60 releases, latest

4.x 

1. Affected

4.0.0 – 4.1.1  
18 releases
2. Fixed

4.1.2 – 4.5.7  
28 releases

3.x 

1. Affected

3.0.0 – 3.21.1  
60 releases

2.x 

1. Affected

2.0.0 – 2.9.4  
26 releases

1.x 

1. Affected

1.0.0 – 1.1.1  
3 releases

195 stable releases of fast-xml-parser, oldest to newest, one row per major.

## What happens

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

[gist.github.com/Sudistark/a5a45bd0804d522a1392c…](https://gist.github.com/Sudistark/a5a45bd0804d522a1392cb5023aa7ef7 "https://gist.github.com/Sudistark/a5a45bd0804d522a1392cb5023aa7ef7")

## How it is exploited

Exploitable over the network, with a low-privilege account and no action from a user.

- **Confidentiality**: high
- **Integrity**: none
- **Availability**: none

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

## References

- [Reference](https://github.com/NaturalIntelligence/fast-xml-parser/security/advisories/GHSA-x3cc-x39p-42qx "https://github.com/NaturalIntelligence/fast-xml-parser/security/advisories/GHSA-x3cc-x39p-42qx")  
github.com/NaturalIntelligence/fast-xml-parser/…
- [NVD](https://nvd.nist.gov/vuln/detail/CVE-2023-26920 "https://nvd.nist.gov/vuln/detail/CVE-2023-26920")  
nvd.nist.gov/vuln/detail/CVE-2023-26920
- [Fix commit](https://github.com/NaturalIntelligence/fast-xml-parser/commit/2b032a4f799c63d83991e4f992f1c68e4dd05804 "https://github.com/NaturalIntelligence/fast-xml-parser/commit/2b032a4f799c63d83991e4f992f1c68e4dd05804")  
2b032a4
- [Reference](https://gist.github.com/Sudistark/a5a45bd0804d522a1392cb5023aa7ef7 "https://gist.github.com/Sudistark/a5a45bd0804d522a1392cb5023aa7ef7")  
gist.github.com/Sudistark/a5a45bd0804d522a1392c…
- [Package](https://github.com/NaturalIntelligence/fast-xml-parser "https://github.com/NaturalIntelligence/fast-xml-parser")  
github.com/NaturalIntelligence/fast-xml-parser
- [GitHub advisory](https://github.com/advisories/GHSA-793h-6f7r-6qvm "https://github.com/advisories/GHSA-793h-6f7r-6qvm")  
github.com/advisories/GHSA-793h-6f7r-6qvm

A whole project to check? Paste its package.json in the [dependency check](https://inlinr.com/tools/dependency-check): every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.
