brace-expansion: Quadratic-time expansion of the {a},b} rewrite causes CPU denial of service
CVE-2026-102277GHSA-q2hr-2g5m-vwhr
What to do
Vendor fix available. Upgrade each affected package to the fixed version on its release line (brace-expansion 5.0.12, 3.0.9, 2.1.7, 1.1.21), redeploy, then verify what is actually installed.
This page has no inventory attached, so it cannot say whether you are affected. A vendor fix is not proof that your deployment is fixed.
Affected packages
npm brace-expansion
- Affected
- >= 4.0.0, < 5.0.12>= 3.0.0, < 3.0.9>= 2.0.0, < 2.1.7< 1.1.21
- Fixed in
- 3.0.9, 5.0.12, 1.1.21, 2.1.7
Sources
- GitHub Advisory Database and maintainer security advisories on GitHub
GitHub-reviewed advisory GHSA-q2hr-2g5m-vwhr lists affected ranges: npm brace-expansion >=4.0.0 =3.0.0 =2.0.0 =0 <1.1.21
VerifiedObserved Structured GitHub Advisory Database record (type=reviewed) from the GitHub REST API.
- Open Source Vulnerabilities (OSV.dev), including the GitHub Advisory Database
OSV record GHSA-q2hr-2g5m-vwhr lists affected ranges: npm brace-expansion >=4.0.0 =3.0.0 =2.0.0 =0 <1.1.21 (fixed)
VerifiedObserved Structured OSV record; GitHub-reviewed advisory.
Severity and exploitation
- Exploitation
- No confirmed exploitation recorded. Patch Next marks exploitation only from CISA KEV.
- CVSS
- 5.3 · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
- EPSS
- CVE-2026-102277: 0.43% estimated exploitation activity in the next 30 days; percentile 37.14 (FIRST EPSS, 2026-11-03). This is a model estimate, not proof of exploitation or customer exposure.
Source description
As published by the source; long descriptions are shortened.
Summary Expanding {a},b}-shaped input takes time quadratic in the number of literal } characters, blocking the event loop. Bash preserves a quirk where a brace group followed by a comma set still expands ({a},b}). The parser implements this by rewriting the string and restarting the scan. Each pass absorbs exactly one } and re-scans from the beginning, so n trailing braces cost n full passes. Reproduction | n | input | time | results | |---|---|---|---| | 8,000 | 8 KB | 110 ms | 2 | | 16,000 | 16 KB | 446 ms | 2 | | 32,000 | 32 KB | 1.7 s | 2 | | 64,000 | 64 KB | 6.9 s | 2 | | 128,000 | 128 KB | 27.7 s | 2 | ms/n^2 is flat at ~1.7 and each doubling of n costs exactly 4.0x - quadratic. 128 KB of input blocks the event loop for nearly half a minute to produce two results. Mechanism Instrumenting the rewrite branch confirms it runs exactly n + 1 times, once per literal }, each re-scanning the whole string. There is a second multiplier. The rewrite replaces the group's closing } with the…
Dates and revisions
- Published by the source
- Last modified by the source
- Source last checked
- Revision 3 · amended ·
Amended from ghsa record GHSA-q2hr-2g5m-vwhr
- Revision 2 · amended ·
Amended from osv record GHSA-q2hr-2g5m-vwhr
- Revision 1 · created ·
Published from ghsa record GHSA-q2hr-2g5m-vwhr
Agent brief
Preview the exact text before you copy it. Commands are read-only suggestions; review them before running anything.
# Patch Next advisory brief: CVE-2026-102277
Advisory: brace-expansion: Quadratic-time expansion of the `{a},b}` rewrite causes CPU denial of service
IDs: CVE-2026-102277, GHSA-q2hr-2g5m-vwhr
Record: https://patchnext.com/advisories/cve-2026-102277 (revision 3, source checked 26 Oct 2026, 13:06 UTC)
Inventory: none attached. This brief comes from a public page and does not say whether any deployment is affected.
Severity: Medium (CVSS 5.3)
Exploitation: no confirmed exploitation recorded. Patch Next confirms exploitation only from CISA KEV.
Vendor response: Vendor fix available; fixed versions by package: brace-expansion 5.0.12, 3.0.9, 2.1.7, 1.1.21. A vendor fix does not mean a deployment is fixed.
## Affected components
- npm brace-expansion: affected >= 4.0.0, < 5.0.12; >= 3.0.0, < 3.0.9; >= 2.0.0, < 2.1.7; < 1.1.21; fixed in 3.0.9, 5.0.12, 1.1.21, 2.1.7
## Suggested inspection (read-only)
- `npm ls brace-expansion --all`: lists every installed copy and version, including transitive ones. Run in the project root after `npm ci`.
## Supported action
Upgrade each affected component to a fixed version on its release line. For a transitive dependency, upgrade the parent package or add an override or constraint, then regenerate the lockfile. Redeploy every environment that ran an affected version.
## Required regression checks
- Run the test suite and a production build.
- Exercise the features that depend on brace-expansion.
- Repeat the inspection and confirm that only fixed versions remain installed.
## Rollback considerations
- Keep the previous lockfile and deployment artifact. Rolling back reinstates the vulnerable version, so apply any documented mitigation while you fix forward.
## Unresolved questions
- Which deployments run an affected version?
- Exploitation status can change. Check again before lowering the priority.
- Mark the work resolved only after the fixed version is verified in production.
## Sources
- Verified: https://github.com/advisories/GHSA-q2hr-2g5m-vwhr (GitHub-reviewed advisory GHSA-q2hr-2g5m-vwhr lists affected ranges: npm brace-expansion >=4.0.0 =3.0.0 =2.0.0 =0 <1.1.21)
- Verified: https://osv.dev/vulnerability/GHSA-q2hr-2g5m-vwhr (OSV record GHSA-q2hr-2g5m-vwhr lists affected ranges: npm brace-expansion >=4.0.0 =3.0.0 =2.0.0 =0 <1.1.21 (fixed))
Commands are suggestions: review each one before running it.Loading voting…