Packages / fast-xml-parser / Security

HighVulnerabilityGHSA-6w63-h3fj-q4vwCVE-2023-34104Published 6 Jun 2023

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

Your version

Affected releases · fast-xml-parser

  • 4.x4.1.3 – 4.2.3Fixed 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.

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.