Skip to content

chore(security): override brace-expansion to fix the failing audit - #1461

Merged
clay-good merged 3 commits into
mainfrom
chore/brace-expansion-audit-fix
Jul 27, 2026
Merged

chore(security): override brace-expansion to fix the failing audit#1461
clay-good merged 3 commits into
mainfrom
chore/brace-expansion-audit-fix

Conversation

@clay-good

@clay-good clay-good commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Status: ready to merge — audits clean, website builds, all 2,279 tests pass.

What was wrong: The Security workflow has failed on every run on main since 2026-07-27. A new advisory (GHSA-mh99-v99m-4gvg, high severity) flags brace-expansion <= 5.0.7, and both lockfiles resolve a vulnerable version: 5.0.7 at the root and 1.1.16 in website/ (via minimatch@3, which pins ^1.1.7 — the only patched release is 5.0.8, so a plain update can't reach it).

How it was fixed: Ran pnpm audit --fix in both packages. It adds a scoped override, "brace-expansion@<=5.0.7": ">=5.0.8", to each package.json (next to the existing postcss/sharp overrides in website/). The lockfile diffs touch only brace-expansion and its own subtree. No change to the audit workflow — it caught a real advisory.

Proof:

  • Before: pnpm audit --audit-level high --dir website exits 1 (same failure as the Security run on main).
  • After: both pnpm audit --audit-level high and pnpm audit --audit-level high --dir website print No known vulnerabilities found.
  • pnpm --dir website build succeeds; root pnpm build + vitest run pass (112 files, 2,279 tests).

Notes: The forced 1.x → 5.x jump in website/ only affects serve-handler (the serve out preview script; not part of the Next build). brace-expansion 5.x changed its export shape, so brace patterns like {a,b} in serve-handler globs would break — we use serve with no config, so no such patterns exist. The override can be dropped once minimatch/serve move off the 1.x line.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Updated install dependency resolution to ensure a compatible brace-expansion version is selected.
    • Applied the same brace-expansion version resolution safeguard to the website package configuration.
  • Chores
    • Updated the Nix flake’s pinned dependency fetch integrity hash used during builds.

A new advisory (GHSA-mh99-v99m-4gvg, high) flags brace-expansion <= 5.0.7
with the only patched release being 5.0.8. The scheduled Security workflow
has failed on every run since 2026-07-27.

pnpm audit --fix adds a scoped override in both the root and website
packages; the lockfile diffs touch only brace-expansion and its subtree.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@clay-good
clay-good requested a review from a team as a code owner July 27, 2026 20:52
@clay-good
clay-good requested review from alfred-openspec and removed request for a team July 27, 2026 20:52
@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: c7da469a-fdd8-49c5-8599-ceec21337fe9

📥 Commits

Reviewing files that changed from the base of the PR and between 0ae5ce3 and b3d39fc.

📒 Files selected for processing (1)
  • flake.nix

📝 Walkthrough

Walkthrough

Adds matching pnpm.overrides entries to the root and website package configurations, requiring brace-expansion versions at least 5.0.8, and updates the Nix pnpm dependency fetch hash.

Changes

Dependency Configuration

Layer / File(s) Summary
Configure brace-expansion resolution
package.json, website/package.json
Adds pnpm.overrides mappings for brace-expansion@<=5.0.7 to >=5.0.8; the website retains its existing sharp override.
Update pnpm dependency fetch
flake.nix
Replaces the pnpmDeps fetch hash with a new pinned SHA-256 value.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Possibly related PRs

Suggested reviewers: alfred-openspec

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main security fix by overriding brace-expansion to resolve the failing audit.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/brace-expansion-audit-fix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying openspec-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 39d71d1
Status: ✅  Deploy successful!
Preview URL: https://d2280d9c.openspec-docs.pages.dev
Branch Preview URL: https://chore-brace-expansion-audit.openspec-docs.pages.dev

View logs

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@flake.nix`:
- Line 54: Replace the empty hash assigned to pnpmDeps.hash with the concrete
sha256 value generated by running scripts/update-flake.sh after the lockfile
changes, then commit the updated hash so the fixed-output derivation builds
successfully.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 1e6153e5-2d5f-4e07-be8b-16e0b29ae40f

📥 Commits

Reviewing files that changed from the base of the PR and between 39d71d1 and 0ae5ce3.

📒 Files selected for processing (1)
  • flake.nix

Comment thread flake.nix Outdated
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@alfred-openspec alfred-openspec left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed at b3d39fc. Both audits are clean, the root and website builds pass, the Nix hash is green, the cross-platform 2,279-test CI suite passes, and I verified the affected serve out preview returns both the homepage and a docs route successfully.

@clay-good
clay-good added this pull request to the merge queue Jul 27, 2026
Merged via the queue into main with commit 05c7019 Jul 27, 2026
16 checks passed
@clay-good
clay-good deleted the chore/brace-expansion-audit-fix branch July 27, 2026 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants