{"id":"CVE-2026-33750","aliases":["GHSA-f886-m6hf-6m8v"],"url":"https://o3.security/vulnerability/CVE-2026-33750","summary":"brace-expansion: Zero-step sequence causes process hang and memory exhaustion","details":"### Impact\n\nA brace pattern with a zero step value (e.g., `{1..2..0}`) causes the sequence generation loop to run indefinitely, making the process hang for seconds and allocate heaps of memory.\n\nThe loop in question:\n\nhttps://github.com/juliangruber/brace-expansion/blob/daa71bcb4a30a2df9bcb7f7b8daaf2ab30e5794a/src/index.ts#L184\n\n`test()` is one of\n\nhttps://github.com/juliangruber/brace-expansion/blob/daa71bcb4a30a2df9bcb7f7b8daaf2ab30e5794a/src/index.ts#L107-L113\n\nThe increment is computed as `Math.abs(0) = 0`, so the loop variable never advances. On a test machine, the process hangs for about 3.5 seconds and allocates roughly 1.9 GB of memory before throwing a `RangeError`. Setting max to any value has no effect because the limit is only checked at the output combination step, not during sequence generation.\n\nThis affects any application that passes untrusted strings to expand(), or by error sets a step value of `0`. That includes tools built on minimatch/glob that resolve patterns from CLI arguments or config files. The input needed is just 10 bytes.\n\n### Patches\n\n\nUpgrade to versions\n- 5.0.5+\n\nA step increment of 0 is now sanitized to 1, which matches bash behavior.\n\n### Workarounds\n\nSanitize strings passed to `expand()` to ensure a step value of `0` is not used.","published":"2026-03-27T14:04:52.297Z","modified":"2026-08-12T03:51:22.079455009Z","cvss":{"score":6.5,"severity":"MEDIUM","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H"},"epss":{"score":0.0043,"percentile":0.36679,"asOf":"2026-09-17"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"npm","name":"brace-expansion","fixedVersion":"5.0.5"},{"ecosystem":"npm","name":"brace-expansion","fixedVersion":"3.0.2"},{"ecosystem":"npm","name":"brace-expansion","fixedVersion":"2.0.3"},{"ecosystem":"npm","name":"brace-expansion","fixedVersion":"1.1.13"}],"fix":{"url":"https://github.com/juliangruber/brace-expansion/commit/311ac0d54994158c0a384e286a7d6cbb17ee8ed5","label":"juliangruber/brace-expansion@311ac0d"},"references":[{"type":"WEB","url":"https://github.com/juliangruber/brace-expansion/blob/daa71bcb4a30a2df9bcb7f7b8daaf2ab30e5794a/src/index.ts#L107-L113"},{"type":"WEB","url":"https://github.com/juliangruber/brace-expansion/blob/daa71bcb4a30a2df9bcb7f7b8daaf2ab30e5794a/src/index.ts#L184"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/33xxx/CVE-2026-33750.json"},{"type":"ADVISORY","url":"https://github.com/juliangruber/brace-expansion/security/advisories/GHSA-f886-m6hf-6m8v"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-33750"},{"type":"REPORT","url":"https://github.com/juliangruber/brace-expansion/issues/98"},{"type":"FIX","url":"https://github.com/juliangruber/brace-expansion/commit/311ac0d54994158c0a384e286a7d6cbb17ee8ed5"},{"type":"FIX","url":"https://github.com/juliangruber/brace-expansion/commit/7fd684f89fdde3549563d0a6522226a9189472a2"},{"type":"FIX","url":"https://github.com/juliangruber/brace-expansion/commit/b9cacd9e55e7a1fa588fe4b7bb1159d52f1d902a"},{"type":"FIX","url":"https://github.com/juliangruber/brace-expansion/pull/95"},{"type":"FIX","url":"https://github.com/juliangruber/brace-expansion/pull/96"},{"type":"FIX","url":"https://github.com/juliangruber/brace-expansion/pull/97"},{"type":"PACKAGE","url":"https://github.com/juliangruber/brace-expansion"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-12T03:51:22.079455009Z"}}