Skip to content

fix(*): mitigate glob parsing and update vulnerable dependencies - #32

Merged
omermorad merged 3 commits into
nextfrom
fix/cli-glob-limits
Oct 8, 2026
Merged

omermorad merged 3 commits into
nextfrom
fix/cli-glob-limits

Conversation

@omermorad

@omermorad omermorad commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Mitigate the reachable glob-parsing stack-exhaustion path identified in the separate risk review for GHSA-vfj7-8cjw-p6xm.

  • Check the exact resolved pattern before calling fast-glob: maximum length 1,024 JavaScript string code units and maximum brace/parenthesis nesting 32.
  • Use a bounded, non-recursive scan that respects escapes, quotes, character classes, and matching delimiters.
  • Reject excessive patterns with a clear ConfigError without logging the supplied pattern. Literal paths and ordinary glob matching retain their existing behavior.
  • Add 19 regression cases to the existing configuration E2E suite, covering the reproduced input, boundary limits, quoted/escaped/class closers, mixed nesting, normal matches, and literal paths. No new test files or test infrastructure.
  • Include the dependency overrides and lockfile updates from fix(*): align beta workflows and update vulnerable dependencies #31. The live audit now reports only the two reviewed advisories below, instead of the 23 findings on the original branch.
  • Keep audit handling inline in the existing GitHub Actions workflow. No scripts folder, custom action, or additional workflow is introduced.

Verification

  • pnpm build: passed.
  • pnpm lint: passed.
  • pnpm test: 8 passed.
  • pnpm test:e2e: 358 passed, 1 existing skip.
  • git diff --check: passed.
  • Workflow linting: passed. Existing Node 22/24/26 matrix unchanged.
  • Live audit gate: passed with the two explicitly accepted risks, not a clean vulnerability report.
  • Clean-worktree audit: passed after a frozen, scripts-disabled install. This install is required because pnpm returns empty dependency paths without node_modules; the gate deliberately rejects incomplete paths.
  • 17 ephemeral gate probes passed: expiry boundaries, clean reports after expiry, additional low-severity findings, registry/malformed-report errors, unexpected statuses, muted findings, changed advisory IDs/packages/versions, unreviewed cache paths, and inconsistent metadata. No repository test files were added for these probes.

Scope and remaining risk

  • Targets next. Security changes are also integrated into fix(*): align beta workflows and update vulnerable dependencies #31 without rewriting either branch's existing commits. Review this security PR first; fix(*): align beta workflows and update vulnerable dependencies #31 retains the separate beta-workflow changes.
  • Changes the CLI config loader, its existing E2E suite, dependency overrides/lockfile, and existing dependency-audit workflow. No package release versions, CI matrix, rulesets, or release workflows change here.
  • This addresses the reported recursive glob-input path, not every possible glob-complexity denial of service or every transitive braces consumer.
  • Omer approved two temporary CI risk exceptions on 2026-10-08. They expire at 2026-10-22 05:37:00 UTC, with no automatic extension:
  • Every other advisory remains blocking, regardless of severity. Registry/schema errors fail closed. At expiry, either remaining advisory blocks again; a clean audit still passes. Warnings and the job summary make accepted risk visible. Remove these exceptions when patched; no security alert is dismissed.
  • The Action still bundles the published CLI. It receives this mitigation only after a separately approved Contractual publication followed by an Action dependency/bundle update. No SHA substitution or release is performed here.
  • These exceptions apply to CI only. The publishing audit in fix(*): align beta workflows and update vulnerable dependencies #31 remains strict; any publishing-gate exception needs separate approval. No approval to merge, create/move tags, publish packages, or create GitHub Releases is implied or exercised.

@omermorad omermorad changed the title fix(cli): bound glob parsing before brace expansion fix(*): mitigate glob parsing and update vulnerable dependencies Oct 8, 2026
@omermorad
omermorad marked this pull request as ready for review October 8, 2026 05:49
@omermorad
omermorad merged commit 45c00a0 into next Oct 8, 2026
11 checks passed
@omermorad
omermorad deleted the fix/cli-glob-limits branch October 8, 2026 05:50
omermorad added a commit that referenced this pull request Oct 8, 2026
## Scope

- Keep `release-preview.yml`, `release-packages.yml`,
`publish-packages.yml`, and `tag-global.yml`; no replacement workflows
or new test files.
- Use matching beta versioning inputs/commands in preview and
preparation, refresh the lockfile, and create scoped Conventional Commit
release PRs targeting `next`.
- Keep preparation, publishing, and tagging separate. Require manual
dispatch, the existing `release` environment approval, and reviewed
commit verification for release operations.
- Publish only beta package versions to the `beta` dist-tag. Validate
immutable tags and registry commit metadata; never move exact-version
tags.
- Update dependency overrides and the lockfile to available patched
versions. No package release versions changed.
- Integrate #32's CLI glob hardening, existing E2E regression cases, and
approved time-limited CI audit exceptions without rewriting branch
history. Review #32 first; this PR retains the separate beta-workflow
changes.

## Validation

- Workflow linting and `git diff --check` pass.
- Combined dependency and CLI changes pass existing build, lint, unit
tests (8), and E2E tests (358 passed, 1 existing skip).
- Live CI audit gate and 17 ephemeral failure/expiry probes pass. No new
test files or test infrastructure were added. The Node 22/24/26 matrix
and Lerna configuration are unchanged.
- Clean-worktree audit passes with a frozen, scripts-disabled install.
The audit workflow now performs that install so pnpm can report the
dependency paths required by the exception checks.

## Remaining blockers

This is a draft, not approval to merge or release. The underlying audit
still reports two high-severity advisories with no patched versions
listed. Omer approved temporary CI-only risk exceptions on 2026-10-08,
expiring at **2026-10-22 05:37:00 UTC**:

- [braces:
GHSA-vfj7-8cjw-p6xm](GHSA-vfj7-8cjw-p6xm),
only version 3.0.3. CLI length/depth guards mitigate the reviewed
glob-input path; tooling consumers remain affected.
- [http-cache-semantics:
GHSA-ch52-4w7c-c8xp](GHSA-ch52-4w7c-c8xp),
only version 4.2.0 through the reviewed root Lerna 9.0.7 paths, whose
callers use private caches on fresh runners.

The existing dependency-audit workflow enforces this fixed expiry and
reports warnings/job summaries. All other findings remain blocking,
including low severity; registry and malformed-report errors fail
closed. At expiry, either remaining advisory blocks again. Exceptions
should be removed when patched, and no security alert is dismissed.

**Publishing remains blocked:** `publish-packages.yml` keeps its strict
`pnpm audit --audit-level low` gate. Applying these exceptions to
publishing was blocked by the approval safeguard and requires separate
explicit approval. The manual release/environment approvals remain
intact regardless. The Action still needs a separately approved
Contractual publication and dependency/bundle update to receive the CLI
mitigation.

No workflows have been dispatched, and no tags, packages, or releases
have been published. Existing history and version tags are unchanged.
Omer must explicitly approve any future tagging or publishing operation.
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.

1 participant