Skip to content

fix(docs): pin brace-expansion override to 2.0.2 to unbreak the Cloudflare docs build#6110

Merged
houko merged 1 commit into
mainfrom
fix/docs-brace-expansion-override
Jun 15, 2026
Merged

fix(docs): pin brace-expansion override to 2.0.2 to unbreak the Cloudflare docs build#6110
houko merged 1 commit into
mainfrom
fix/docs-brace-expansion-override

Conversation

@houko

@houko houko commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Type

  • CI / Tooling

Summary

The librefang-deploy Cloudflare Workers build (which builds the docs/
Next.js site via the @opennextjs/cloudflare adapter) has been failing on
main and therefore on every PR built on top of it.

Root cause is the pnpm override added for the brace-expansion ReDoS advisory
(CVE-2025-5889):

"brace-expansion@>=2.0.0 <2.0.3": ">=2.0.3"

The target >=2.0.3 is open-ended, so pnpm resolves it to the newest release
(5.0.6). brace-expansion 3.x+ is ESM-only and exposes no default export,
while [email protected] — pulled in transitively by the OpenNext adapter —
does import expand from 'brace-expansion'. The build dies with:

SyntaxError: The requested module 'brace-expansion' does not provide an export named 'default'

Fix

Pin the override to the patched CJS release 2.0.2. It still satisfies the
advisory (the fix landed in 2.0.2) and keeps the CommonJS default-export
interop that [email protected] relies on. Diff is two lines (package.json +
the lockfile overrides section); no other dependencies change.

Verification

Reproduced and verified with [email protected] (the version pinned in
docs/package.json packageManager):

override value resolved brace-expansion import minimatch
>=2.0.3 (before) 5.0.6 SyntaxError: no default export
2.0.2 (after) 2.0.2 OK

Security

  • No new unsafe code
  • No secrets or API keys in diff
  • Keeps the CVE-2025-5889 remediation (brace-expansion >= 2.0.2)

…ild resolves a CJS build

The pnpm override for the brace-expansion ReDoS advisory (CVE-2025-5889)
used an open-ended target `>=2.0.3`, which pnpm resolves to the newest
release (5.0.6). brace-expansion 3.x+ is ESM-only and exposes no default
export, so [email protected] — pulled in by the @opennextjs/cloudflare
adapter during the `librefang-deploy` Workers build — fails on
`import expand from 'brace-expansion'` with:

  SyntaxError: The requested module 'brace-expansion' does not provide
  an export named 'default'

Pin the override to the patched CJS release 2.0.2, which still satisfies
the advisory and keeps a default export. Verified with [email protected]:
`>=2.0.3` resolves brace-expansion 5.0.6 and reproduces the error, while
`2.0.2` resolves 2.0.2 and imports cleanly.
@github-actions github-actions Bot added size/XS < 10 lines changed area/docs Documentation and guides no-rust-required This task does not require Rust knowledge labels Jun 14, 2026

@houko houko left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question on the version boundary before this merges — see inline.


Generated by Claude Code

Comment thread docs/package.json
"picomatch@<2.3.2": ">=2.3.2",
"picomatch@>=4.0.0 <4.0.4": ">=4.0.4",
"brace-expansion@>=2.0.0 <2.0.3": ">=2.0.3",
"brace-expansion@>=2.0.0 <2.0.3": "2.0.2",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The override selector key still reads brace-expansion@>=2.0.0 <2.0.3, which classifies 2.0.2 as part of the vulnerable range (it satisfies >=2.0.0 <2.0.3). Setting the target to 2.0.2 while the key declares that version vulnerable is a contradiction that needs clarification.

Two possible truths:

  1. 2.0.3 was never published>=2.0.3 always resolved to the ESM-only 3.x/5.x line, and 2.0.2 is the actual CVE-2025-5889-patched release. If so, this fix is correct, but the selector key should also be tightened to <2.0.2 (or removed) so the override accurately reflects the vulnerable boundary. Leaving <2.0.3 in the key while targeting 2.0.2 means packages that already resolved to the safe 2.0.2 will be caught by the override and "forced" to 2.0.2 — a no-op, but it misleads future readers about what version is actually unsafe.

  2. 2.0.3 exists and is the patched release — In that case, pinning to 2.0.2 re-introduces CVE-2025-5889 and the target should be 2.0.3 (not >=2.0.3, to stay on CJS).

Could you confirm which scenario applies (e.g., link to the advisory or npm view brace-expansion versions) and, if it's scenario 1, also update the selector key to <2.0.2? That will make the override internally consistent and correct for the next person who reads it.


Generated by Claude Code

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
librefang-deploy c912b56 Jun 14 2026, 11:47 PM

@github-actions github-actions Bot added the ready-for-review PR is ready for maintainer review label Jun 14, 2026
@houko
houko merged commit 35568c9 into main Jun 15, 2026
31 of 32 checks passed
@houko
houko deleted the fix/docs-brace-expansion-override branch June 15, 2026 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/docs Documentation and guides no-rust-required This task does not require Rust knowledge ready-for-review PR is ready for maintainer review size/XS < 10 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant