---
title: "GHSA-6w63-h3fj-q4vw: fast-xml-parser vulnerable to Regex Injection via Doctype Entities"
description: "High severity. fast-xml-parser vulnerable to Regex Injection via Doctype Entities. Affects fast-xml-parser; fixed in 4.2.4."
url: https://inlinr.com/advisories/GHSA-6w63-h3fj-q4vw
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)

High Vulnerability GHSA-6w63-h3fj-q4vw CVE-2023-34104 Published 6 Jun 2023

# fast-xml-parser vulnerable to Regex Injection via Doctype Entities

Your version 

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

- 4.x 4.1.3 – 4.2.3 Fixed in 4.2.4

On 4.x, the newest line:

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

Every release on a timeline

5.x 

1. Not affected

5.0.0 – 5.12.1  
60 releases, latest

4.x 

1. Not affected

4.0.0 – 4.1.2  
19 releases
2. Affected

4.1.3 – 4.2.3  
6 releases
3. Fixed

4.2.4 – 4.5.7  
21 releases

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

## What happens

Impact

"fast-xml-parser" allows special characters in entity names, which are not escaped or sanitized. Since the entity name is used for creating a regex for searching and replacing entities in the XML body, an attacker can abuse it for DoS attacks. By crafting an entity name that results in an intentionally bad performing regex and utilizing it in the entity replacement step of the parser, this can cause the parser to stall for an indefinite amount of time.

Patches

The problem has been resolved in v4.2.4

Workarounds

Avoid using DOCTYPE parsing by `processEntities: false` option.

## How it is exploited

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

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

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

## References

- [Reference](https://github.com/NaturalIntelligence/fast-xml-parser/security/advisories/GHSA-6w63-h3fj-q4vw "https://github.com/NaturalIntelligence/fast-xml-parser/security/advisories/GHSA-6w63-h3fj-q4vw")  
github.com/NaturalIntelligence/fast-xml-parser/…
- [NVD](https://nvd.nist.gov/vuln/detail/CVE-2023-34104 "https://nvd.nist.gov/vuln/detail/CVE-2023-34104")  
nvd.nist.gov/vuln/detail/CVE-2023-34104
- [Fix commit](https://github.com/NaturalIntelligence/fast-xml-parser/commit/39b0e050bb909e8499478657f84a3076e39ce76c "https://github.com/NaturalIntelligence/fast-xml-parser/commit/39b0e050bb909e8499478657f84a3076e39ce76c")  
39b0e05
- [Fix commit](https://github.com/NaturalIntelligence/fast-xml-parser/commit/a4bdced80369892ee413bf08e28b78795a2b0d5b "https://github.com/NaturalIntelligence/fast-xml-parser/commit/a4bdced80369892ee413bf08e28b78795a2b0d5b")  
a4bdced
- [Package](https://github.com/NaturalIntelligence/fast-xml-parser "https://github.com/NaturalIntelligence/fast-xml-parser")  
github.com/NaturalIntelligence/fast-xml-parser

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.
