{"id":"CVE-2026-33750","aliases":["CVE-2026-33750","GHSA-f886-m6hf-6m8v"],"related":[],"kind":"vulnerability","state":"published","title":"brace-expansion: Zero-step sequence causes process hang and memory exhaustion","summary":"The brace-expansion library generates arbitrary strings containing a common prefix and suffix. Prior to versions 5.0.5, 3.0.2, 2.0.3, and 1.1.13, a 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. Versions 5.0.5, 3.0.2, 2.0.3, and 1.1.13 fix the issue. As a workaround, sanitize strings passed to `expand()` to ensure a step value of `0` is not used.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"The brace-expansion library generates arbitrary strings containing a common prefix and suffix. Prior to versions 5.0.5, 3.0.2, 2.0.3, and 1.1.13, a 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. Versions 5.0.5, 3.0.2, 2.0.3, and 1.1.13 fix the issue. As a workaround, sanitize strings passed to `expand()` to ensure a step value of `0` is not used.","source":"cvelist"},{"lang":"en","text":"### 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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"La biblioteca brace-expansion genera cadenas arbitrarias que contienen un prefijo y un sufijo comunes. Antes de las versiones 5.0.5, 3.0.2, 2.0.3 y 1.1.13, un patrón de corchetes con un valor de paso cero (por ejemplo, ’{1..2..0}’) hace que el bucle de generación de secuencia se ejecute indefinidamente, haciendo que el proceso se cuelgue por segundos y asigne montones de memoria. Las versiones 5.0.5, 3.0.2, 2.0.3 y 1.1.13 solucionan el problema. Como solución alternativa, sanee las cadenas pasadas a expand() para asegurar que no se utilice un valor de paso de 0.","source":"nvd"}],"published":"2026-03-26T18:29:42.000Z","modified":"2026-10-26T22:10:00.163Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H","score":6.5,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H","score":6.5,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H","score":6.5,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"}],"cwes":["CWE-400"],"affected":[{"ranges":[{"version":">= 4.0.0, < 5.0.5","status":"affected"},{"version":">= 3.0.0, < 3.0.2","status":"affected"},{"version":">= 2.0.0, < 2.0.3","status":"affected"},{"version":"< 1.1.13","status":"affected"}],"vendor":"juliangruber","product":"brace-expansion","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"4.0.0","status":"affected","fixed":"5.0.5"}],"ecosystem":"npm","package":"brace-expansion","purl":"pkg:npm/brace-expansion","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"3.0.0","status":"affected","fixed":"3.0.2"}],"ecosystem":"npm","package":"brace-expansion","purl":"pkg:npm/brace-expansion","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"2.0.0","status":"affected","fixed":"2.0.3"}],"ecosystem":"npm","package":"brace-expansion","purl":"pkg:npm/brace-expansion","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.1.13"}],"ecosystem":"npm","package":"brace-expansion","purl":"pkg:npm/brace-expansion","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"1.1.13"},{"status":"affected","introduced":"2.0.0","fixed":"2.0.3"},{"status":"affected","introduced":"3.0.0","fixed":"3.0.2"},{"status":"affected","introduced":"5.0.0","fixed":"5.0.5"}],"vendor":"juliangruber","product":"brace-expansion","cpe":"cpe:2.3:a:juliangruber:brace-expansion:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/juliangruber/brace-expansion/security/advisories/GHSA-f886-m6hf-6m8v","tags":["mitigation","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/juliangruber/brace-expansion/issues/98","tags":["issue-tracking","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/juliangruber/brace-expansion/pull/95","tags":["issue-tracking","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/juliangruber/brace-expansion/pull/96","tags":["issue-tracking","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/juliangruber/brace-expansion/pull/97","tags":["issue-tracking","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/juliangruber/brace-expansion/commit/311ac0d54994158c0a384e286a7d6cbb17ee8ed5","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/juliangruber/brace-expansion/commit/7fd684f89fdde3549563d0a6522226a9189472a2","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/juliangruber/brace-expansion/commit/b9cacd9e55e7a1fa588fe4b7bb1159d52f1d902a","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/juliangruber/brace-expansion/blob/daa71bcb4a30a2df9bcb7f7b8daaf2ab30e5794a/src/index.ts#L107-L113","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/juliangruber/brace-expansion/blob/daa71bcb4a30a2df9bcb7f7b8daaf2ab30e5794a/src/index.ts#L184","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-33750","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/juliangruber/brace-expansion","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-03-27T14:47:58.490Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-33750","url":"https://www.cve.org/CVERecord?id=CVE-2026-33750","licence":"CVE Terms of Use","modified":"2026-03-27T14:48:06.779Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-f886-m6hf-6m8v","url":"https://github.com/advisories/GHSA-f886-m6hf-6m8v","licence":"CC-BY-4.0","modified":"2026-09-10T03:51:00.342Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-33750","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-33750","licence":"Public domain","modified":"2026-10-26T22:10:00.163Z"}],"updatedAt":"2026-11-25T22:59:17.388Z","epss":{"score":0.00501,"percentile":0.44512,"date":"2026-12-01T12:00:22.000Z"}}