Skip to content
Heist/ feed
Back to feed
High

Regex Injection via Doctype Entities

Type: advisorySources: OSV

fast-xml-parser is an open source, pure javascript xml parser. 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 denial of service (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. This problem has been resolved in v4.2.4. Users are advised to upgrade. Users unable to upgrade should avoid using DOCTYPE parsing by setting the `processEntities: false` option.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2023-34104
Confirmed fixed CVEs
Not specified
Updated in this feed
4 Nov 2026, 20:15 UTC · Revision 1

Source evidence

Regex Injection via Doctype Entities

core-osv · Original source

Published 6 Jun 2023, 17:35 UTC

fast-xml-parser is an open source, pure javascript xml parser. 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 denial of service (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. This problem has been resolved in v4.2.4. Users are advised to upgrade. Users unable to upgrade should avoid using DOCTYPE parsing by setting the `processEntities: false` option.

osv:CVE-2023-34104
Complete source record
{
  "id": "4d3642d69648bd5248f33c16d242823725c44c3e0515a8dcc791b1f3672999ad",
  "url": "https://osv.dev/vulnerability/CVE-2023-34104",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Regex Injection via Doctype Entities",
    "summary": "fast-xml-parser is an open source, pure javascript xml parser. 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 denial of service (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. This problem has been resolved in v4.2.4. Users are advised to upgrade. Users unable to upgrade should avoid using DOCTYPE parsing by setting the `processEntities: false` option.",
    "evidence": "osv:CVE-2023-34104",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2023-34104",
      "aliases": [
        "CVE-2023-34104",
        "GHSA-6w63-h3fj-q4vw"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/naturalintelligence/fast-xml-parser",
              "type": "GIT",
              "events": [
                {
                  "introduced": "292fb784334043214e29fa60adbb5630a36f5768"
                },
                {
                  "fixed": "ecf6016f9b48aec1a921e673158be0773d07283e"
                },
                {
                  "fixed": "39b0e050bb909e8499478657f84a3076e39ce76c"
                },
                {
                  "fixed": "a4bdced80369892ee413bf08e28b78795a2b0d5b"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "introduced": "4.1.3"
                      },
                      {
                        "fixed": "4.2.4"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StringRangeExpression"
                  },
                  {
                    "range": [
                      {
                        "fixed": "39b0e050bb909e8499478657f84a3076e39ce76c"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  },
                  {
                    "range": [
                      {
                        "fixed": "a4bdced80369892ee413bf08e28b78795a2b0d5b"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v4.2.0",
            "v4.1.4",
            "v4.1.3"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-34104.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:39.186886198Z",
      "provider": "osv",
      "references": [
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/34xxx/CVE-2023-34104.json",
        "https://github.com/NaturalIntelligence/fast-xml-parser/security/advisories/GHSA-6w63-h3fj-q4vw",
        "https://nvd.nist.gov/vuln/detail/CVE-2023-34104",
        "https://github.com/NaturalIntelligence/fast-xml-parser/commit/39b0e050bb909e8499478657f84a3076e39ce76c",
        "https://github.com/NaturalIntelligence/fast-xml-parser/commit/a4bdced80369892ee413bf08e28b78795a2b0d5b"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-1333",
          "CWE-400"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/34xxx/CVE-2023-34104.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2023-34104",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 506574,
  "published_at": "2023-06-06T17:35:54.699+00:00"
}