Vulnerability in brace-expansion (CVE-2026-102277)
Summary
Vulnerability in brace-expansion (CVE-2026-102277). Risk of unauthorized operations or information disclosure. Exploitable via escClose. Mitigation: upgrade to 1.1.21 or later.
Original description
The description as published by the source.
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
const build = n => '{a}' + '}'.repeat(n) + ',z}'
for (const n of [8000, 16000, 32000, 64000, 128000]) {
const t = Date.now()
expand(build(n))
console.log(n, Date.now() - t + 'ms')
}
| 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 internal escClose sentinel, which is '\0CLOSE' + Math.random() + '\0' - about 25 characters. The working string therefore grows by ~25 characters on every pass:
| n | input length | final string length |
|---|---|---|
| 1,000 | 1,006 | 26,006 |
| 8… |
Source: NIST National Vulnerability Database NVD GitHub Advisory
Auto-generated summary
Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.
A vulnerability tracked as CVE-2026-102277 has been found in brace-expansion.
Attackers can target a specific entry point like escClose over the network to misuse the product.
Risk of unauthorized operations or information disclosure. CVSS score: 5.3/10.
What to do: upgrade brace-expansion to 1.1.21 or later.
If unsure, ask your IT team or search "brace-expansion CVE-2026-102277" on the vendor's site.
CVE-2026-102277 (brace-expansion) — CWE-400 / CVSS v3 5.3
Attack vector: remote (network-reachable) / unauthenticated / no user interaction
Attack surface: escClose / max / maxLength / minimatch
Patched: 1.1.21 — apply immediately
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.
A vulnerability (CWE-400) exists in brace-expansion. Attackers reach the vulnerable code path via escClose without authentication.
Check the vendor advisory for the affected versions of brace-expansion. Attack surface: escClose / max / maxLength / minimatch.
Severity: Medium (CVSS 5.3/10). Risk of unauthorized operations or information disclosure.
Update to 1.1.21.
Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.
Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'brace-expansion' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.
Response actions
Concrete steps and command examples for SOC/SRE teams to execute in order
-
1Identify exposure identify
grep -r 'brace-expansion' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
brace-expansionを grep し、稼働しているサービス・バージョンを把握する。 -
2Apply patch patch
Upgrade brace-expansion to 1.1.21ステージング環境で 1.1.21 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
3Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Affected packages
Fix status by distribution
Fixed packages published by each distribution for this CVE
- Debian DEBIAN-CVE-2026-102277 node-brace-expansion
- Ubuntu UBUNTU-CVE-2026-102277 node-brace-expansion
References
- web github.com
- web github.com
- web github.com
- web github.com
- web github.com
- web nvd.nist.gov
- web github.com