---
title: "GHSA-776f-qx25-q3cc: xml2js is vulnerable to prototype pollution"
description: "Moderate severity. xml2js is vulnerable to prototype pollution. Affects xml2js; fixed in 0.5.0."
url: https://inlinr.com/advisories/GHSA-776f-qx25-q3cc
lang: en
---

[Packages](https://inlinr.com/packages) / [xml2js](https://inlinr.com/packages/xml2js) / [Security](https://inlinr.com/packages/xml2js/security)

Moderate Vulnerability GHSA-776f-qx25-q3cc CVE-2023-0842 Published 5 Apr 2023

# xml2js is vulnerable to prototype pollution

Your version 

Affected releases · [xml2js](https://inlinr.com/packages/xml2js)

- 0.4.x and older 0.1.0 – 0.4.23 No fix, no longer updated

0.4.x has no fix yet; the newest fixed line:

```
npm install xml2js@0.5.0
```

Every release on a timeline

1. Affected

0.1.0 – 0.4.23  
48 releases
2. Fixed

0.5.0 – 0.6.2  
4 releases, latest

52 stable releases of xml2js, oldest to newest.

## What happens

xml2js versions before 0.5.0 allows an external attacker to edit or add new properties to an object. This is possible because the application does not properly validate incoming JSON keys, thus allowing the `__proto__` property to be edited.

## How it is exploited

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

- **Confidentiality**: none
- **Integrity**: low
- **Availability**: none

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

## References

- [NVD](https://nvd.nist.gov/vuln/detail/CVE-2023-0842 "https://nvd.nist.gov/vuln/detail/CVE-2023-0842")  
nvd.nist.gov/vuln/detail/CVE-2023-0842
- [Issue](https://github.com/Leonidas-from-XIV/node-xml2js/issues/663 "https://github.com/Leonidas-from-XIV/node-xml2js/issues/663")  
#663
- [Pull request](https://github.com/Leonidas-from-XIV/node-xml2js/pull/603/commits/581b19a62d88f8a3c068b5a45f4542c2d6a495a5 "https://github.com/Leonidas-from-XIV/node-xml2js/pull/603/commits/581b19a62d88f8a3c068b5a45f4542c2d6a495a5")  
#603
- [Reference](https://fluidattacks.com/advisories/myers "https://fluidattacks.com/advisories/myers")  
fluidattacks.com/advisories/myers
- [Package](https://github.com/Leonidas-from-XIV/node-xml2js "https://github.com/Leonidas-from-XIV/node-xml2js")  
github.com/Leonidas-from-XIV/node-xml2js
- [Reference](https://lists.debian.org/debian-lts-announce/2024/03/msg00013.html "https://lists.debian.org/debian-lts-announce/2024/03/msg00013.html")  
lists.debian.org/debian-lts-announce/2024/03/ms…

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.
