Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 15 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
"overrides": {
"esbuild": ">=0.28.1",
"protobufjs": ">=7.6.4 <8",
"ws": ">=8.21.0"
"ws": ">=8.21.0",
"brace-expansion": ">=5.0.8"
Comment on lines 114 to +118

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

3. Unbounded override range 🐞 Bug ⚙ Maintainability

The override uses ">=5.0.8", which allows future lockfile regenerations to select newer (including
potentially breaking) major versions of brace-expansion. It also forces minimatch@3.1.5 to run
against brace-expansion 5.x even though minimatch declares a 1.x range, creating an ongoing
transitive-compatibility risk.
Agent Prompt
## Issue description
The override `"brace-expansion": ">=5.0.8"` is open-ended and can float to future major releases when the lockfile is regenerated. It also overrides `minimatch@3.1.5`’s declared dependency range (`^1.1.7`), so the repo is relying on compatibility that npm is no longer enforcing.

## Issue Context
Right now the lockfile pins `brace-expansion` to `5.0.8`, but the manifest range increases the chance of unexpected breakage on routine dependency maintenance.

## Fix Focus Areas
- package.json[114-119]
- package-lock.json[4994-5005]

## What to change
- Prefer pinning to an exact version (`"5.0.8"`) or a bounded range (`"^5.0.8"`).
- Consider scoping the override to only the eslint/minimatch subtree (npm overrides support nested overrides) so you don’t globally replace every consumer’s `brace-expansion` with a potentially incompatible major.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

}
}
10 changes: 7 additions & 3 deletions scripts/security-audit.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,17 @@ const BUNDLED_ROOTS = [
// per-advisory allowlist is deliberate: a brand-new high/critical for the
// same package — let alone any other package — still fails the gate, forcing
// a conscious decision rather than silent acceptance.
// - brace-expansion GHSA-3jxr-9vmj-r5cp (DoS): pinned 5.0.6 by pi's
// shrinkwrap; every non-shrinkwrapped path in our tree is on the fixed line.
// - brace-expansion GHSA-3jxr-9vmj-r5cp + GHSA-mh99-v99m-4gvg (both DoS):
// pinned 5.0.6 by pi's shrinkwrap, both advisories confined to that one
// bundled node (verified: eslint's own brace-expansion moved to the
// patched 5.0.8 after #472's eslint 9->10 bump, so only the shrinkwrapped
// copy remains on the vulnerable <=5.0.7 line); every non-shrinkwrapped
// path in our tree is on the fixed line.
Comment on lines +31 to +36

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Informational

4. Incorrect audit script comment 🐞 Bug ⚙ Maintainability

The updated comment claims eslint’s brace-expansion moved to 5.0.8 due to an “eslint 9->10 bump”,
but this PR keeps eslint at ^9 and makes the change via npm overrides. This mismatch can mislead
future debugging of the security baseline gate.
Agent Prompt
## Issue description
The comment in `scripts/security-audit.mjs` attributes the brace-expansion change to an ESLint 9→10 bump, but the repo is still on ESLint `^9.0.0` and the actual mechanism is a root `overrides` entry.

## Issue Context
This is documentation-only, but it directly affects maintainers’ ability to reason about why the vulnerability is (or isn’t) present.

## Fix Focus Areas
- scripts/security-audit.mjs[31-36]
- package.json[101-106]
- package.json[114-119]

## What to change
Rewrite the comment to say the non-shrinkwrapped tree is fixed due to the root `overrides` forcing `brace-expansion@5.0.8`, while the shrinkwrapped `@earendil-works/pi-coding-agent` copy remains pinned and tolerated by advisory id.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

// - protobufjs / ws: previously tolerated by name while their advisories were
// live in the bundled subtree; currently dormant, so no ids are listed — if
// one refires, the gate fails loudly and the specific GHSA gets re-added.
const TOLERATED_BUNDLED_ADVISORIES = new Map([
['brace-expansion', new Set(['GHSA-3jxr-9vmj-r5cp'])],
['brace-expansion', new Set(['GHSA-3jxr-9vmj-r5cp', 'GHSA-mh99-v99m-4gvg'])],
]);
Comment on lines +31 to 42

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

1. security-audit.mjs change lacks tests 📘 Rule violation ▣ Testability

This PR changes the Security baseline gate behavior by expanding TOLERATED_BUNDLED_ADVISORIES to
accept an additional GHSA ID, but no automated tests were added/updated in the same changeset to
cover this new allowlist behavior. Without tests, future refactors may unintentionally
broaden/narrow the gate logic and break CI or weaken security controls silently.
Agent Prompt
## Issue description
The PR updates `scripts/security-audit.mjs` to tolerate an additional `brace-expansion` advisory ID, which changes CI gate behavior, but there is no corresponding test change in this PR to lock in the intended behavior.

## Issue Context
The `security-baseline` CI job runs `node scripts/security-audit.mjs`, so changes to this script are executable behavior changes and should be covered by automated tests.

## Fix Focus Areas
- scripts/security-audit.mjs[31-42]
- tests/security-audit.test.js[1-200]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


function advisoryIds(info) {
Expand Down
Loading