CVE-2023-34104: Fast xml parser Fast-xml-parser Vulnerable To Regex Injection Vulnerability
HIGHCVE-2023-34104 is a HIGH (CVSS 7.5) fast-xml-parser vulnerable to regex injection vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Fast xml parser libraries in the npm ecosystem. The issue involves fast-xml-parser vulnerable to regex injection via doctype entities. Remediation is available by upgrading affected packages to version 4.2.4.
CVE-2023-34104 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).
How to Fix CVE-2023-34104
To remediate this vulnerability, upgrade all affected Fast xml parser dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install fast-xml-parser@4.2.4
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls fast-xml-parser
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2023-34104, inspect your project dependencies using npm:
npm ls fast-xml-parser
Analyze the terminal output to locate any version of Fast xml parser in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.2.4), your application is affected.
Note: The npm ls fast-xml-parser command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Fast xml parser, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2023-34104 Affected Fast xml parser Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
fast-xml-parser
|
npm |
≥ 4.1.3
< 4.2.4
|
4.2.4
|
References
Frequently Asked Questions
What is CVE-2023-34104?
Which Fast xml parser versions are affected?
What version fixes CVE-2023-34104?
Is fast-xml-parser affected?
What is the CVSS score of CVE-2023-34104?
What CWE is associated with CVE-2023-34104?
How can I check npm dependencies for CVE-2023-34104?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-6w63-h3fj-q4vw",
"modified" : "2026-03-09T15:58:38Z",
"published" : "2023-06-06T17:33:13Z",
"aliases" : [ "CVE-2023-34104" ],
"summary" : "fast-xml-parser vulnerable to Regex Injection via Doctype Entities",
"details" : "### Impact\n\"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.\n\n### Patches\nThe problem has been resolved in v4.2.4\n\n### Workarounds\nAvoid using DOCTYPE parsing by `processEntities: false` option.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "fast-xml-parser"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "4.1.3"
}, {
"fixed" : "4.2.4"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/NaturalIntelligence/fast-xml-parser/security/advisories/GHSA-6w63-h3fj-q4vw"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-34104"
}, {
"type" : "WEB",
"url" : "https://github.com/NaturalIntelligence/fast-xml-parser/commit/39b0e050bb909e8499478657f84a3076e39ce76c"
}, {
"type" : "WEB",
"url" : "https://github.com/NaturalIntelligence/fast-xml-parser/commit/a4bdced80369892ee413bf08e28b78795a2b0d5b"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/NaturalIntelligence/fast-xml-parser"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1333", "CWE-400" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2023-06-06T17:33:13Z",
"nvd_published_at" : "2023-06-06T18:15:11Z"
}
}