CWE-407
Weakness Allowed-with-ReviewInefficient 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
Modes of introduction
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
updated Time_of_Introduction
updated Common_Consequences, Relationships, Other_Notes, Taxonomy_Mappings
updated Functional_Areas, Other_Notes
updated Common_Consequences
updated Applicable_Platforms, Likelihood_of_Exploit
updated Common_Consequences
updated Observed_Examples, Relationships
updated Relationships
updated Relationships
updated Likelihood_of_Exploit
updated Name, Relationships, Type
updated Relationships
updated Relationships
updated References, Relationships
updated References
updated Alternate_Terms, Observed_Examples, Relationships
updated Demonstrative_Examples, Observed_Examples, References
updated Relationships
updated Mapping_Notes
updated Weakness_Ordinalities
updated Detection_Factors, References
704 vulnerabilities reference this CWE, most recent first.
GHSA-Q2MW-FVJ9-VVCW
Vulnerability from github – Published: 2026-05-04 22:02 – Updated: 2026-05-14 20:48Summary
Net::IMAP::ResponseReader has quadratic time complexity when reading large responses containing many string literals. A hostile server can send responses which are crafted to exhaust the client's CPU for a denial of service attack.
Details
For each literal in a response, ResponseReader rescans the entire growing response buffer. The regular expression that is used to scan the response buffer runs in linear time. With many literals, this becomes O(n²) total work. The regular expression should run in constant time: it is anchored to the end and only the last 23 bytes of the buffer are relevant.
Because the algorithmic complexity is super-linear, this bypasses protection from max_response_size: a response can stay well below the default size limit while still causing very large CPU cost.
Net::IMAP::ResponseReader runs continuously in the receiver thread until the connection closes.
Impact
This consumes disproportionate CPU time in the client's receiver thread. A hostile server could use this to exhaust the client's CPU for a denial of service attack.
For a response near the default max_response_size, each individual regexp scan could take between 100 to 200ms on common modern hardware, and this may be repeated 200k times per megabyte of response. While the regexp is scanning, it retains the Global VM lock, preventing other threads from running.
Although other threads should not be completely blocked, their run time will be significantly impacted.
Mitigation
- Upgrade to a patched version of net-imap that reads responses more efficiently.
- Do not connect to untrusted IMAP servers.
- When connecting to untrusted servers, a much smaller
max_response_size(for example: 8KiB) will limit the impact. Although this is too small for fetching unpaginated message bodies, it should be enough for most other operations.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 0.6.3"
},
"package": {
"ecosystem": "RubyGems",
"name": "net-imap"
},
"ranges": [
{
"events": [
{
"introduced": "0.6.0"
},
{
"fixed": "0.6.4"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 0.5.13"
},
"package": {
"ecosystem": "RubyGems",
"name": "net-imap"
},
"ranges": [
{
"events": [
{
"introduced": "0.5.0"
},
{
"fixed": "0.5.14"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 0.4.23"
},
"package": {
"ecosystem": "RubyGems",
"name": "net-imap"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.4.24"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-42245"
],
"database_specific": {
"cwe_ids": [
"CWE-407"
],
"github_reviewed": true,
"github_reviewed_at": "2026-05-04T22:02:56Z",
"nvd_published_at": "2026-05-09T20:16:28Z",
"severity": "LOW"
},
"details": "### Summary\n\n`Net::IMAP::ResponseReader` has quadratic time complexity when reading large responses containing many string literals. A hostile server can send responses which are crafted to exhaust the client\u0027s CPU for a denial of service attack.\n\n### Details\n\nFor each literal in a response, `ResponseReader` rescans the entire growing response buffer. The regular expression that is used to scan the response buffer runs in linear time. With many literals, this becomes O(n\u00b2) total work. The regular expression should run in constant time: it is anchored to the end and only the last 23 bytes of the buffer are relevant.\n\nBecause the algorithmic complexity is super-linear, this bypasses protection from `max_response_size`: a response can stay well below the default size limit while still causing very large CPU cost.\n\n`Net::IMAP::ResponseReader` runs continuously in the receiver thread until the connection closes.\n\n### Impact\n\nThis consumes disproportionate CPU time in the client\u0027s receiver thread. A hostile server could use this to exhaust the client\u0027s CPU for a denial of service attack.\n\nFor a response near the default `max_response_size`, each individual regexp scan could take between 100 to 200ms on common modern hardware, and this may be repeated 200k times per megabyte of response. While the regexp is scanning, it retains the Global VM lock, preventing other threads from running.\n\nAlthough other threads should not be _completely_ blocked, their run time will be significantly impacted.\n\n### Mitigation\n\n* Upgrade to a patched version of net-imap that reads responses more efficiently.\n* Do not connect to untrusted IMAP servers.\n* When connecting to untrusted servers, a _much_ smaller `max_response_size` (for example: 8KiB) will limit the impact. Although this is too small for fetching unpaginated message bodies, it should be enough for most other operations.",
"id": "GHSA-q2mw-fvj9-vvcw",
"modified": "2026-05-14T20:48:14Z",
"published": "2026-05-04T22:02:56Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/ruby/net-imap/security/advisories/GHSA-q2mw-fvj9-vvcw"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-42245"
},
{
"type": "WEB",
"url": "https://github.com/ruby/net-imap/commit/6091f7d6b1f3514cafbfe39c76f2b5d73de3ca96"
},
{
"type": "WEB",
"url": "https://github.com/ruby/net-imap/commit/88d95231fc8afef11c1f074453f7d75b68c9dfda"
},
{
"type": "WEB",
"url": "https://github.com/ruby/net-imap/commit/de685f91a4a4cc75eb80da898c2bf8af08d34819"
},
{
"type": "PACKAGE",
"url": "https://github.com/ruby/net-imap"
},
{
"type": "WEB",
"url": "https://github.com/ruby/net-imap/releases/tag/v0.4.24"
},
{
"type": "WEB",
"url": "https://github.com/ruby/net-imap/releases/tag/v0.5.14"
},
{
"type": "WEB",
"url": "https://github.com/ruby/net-imap/releases/tag/v0.6.4"
},
{
"type": "WEB",
"url": "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/net-imap/CVE-2026-42245.yml"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N",
"type": "CVSS_V4"
}
],
"summary": "net-imap has quadratic complexity when reading response literals"
}
GHSA-Q2QQ-HMJ6-3WPP
Vulnerability from github – Published: 2026-05-07 02:59 – Updated: 2026-05-07 02:59During message encoding, hickory-proto's BinEncoder stores pointers to labels that are candidates for name compression in a Vec<(usize, Vec<u8>)>. The name compression logic then searches for matches with a linear scan.
A malicious message with many records can both introduce many candidate labels, and invoke this linear scan many times. This can amplify CPU exhaustion in DoS attacks.
This is similar to CVE-2024-8508.
Reporter
Qifan Zhang, Palo Alto Networks
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 0.26.0"
},
"package": {
"ecosystem": "crates.io",
"name": "hickory-proto"
},
"ranges": [
{
"events": [
{
"introduced": "0.3.1"
},
{
"fixed": "0.26.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-407",
"CWE-770"
],
"github_reviewed": true,
"github_reviewed_at": "2026-05-07T02:59:48Z",
"nvd_published_at": null,
"severity": "MODERATE"
},
"details": "During message encoding, `hickory-proto`\u0027s `BinEncoder` stores pointers to labels that are candidates for name compression in a `Vec\u003c(usize, Vec\u003cu8\u003e)\u003e`. The name compression logic then searches for matches with a linear scan.\n\nA malicious message with many records can both introduce many candidate labels, and invoke this linear scan many times. This can amplify CPU exhaustion in DoS attacks.\n\nThis is similar to [CVE-2024-8508](https://www.nlnetlabs.nl/downloads/unbound/CVE-2024-8508.txt).\n\n### Reporter\n\nQifan Zhang, Palo Alto Networks",
"id": "GHSA-q2qq-hmj6-3wpp",
"modified": "2026-05-07T02:59:48Z",
"published": "2026-05-07T02:59:48Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/hickory-dns/hickory-dns/security/advisories/GHSA-q2qq-hmj6-3wpp"
},
{
"type": "PACKAGE",
"url": "https://github.com/hickory-dns/hickory-dns"
},
{
"type": "WEB",
"url": "https://rustsec.org/advisories/RUSTSEC-2026-0119.html"
}
],
"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:L/SC:N/SI:N/SA:N",
"type": "CVSS_V4"
}
],
"summary": "hickory-proto vulnerable to CPU exhaustion during message encoding due to O(n\u00b2) name compression"
}
GHSA-Q489-H3J7-J39M
Vulnerability from github – Published: 2026-12-02 18:31 – Updated: 2026-12-02 18:31PyYAML through 6.0.4 contains a denial of service vulnerability in SafeConstructor.construct_yaml_int() that allows remote attackers to exhaust CPU by supplying unbounded base-60 integer scalars. Attackers can submit a YAML document with a scalar containing many colon-separated groups to safe_load, SafeLoader, CSafeLoader or FullLoader, causing quadratic-time construction that blocks the parsing thread.
{
"affected": [],
"aliases": [
"CVE-2026-142207"
],
"database_specific": {
"cwe_ids": [
"CWE-407"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-12-02T17:17:42Z",
"severity": "MODERATE"
},
"details": "PyYAML through 6.0.4 contains a denial of service vulnerability in SafeConstructor.construct_yaml_int() that allows remote attackers to exhaust CPU by supplying unbounded base-60 integer scalars. Attackers can submit a YAML document with a scalar containing many colon-separated groups to safe_load, SafeLoader, CSafeLoader or FullLoader, causing quadratic-time construction that blocks the parsing thread.",
"id": "GHSA-q489-h3j7-j39m",
"modified": "2026-12-02T18:31:45Z",
"published": "2026-12-02T18:31:45Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-142207"
},
{
"type": "WEB",
"url": "https://github.com/yaml/pyyaml/blob/6.0.4/lib/yaml/constructor.py#L240-L267"
},
{
"type": "WEB",
"url": "https://github.com/yaml/pyyaml/blob/6.0.4/lib/yaml/resolver.py#L185-L192"
},
{
"type": "WEB",
"url": "https://www.vulncheck.com/advisories/pyyaml-through-6.0.4-cpu-denial-of-service-via-sexagesimal-integer-construction"
}
],
"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"
},
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/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-Q48F-W9RV-CM2X
Vulnerability from github – Published: 2026-11-10 21:32 – Updated: 2026-11-10 21:32Uncontrolled resource consumption in Windows Security Account Manager allows an unauthorized attacker to deny service over a network.
{
"affected": [],
"aliases": [
"CVE-2026-112966"
],
"database_specific": {
"cwe_ids": [
"CWE-407"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-11-10T19:18:46Z",
"severity": "HIGH"
},
"details": "Uncontrolled resource consumption in Windows Security Account Manager allows an unauthorized attacker to deny service over a network.",
"id": "GHSA-q48f-w9rv-cm2x",
"modified": "2026-11-10T21:32:43Z",
"published": "2026-11-10T21:32:43Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-112966"
},
{
"type": "WEB",
"url": "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2026-112966"
}
],
"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"
}
]
}
GHSA-Q4C2-WH8V-28Q5
Vulnerability from github – Published: 2023-05-02 15:30 – Updated: 2023-05-02 15:30A vulnerability was found in Dreamer CMS up to 4.1.3. It has been declared as problematic. This vulnerability affects the function updatePwd of the file UserController.java of the component Password Hash Calculation. The manipulation leads to inefficient algorithmic complexity. The attack can be initiated remotely. It is recommended to upgrade the affected component. The identifier of this vulnerability is VDB-227860.
{
"affected": [],
"aliases": [
"CVE-2023-2473"
],
"database_specific": {
"cwe_ids": [
"CWE-407"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-05-02T13:15:25Z",
"severity": "MODERATE"
},
"details": "A vulnerability was found in Dreamer CMS up to 4.1.3. It has been declared as problematic. This vulnerability affects the function updatePwd of the file UserController.java of the component Password Hash Calculation. The manipulation leads to inefficient algorithmic complexity. The attack can be initiated remotely. It is recommended to upgrade the affected component. The identifier of this vulnerability is VDB-227860.",
"id": "GHSA-q4c2-wh8v-28q5",
"modified": "2023-05-02T15:30:33Z",
"published": "2023-05-02T15:30:33Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-2473"
},
{
"type": "WEB",
"url": "https://gitee.com/isoftforce/dreamer_cms/issues/I6WHO7"
},
{
"type": "WEB",
"url": "https://vuldb.com/?ctiid.227860"
},
{
"type": "WEB",
"url": "https://vuldb.com/?id.227860"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L",
"type": "CVSS_V3"
}
]
}
GHSA-Q4C8-9GWF-255X
Vulnerability from github – Published: 2026-11-19 23:48 – Updated: 2026-11-19 23:48Summary
SeekableUnicodeStreamReader.readline in nltk/data.py assembles a line by repeatedly reading a block, appending it to a growing chars buffer, and recomputing chars.splitlines(True) over the entire buffer on every loop iteration. The read block size doubles only until it caps at 8000 characters, so for a single unterminated line of N characters the loop runs about N/8000 iterations and iteration k re-scans roughly 8000*k characters, giving O(N^2) total work. The default size=None used on the line-oriented corpus-reader read path means the early break never fires before end of file. An attacker who supplies a corpus file containing one very long line with no newline can force quadratic CPU consumption in the reader's process. This is the same growing-buffer re-scan algorithmic-complexity class the project already treats as advisory-worthy in sibling corpus readers.
Root Cause
The readline loop violates the expectation that reading a line costs time linear in the line length. On each pass it executes chars += new_chars; lines = chars.splitlines(True), scanning the whole accumulated buffer again rather than only the newly read block. Because readsize is capped at 8000 (nltk/data.py:1997-1998), the number of iterations grows linearly with the line length while each iteration's scan cost also grows linearly, producing quadratic total cost. The loop exits only on end of file or when size is not None; since the line-oriented block readers call stream.readline() with no argument, size defaults to None (nltk/data.py:1942) and that early break is unreachable on this path. There is no length cap on the assembled line and no wall-clock backstop, because no regular expression is involved on this path and the nltk.redos timeout therefore does not apply.
Affected function: nltk.data.SeekableUnicodeStreamReader.readline
Loop with per-iteration full-buffer rescan: nltk/data.py:1968-2000
chars += new_chars; lines = chars.splitlines(True) (nltk/data.py:1977-1978)
readsize *= 2 capped at 8000 (nltk/data.py:1997-1998)
Default size=None on the corpus-view path: nltk/data.py:1942
Reachable via read_line_block/read_whitespace_block/read_wordpunct_block/
read_blankline_block in nltk/corpus/reader/util.py, through _open's
SeekableUnicodeStreamReader construction.
Impact
An attacker who controls the bytes of a corpus file processed by a line-oriented NLTK corpus reader (encoding set, which is the common case) can craft one arbitrarily long unterminated line. Reading that line pins a single CPU core for time quadratic in the line length. The effect is recoverable CPU-availability degradation in the processing worker, not a crash: memory use remains linear and the operation completes once the buffer is exhausted. Because the constant factor is bounded by the 8000-character read cap, a meaningful denial of service requires a large crafted file, which keeps the severity in the low to medium range. The worst credible deployment is an automated document-ingestion service that feeds attacker-supplied uploads into such a reader with no human step; a more typical case where a victim manually loads an attacker-supplied corpus requires user interaction and is lower.
Proof of Concept
Requires only the nltk package under test on PYTHONPATH; no network access. Feeds one unterminated line of increasing length through SeekableUnicodeStreamReader.readline (size=None, the corpus-view path) and times each call.
import io, time
from nltk.data import SeekableUnicodeStreamReader
def measure(n):
stream = io.BytesIO(b"a" * n) # one unterminated line, no newline
reader = SeekableUnicodeStreamReader(stream, "utf-8")
t0 = time.perf_counter()
line = reader.readline() # size=None -> corpus-view path
dt = time.perf_counter() - t0
assert len(line) == n
return dt
prev = None
for n in (1_000_000, 2_000_000, 4_000_000, 8_000_000):
dt = measure(n)
ratio = "-" if prev is None else f"{dt/prev:.2f}x"
print(f"{n:>12,} chars {dt:8.3f}s ratio(x2 size)={ratio}")
prev = dt
1,000,000 chars 0.058s ratio(x2 size)=-
2,000,000 chars 0.290s ratio(x2 size)=4.99x
4,000,000 chars 1.154s ratio(x2 size)=3.98x
8,000,000 chars 4.694s ratio(x2 size)=4.07x
The roughly 4x time increase for each 2x increase in size is the O(N^2) signature; a linear readline would grow about 2x per 2x size step.
Attack Chain
- Exposure: The victim application processes a corpus file whose bytes are attacker-supplied through a line-oriented corpus reader. Corpus file content is untrusted input in NLTK.
- Control: The attacker controls the file bytes and can emit one arbitrarily long run of characters with no newline. This survives path/open security controls (
_secure_open/pathsec), which bound file access but not read-loop cost. - Path:
StreamBackedCorpusView._open(nltk/corpus/reader/util.py:210-214) constructs aSeekableUnicodeStreamReaderwhen an encoding is set; the block readersread_line_block,read_whitespace_block,read_wordpunct_block, andread_blankline_blockcallstream.readline()with no size argument. - Guard: The only candidate guard, the
if not new_chars or size is not None:early break atnltk/data.py:1992, does not fire becausesizedefaults toNone; the loop runs until end of file. No line-length cap and no wall-clock backstop exist. - Primitive: Per-iteration
chars.splitlines(True)over the whole growing buffer with a capped 8000-character read block, giving quadratic total work. - Result: One CPU core is consumed for O(N^2) time on a single
readlinecall, degrading availability of the reader's process. Recoverable, no crash.
Bypass Evidence
The size is not None early break is the only guard that could stop the quadratic loop, and it is disproven: readline is defined as readline(self, size=None) and the four shipped block readers invoke it with no argument, so size is None and the break only triggers at end of file. The nltk.redos timeout that protects regex-based paths does not apply here because there is no regular expression on the readline loop. The linebuffer short-circuit at nltk/data.py:1955 is not taken for a single unterminated line, since the buffer never accumulates more than one element. Attempts to disprove the finding all failed: the size early break is unreachable on this path, the redos timeout is inapplicable, the linebuffer short-circuit does not engage, the block-size doubling does not make the loop log-linear because it caps at 8000, and the path is reachable from four standard block readers rather than being test-only. The sustained adversarial observation is only that impact is bounded (recoverable CPU degradation needing a large file), which lowers severity but does not overturn the finding. No prior fix exists for this sink; the two published sibling advisories in the same quadratic corpus-reader class target different functions.
Affected Versions
Ecosystem: PyPIPackage: nltkConfirmed affected range: <= 3.10.3Latest release checked: 3.10.3 (pypi.org/pypi/nltk/json, verified 2026-09-15)Fix status: not fixed
SeekableUnicodeStreamReader.readline and its per-iteration splitlines re-scan are long-standing nltk/data.py code present in the current published artifact (3.10.3), and no fix has been released. The upper bound <= 3.10.3 is verified against the exact PyPI-published version. The lower bound is left open because the first affected release was not binary-searched; the vulnerable code predates recent releases.
Suggested Fix
Avoid rescanning the whole buffer on every iteration. Search only the newly read block for a line terminator (tracking a running offset), or read through the underlying stream's own buffered line reading, so the cost of assembling a line is linear in the line length. Optionally impose a configurable maximum line length and raise or truncate when it is exceeded, so a single pathological line cannot consume unbounded CPU. As an interim mitigation, deployments that ingest untrusted corpora can bound the size of accepted input files or run corpus parsing under a CPU-time limit, though neither removes the quadratic behavior in the reader itself.
Reported by zx (GitHub: @manus-pi).
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: #3895 "[WIP] Bound algorithmic-DoS and uncontrolled-recursion vectors (CWE-400/407/674/1333)", open, head b22ebe144. Fix commit: 002bcf714 (SeekableUnicodeStreamReader.readline searches only the freshly decoded span for a line end).
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 (readline searches the fresh span via a _LINE_BOUNDARY_RE) and 2acc9bd97 (spans accumulated in a list and joined once).
No probe of its own; the readline part of the GHSA-j8g8 probe on #3753 reports FIXED on both PR heads (4.1x and 1.6x over a 4x input). The advisory PoC re-run (one unterminated line, 1M vs 4M chars): #3895 head 6.8x, #3753 head 5.3x, develop 2fa3f48fe 15.2x (0.34 s vs 5.20 s), so develop is still VULNERABLE.
Release: none.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 3.10.3"
},
"package": {
"ecosystem": "PyPI",
"name": "nltk"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "3.10.4"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-129231"
],
"database_specific": {
"cwe_ids": [
"CWE-400",
"CWE-407"
],
"github_reviewed": true,
"github_reviewed_at": "2026-11-19T23:48:39Z",
"nvd_published_at": "2026-11-19T18:18:08Z",
"severity": "MODERATE"
},
"details": "## Summary\n\n`SeekableUnicodeStreamReader.readline` in `nltk/data.py` assembles a line by repeatedly reading a block, appending it to a growing `chars` buffer, and recomputing `chars.splitlines(True)` over the entire buffer on every loop iteration. The read block size doubles only until it caps at 8000 characters, so for a single unterminated line of N characters the loop runs about N/8000 iterations and iteration k re-scans roughly 8000*k characters, giving O(N^2) total work. The default `size=None` used on the line-oriented corpus-reader read path means the early break never fires before end of file. An attacker who supplies a corpus file containing one very long line with no newline can force quadratic CPU consumption in the reader\u0027s process. This is the same growing-buffer re-scan algorithmic-complexity class the project already treats as advisory-worthy in sibling corpus readers.\n\n## Root Cause\n\nThe `readline` loop violates the expectation that reading a line costs time linear in the line length. On each pass it executes `chars += new_chars; lines = chars.splitlines(True)`, scanning the whole accumulated buffer again rather than only the newly read block. Because `readsize` is capped at 8000 (`nltk/data.py:1997-1998`), the number of iterations grows linearly with the line length while each iteration\u0027s scan cost also grows linearly, producing quadratic total cost. The loop exits only on end of file or when `size is not None`; since the line-oriented block readers call `stream.readline()` with no argument, `size` defaults to `None` (`nltk/data.py:1942`) and that early break is unreachable on this path. There is no length cap on the assembled line and no wall-clock backstop, because no regular expression is involved on this path and the `nltk.redos` timeout therefore does not apply.\n\n```text\nAffected function: nltk.data.SeekableUnicodeStreamReader.readline\nLoop with per-iteration full-buffer rescan: nltk/data.py:1968-2000\n chars += new_chars; lines = chars.splitlines(True) (nltk/data.py:1977-1978)\n readsize *= 2 capped at 8000 (nltk/data.py:1997-1998)\nDefault size=None on the corpus-view path: nltk/data.py:1942\nReachable via read_line_block/read_whitespace_block/read_wordpunct_block/\n read_blankline_block in nltk/corpus/reader/util.py, through _open\u0027s\n SeekableUnicodeStreamReader construction.\n```\n\n## Impact\n\nAn attacker who controls the bytes of a corpus file processed by a line-oriented NLTK corpus reader (encoding set, which is the common case) can craft one arbitrarily long unterminated line. Reading that line pins a single CPU core for time quadratic in the line length. The effect is recoverable CPU-availability degradation in the processing worker, not a crash: memory use remains linear and the operation completes once the buffer is exhausted. Because the constant factor is bounded by the 8000-character read cap, a meaningful denial of service requires a large crafted file, which keeps the severity in the low to medium range. The worst credible deployment is an automated document-ingestion service that feeds attacker-supplied uploads into such a reader with no human step; a more typical case where a victim manually loads an attacker-supplied corpus requires user interaction and is lower.\n\n## Proof of Concept\n\n`Requires only the nltk package under test on PYTHONPATH; no network access. Feeds one unterminated line of increasing length through SeekableUnicodeStreamReader.readline (size=None, the corpus-view path) and times each call.`\n\n```python\nimport io, time\nfrom nltk.data import SeekableUnicodeStreamReader\n\ndef measure(n):\n stream = io.BytesIO(b\"a\" * n) # one unterminated line, no newline\n reader = SeekableUnicodeStreamReader(stream, \"utf-8\")\n t0 = time.perf_counter()\n line = reader.readline() # size=None -\u003e corpus-view path\n dt = time.perf_counter() - t0\n assert len(line) == n\n return dt\n\nprev = None\nfor n in (1_000_000, 2_000_000, 4_000_000, 8_000_000):\n dt = measure(n)\n ratio = \"-\" if prev is None else f\"{dt/prev:.2f}x\"\n print(f\"{n:\u003e12,} chars {dt:8.3f}s ratio(x2 size)={ratio}\")\n prev = dt\n```\n\n```text\n 1,000,000 chars 0.058s ratio(x2 size)=-\n 2,000,000 chars 0.290s ratio(x2 size)=4.99x\n 4,000,000 chars 1.154s ratio(x2 size)=3.98x\n 8,000,000 chars 4.694s ratio(x2 size)=4.07x\n```\n\nThe roughly 4x time increase for each 2x increase in size is the O(N^2) signature; a linear `readline` would grow about 2x per 2x size step.\n\n## Attack Chain\n\n1. **Exposure:** The victim application processes a corpus file whose bytes are attacker-supplied through a line-oriented corpus reader. Corpus file content is untrusted input in NLTK.\n2. **Control:** The attacker controls the file bytes and can emit one arbitrarily long run of characters with no newline. This survives path/open security controls (`_secure_open`/pathsec), which bound file access but not read-loop cost.\n3. **Path:** `StreamBackedCorpusView._open` (`nltk/corpus/reader/util.py:210-214`) constructs a `SeekableUnicodeStreamReader` when an encoding is set; the block readers `read_line_block`, `read_whitespace_block`, `read_wordpunct_block`, and `read_blankline_block` call `stream.readline()` with no size argument.\n4. **Guard:** The only candidate guard, the `if not new_chars or size is not None:` early break at `nltk/data.py:1992`, does not fire because `size` defaults to `None`; the loop runs until end of file. No line-length cap and no wall-clock backstop exist.\n5. **Primitive:** Per-iteration `chars.splitlines(True)` over the whole growing buffer with a capped 8000-character read block, giving quadratic total work.\n6. **Result:** One CPU core is consumed for O(N^2) time on a single `readline` call, degrading availability of the reader\u0027s process. Recoverable, no crash.\n\n## Bypass Evidence\n\nThe `size is not None` early break is the only guard that could stop the quadratic loop, and it is disproven: `readline` is defined as `readline(self, size=None)` and the four shipped block readers invoke it with no argument, so `size` is `None` and the break only triggers at end of file. The `nltk.redos` timeout that protects regex-based paths does not apply here because there is no regular expression on the readline loop. The `linebuffer` short-circuit at `nltk/data.py:1955` is not taken for a single unterminated line, since the buffer never accumulates more than one element. Attempts to disprove the finding all failed: the size early break is unreachable on this path, the redos timeout is inapplicable, the linebuffer short-circuit does not engage, the block-size doubling does not make the loop log-linear because it caps at 8000, and the path is reachable from four standard block readers rather than being test-only. The sustained adversarial observation is only that impact is bounded (recoverable CPU degradation needing a large file), which lowers severity but does not overturn the finding. No prior fix exists for this sink; the two published sibling advisories in the same quadratic corpus-reader class target different functions.\n\n## Affected Versions\n\n- `Ecosystem: PyPI`\n- `Package: nltk`\n- `Confirmed affected range: \u003c= 3.10.3`\n- `Latest release checked: 3.10.3 (pypi.org/pypi/nltk/json, verified 2026-09-15)`\n- `Fix status: not fixed`\n\n`SeekableUnicodeStreamReader.readline` and its per-iteration `splitlines` re-scan are long-standing `nltk/data.py` code present in the current published artifact (3.10.3), and no fix has been released. The upper bound `\u003c= 3.10.3` is verified against the exact PyPI-published version. The lower bound is left open because the first affected release was not binary-searched; the vulnerable code predates recent releases.\n\n## Suggested Fix\n\nAvoid rescanning the whole buffer on every iteration. Search only the newly read block for a line terminator (tracking a running offset), or read through the underlying stream\u0027s own buffered line reading, so the cost of assembling a line is linear in the line length. Optionally impose a configurable maximum line length and raise or truncate when it is exceeded, so a single pathological line cannot consume unbounded CPU. As an interim mitigation, deployments that ingest untrusted corpora can bound the size of accepted input files or run corpus parsing under a CPU-time limit, though neither removes the quadratic behavior in the reader itself.\n\n---\n\nReported by zx (GitHub: @manus-pi).\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: #3895 \"[WIP] Bound algorithmic-DoS and uncontrolled-recursion vectors (CWE-400/407/674/1333)\", open, head b22ebe144. Fix commit: 002bcf714 (SeekableUnicodeStreamReader.readline searches only the freshly decoded span for a line end).\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 (readline searches the fresh span via a _LINE_BOUNDARY_RE) and 2acc9bd97 (spans accumulated in a list and joined once).\n\nNo probe of its own; the readline part of the GHSA-j8g8 probe on #3753 reports FIXED on both PR heads (4.1x and 1.6x over a 4x input). The advisory PoC re-run (one unterminated line, 1M vs 4M chars): #3895 head 6.8x, #3753 head 5.3x, develop 2fa3f48fe 15.2x (0.34 s vs 5.20 s), so develop is still VULNERABLE.\n\nRelease: none.",
"id": "GHSA-q4c8-9gwf-255x",
"modified": "2026-11-19T23:48:39Z",
"published": "2026-11-19T23:48:39Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/nltk/nltk/security/advisories/GHSA-q4c8-9gwf-255x"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-129231"
},
{
"type": "WEB",
"url": "https://github.com/nltk/nltk/pull/3895"
},
{
"type": "WEB",
"url": "https://github.com/nltk/nltk/commit/002bcf714ef8cb8baf94436f4be73e5516914412"
},
{
"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:L",
"type": "CVSS_V3"
}
],
"summary": "NLTK: Quadratic-time DoS in SeekableUnicodeStreamReader.readline on an unterminated corpus line via per-iteration full-buffer rescan"
}
GHSA-Q5GV-9735-3GFV
Vulnerability from github – Published: 2026-11-23 00:30 – Updated: 2026-11-23 00:30msgpackr before 2.1.4 contains an inefficient algorithmic complexity vulnerability that allows remote attackers to cause denial of service by repeatedly re-decoding buffered incomplete values. Attackers can stream a large container of small elements in small chunks to UnpackrStream or decodeIter, triggering quadratic decoding cost that blocks the Node.js event loop.
{
"affected": [],
"aliases": [
"CVE-2026-134812"
],
"database_specific": {
"cwe_ids": [
"CWE-407"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-11-22T22:17:35Z",
"severity": "HIGH"
},
"details": "msgpackr before 2.1.4 contains an inefficient algorithmic complexity vulnerability that allows remote attackers to cause denial of service by repeatedly re-decoding buffered incomplete values. Attackers can stream a large container of small elements in small chunks to UnpackrStream or decodeIter, triggering quadratic decoding cost that blocks the Node.js event loop.",
"id": "GHSA-q5gv-9735-3gfv",
"modified": "2026-11-23T00:30:25Z",
"published": "2026-11-23T00:30:25Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-134812"
},
{
"type": "WEB",
"url": "https://github.com/kriszyp/msgpackr/issues/229"
},
{
"type": "WEB",
"url": "https://github.com/kriszyp/msgpackr/commit/4eae7a11e96bb4ac292bb9ec9b4765cf18095a2f"
},
{
"type": "WEB",
"url": "https://github.com/kriszyp/msgpackr/blob/v2.1.3/iterators.js#L89-L127"
},
{
"type": "WEB",
"url": "https://www.vulncheck.com/advisories/msgpackr-before-2.1.4-inefficient-algorithmic-complexity-via-unpackrstream-and-decodeiter"
}
],
"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-Q67G-RXMW-649C
Vulnerability from github – Published: 2022-01-20 00:02 – Updated: 2022-01-29 00:01An Insufficient Algorithmic Complexity combined with an Allocation of Resources Without Limits or Throttling vulnerability in the flow processing daemon (flowd) of Juniper Networks Junos OS on SRX Series and MX Series with SPC3 allows an unauthenticated network attacker to cause latency in transit packet processing and even packet loss. If transit traffic includes a significant percentage (> 5%) of fragmented packets which need to be reassembled, high latency or packet drops might be observed. This issue affects Juniper Networks Junos OS on SRX Series, MX Series with SPC3: All versions prior to 18.2R3; 18.3 versions prior to 18.3R3; 18.4 versions prior to 18.4R2-S9, 18.4R3; 19.1 versions prior to 19.1R2; 19.2 versions prior to 19.2R1-S1, 19.2R2.
{
"affected": [],
"aliases": [
"CVE-2022-22153"
],
"database_specific": {
"cwe_ids": [
"CWE-407"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2022-01-19T01:15:00Z",
"severity": "HIGH"
},
"details": "An Insufficient Algorithmic Complexity combined with an Allocation of Resources Without Limits or Throttling vulnerability in the flow processing daemon (flowd) of Juniper Networks Junos OS on SRX Series and MX Series with SPC3 allows an unauthenticated network attacker to cause latency in transit packet processing and even packet loss. If transit traffic includes a significant percentage (\u003e 5%) of fragmented packets which need to be reassembled, high latency or packet drops might be observed. This issue affects Juniper Networks Junos OS on SRX Series, MX Series with SPC3: All versions prior to 18.2R3; 18.3 versions prior to 18.3R3; 18.4 versions prior to 18.4R2-S9, 18.4R3; 19.1 versions prior to 19.1R2; 19.2 versions prior to 19.2R1-S1, 19.2R2.",
"id": "GHSA-q67g-rxmw-649c",
"modified": "2022-01-29T00:01:21Z",
"published": "2022-01-20T00:02:05Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-22153"
},
{
"type": "WEB",
"url": "https://kb.juniper.net/JSA11261"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-Q87H-C5M7-659J
Vulnerability from github – Published: 2026-11-20 23:48 – Updated: 2026-11-20 23:48Summary
Every sibling <table> adds another level of the parent's indentation, so the size of get_text() output grows quadratically with the number of tables. In the measurements below, a 240 KB HTML document produces about 1 billion characters and uses about 1 GB of memory.
Details
table_end_handler() (model/tag/table_tag.py) writes the rendered table into the parent element with HtmlElement.write_verbatim_text() (model/html_element.py). For a block-level parent, write_verbatim_text() calls canvas.open_block(), which pushes the parent's padding_inline onto the prefix stack. The following close_block() never pops it; only Canvas.close_tag() calls prefix.remove_last_prefix(). So each table leaves one extra padding entry on the stack.
This has been present since 2.0 (commit 84ec720).
>>> get_text('<ul>' + '<table><tr><td>a</td></tr></table>' * 4 + '</ul>')
' a\n \n a\n \n a\n \n a\n '
PoC
import sys, time, resource
from inscriptis import get_text
n = int(sys.argv[1])
html = "<ul>" + "<table></table>" * n + "</ul>"
t = time.time(); out = get_text(html)
print(len(html), f"{time.time()-t:.2f}s", len(out), resource.getrusage(resource.RUSAGE_SELF).ru_maxrss // 2**20, "MiB")
inscriptis 2.7.5, Python 3.11, macOS (2.0.0 behaves the same):
| tables | HTML | time | output chars | peak RSS |
|---|---|---|---|---|
| 1,000 | 15 KB | 0.02 s | 4.0 M | 31 MiB |
| 4,000 | 60 KB | 0.33 s | 64 M | 154 MiB |
| 8,000 | 120 KB | 1.31 s | 256 M | 463 MiB |
| 16,000 | 240 KB | 5.63 s | 1,024 M | 991 MiB |
When the input doubles, output size and memory grow about 4 times.
Impact
Any application that converts untrusted HTML with inscriptis can be made to exhaust memory with a small document. This includes crawlers, RAG and LLM ingestion pipelines, and inscriptis-api. No authentication and no user interaction are needed.
Fix
self.canvas.write(self, text, whitespace=WhiteSpace.pre)
if self.display == Display.block:
+ self.canvas.current_block.prefix.remove_last_prefix()
self.canvas.close_block(self)
With this change the 240 KB input above produces 288 K characters in 0.14 s with 27 MiB peak RSS. A single table renders exactly as before, and the existing test suite passes.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 2.7.5"
},
"package": {
"ecosystem": "PyPI",
"name": "inscriptis"
},
"ranges": [
{
"events": [
{
"introduced": "2.0.0"
},
{
"fixed": "2.7.6"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-132277"
],
"database_specific": {
"cwe_ids": [
"CWE-400",
"CWE-407"
],
"github_reviewed": true,
"github_reviewed_at": "2026-11-20T23:48:51Z",
"nvd_published_at": "2026-11-20T17:18:12Z",
"severity": "MODERATE"
},
"details": "# Summary\n\nEvery sibling `\u003ctable\u003e` adds another level of the parent\u0027s indentation, so the size of `get_text()` output grows quadratically with the number of tables. In the measurements below, a 240 KB HTML document produces about 1 billion characters and uses about 1 GB of memory.\n\n# Details\n\n`table_end_handler()` (`model/tag/table_tag.py`) writes the rendered table into the parent element with `HtmlElement.write_verbatim_text()` (`model/html_element.py`). For a block-level parent, `write_verbatim_text()` calls `canvas.open_block()`, which pushes the parent\u0027s `padding_inline` onto the prefix stack. The following `close_block()` never pops it; only `Canvas.close_tag()` calls `prefix.remove_last_prefix()`. So each table leaves one extra padding entry on the stack.\n\nThis has been present since 2.0 (commit 84ec720).\n\n```python\n\u003e\u003e\u003e get_text(\u0027\u003cul\u003e\u0027 + \u0027\u003ctable\u003e\u003ctr\u003e\u003ctd\u003ea\u003c/td\u003e\u003c/tr\u003e\u003c/table\u003e\u0027 * 4 + \u0027\u003c/ul\u003e\u0027)\n\u0027 a\\n \\n a\\n \\n a\\n \\n a\\n \u0027\n```\n\n# PoC\n\n```python\nimport sys, time, resource\nfrom inscriptis import get_text\n\nn = int(sys.argv[1])\nhtml = \"\u003cul\u003e\" + \"\u003ctable\u003e\u003c/table\u003e\" * n + \"\u003c/ul\u003e\"\nt = time.time(); out = get_text(html)\nprint(len(html), f\"{time.time()-t:.2f}s\", len(out), resource.getrusage(resource.RUSAGE_SELF).ru_maxrss // 2**20, \"MiB\")\n```\n\ninscriptis 2.7.5, Python 3.11, macOS (2.0.0 behaves the same):\n\n| tables | HTML | time | output chars | peak RSS |\n|---|---|---|---|---|\n| 1,000 | 15 KB | 0.02 s | 4.0 M | 31 MiB |\n| 4,000 | 60 KB | 0.33 s | 64 M | 154 MiB |\n| 8,000 | 120 KB | 1.31 s | 256 M | 463 MiB |\n| 16,000 | 240 KB | 5.63 s | 1,024 M | 991 MiB |\n\nWhen the input doubles, output size and memory grow about 4 times.\n\n# Impact\n\nAny application that converts untrusted HTML with inscriptis can be made to exhaust memory with a small document. This includes crawlers, RAG and LLM ingestion pipelines, and `inscriptis-api`. No authentication and no user interaction are needed.\n\n# Fix\n\n```diff\n self.canvas.write(self, text, whitespace=WhiteSpace.pre)\n\n if self.display == Display.block:\n+ self.canvas.current_block.prefix.remove_last_prefix()\n self.canvas.close_block(self)\n```\n\nWith this change the 240 KB input above produces 288 K characters in 0.14 s with 27 MiB peak RSS. A single table renders exactly as before, and the existing test suite passes.",
"id": "GHSA-q87h-c5m7-659j",
"modified": "2026-11-20T23:48:51Z",
"published": "2026-11-20T23:48:51Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/weblyzard/inscriptis/security/advisories/GHSA-q87h-c5m7-659j"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-132277"
},
{
"type": "WEB",
"url": "https://github.com/weblyzard/inscriptis/commit/dc122894cd671a0227f8fdad60464acddaf40fc8"
},
{
"type": "PACKAGE",
"url": "https://github.com/weblyzard/inscriptis"
},
{
"type": "WEB",
"url": "https://github.com/weblyzard/inscriptis/releases/tag/2.7.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"
}
],
"summary": "Inscriptis: Quadratic memory growth from sibling \u003ctable\u003e elements in get_text()"
}
GHSA-Q8WF-6R8G-63CH
Vulnerability from github – Published: 2026-07-22 23:02 – Updated: 2026-07-22 23:02Impact
When self-hosting Next.js with the default image loader, the Image Optimization API can optimize remotely hosted images if configured (not enabled by default). If those images contain malicious content, they can cause CPU exhaustion in /_next/image endpoints.
- If you are using
config.images.remotePatterns, only the patterns in that array are impacted. - If you are using
config.images.unoptimized: true, you are NOT impacted. - If you are using
config.images.loader: 'custom', you are NOT impacted. - If you are using Vercel, you are NOT impacted.
Workarounds
If you cannot upgrade immediately, you can avoid the expensive work by setting config.experimental.imgOptSkipMetadata : true.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "next"
},
"ranges": [
{
"events": [
{
"introduced": "15.5.0"
},
{
"fixed": "15.5.21"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "npm",
"name": "next"
},
"ranges": [
{
"events": [
{
"introduced": "16.0.0"
},
{
"fixed": "16.2.11"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-64644"
],
"database_specific": {
"cwe_ids": [
"CWE-407"
],
"github_reviewed": true,
"github_reviewed_at": "2026-07-22T23:02:05Z",
"nvd_published_at": null,
"severity": "MODERATE"
},
"details": "### Impact\n\nWhen self-hosting Next.js with the default image loader, the Image Optimization API can optimize remotely hosted images if configured (not enabled by default). If those images contain malicious content, they can cause CPU exhaustion in `/_next/image` endpoints.\n\n- If you are using `config.images.remotePatterns`, only the patterns in that array are impacted.\n- If you are using `config.images.unoptimized: true`, you are NOT impacted.\n- If you are using `config.images.loader: \u0027custom\u0027`, you are NOT impacted.\n- If you are using Vercel, you are NOT impacted.\n\n### Workarounds\n\nIf you cannot upgrade immediately, you can avoid the expensive work by setting `config.experimental.imgOptSkipMetadata : true`.",
"id": "GHSA-q8wf-6r8g-63ch",
"modified": "2026-07-22T23:02:05Z",
"published": "2026-07-22T23:02:05Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/vercel/next.js/security/advisories/GHSA-q8wf-6r8g-63ch"
},
{
"type": "WEB",
"url": "https://github.com/vercel/next.js/pull/96006"
},
{
"type": "WEB",
"url": "https://github.com/vercel/next.js/commit/93cb90891402fa4c47798d03cb9e05c13233766c"
},
{
"type": "PACKAGE",
"url": "https://github.com/vercel/next.js"
},
{
"type": "WEB",
"url": "https://github.com/vercel/next.js/releases/tag/v15.5.21"
},
{
"type": "WEB",
"url": "https://github.com/vercel/next.js/releases/tag/v16.2.11"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N",
"type": "CVSS_V4"
}
],
"summary": "Next.js: Denial of Service in the Image Optimization API using SVGs"
}
No mitigation information available for this CWE.
No CAPEC attack patterns related to this CWE.