Skip to content

[Security][beta] Restore clean pre-commit dependency audit for current lockfile #2829

Closed

Description

@mickdarling

Current blocker

On 2026-09-25, npm run pre-commit reaches npm audit --audit-level=high and fails on the current beta dependency tree: 29 vulnerable package paths (10 high, 18 moderate, 1 low; 0 critical). The preceding security tests and script typecheck pass after building the safety workspace. This is an inherited beta baseline issue, not a finding introduced by the native MCP install-link work (#2809/#2828): package.json, package-lock.json, and the safety workspace manifests/lockfile are byte-for-byte unchanged from origin/beta at 4d2bbf5c0623176c0bf19e2465e9284c4304814f (git diff --exit-code origin/beta -- package.json package-lock.json packages/safety/package.json packages/safety/package-lock.json passes). The current root lockfile SHA-256 is a7de66c7135377b32e9fb82631601094821aa2e2f21a38c98309c0569d171d08.

High findings in this audit

The 10 reported high package paths are ajv, brace-expansion, browserslist, express-rate-limit, fast-uri, ip-address, js-yaml, minimatch, serve-handler, and smol-toml. Some are parent packages reporting transitive findings, so this count is not 10 independent root vulnerabilities.

Representative underlying advisories: fast-uri SSRF / host confusion, ip-address SSRF / trust-boundary bypass, js-yaml merge-key CPU exhaustion, brace-expansion memory exhaustion, Browserslist unbounded memory growth, and smol-toml malformed-document DoS. ajv inherits fast-uri; express-rate-limit inherits ip-address; minimatch and serve-handler inherit brace-expansion. A fresh npm audit --json gives the full advisory set and dependency paths.

Reproduce

From the beta checkout with Node/npm supported by the project:

npm ci --ignore-scripts
npm run build:safety
npm run pre-commit

The last command passes its security test and script typecheck phases, then exits nonzero on the high-severity npm audit gate. npm audit --audit-level=high reproduces that phase directly.

Follow-up

Activity

  1. added
    priority: high
    area: security
    dependencies
    target: beta
    on Sep 25, 2026
  2. mickdarling commented on Sep 25, 2026

    @mickdarling
    MemberAuthor

    Dependency qualification progress — 2026-09-25

    Reviewed beta 174b0fe09036729424a9dd0cf8bd1d2c382957ef with two independent agents. The full-tree audit baseline is 29 vulnerable package paths (10 high, 18 moderate, 1 low); production-only audit reports 12 paths (5 high, 7 moderate, no critical). Parent-package attribution means these are not counts of independent flaws.

    Proposed minimum aged fixes: js-yaml 4.3.2 and nested 3.15.2, fast-uri 3.1.6, ip-address 10.3.1, smol-toml 1.7.1, brace-expansion 1.1.18 / 2.1.4, and browserslist 4.28.7. All meet the 21-day publication requirement; provenance/package-diff qualification is being documented. This is a candidate set, not a claim that tests or the final audit pass.

    The input-facing YAML parser is a confirmed runtime use. fast-uri is used for AJV schema resolution; the outbound host-policy prerequisite of its SSRF advisories has not been established. ip-address is production-installed through SDK rate limiting, but the verified parent uses Address6, not the Address4 path in the cited high advisory. smol-toml has no source import found. Brace expansion and Browserslist findings are development/tooling paths. These distinctions do not suppress the findings or replace patch qualification.

    The draft is isolated on codex/beta-dependency-audit. Lockfile generation is currently held because a PreToolUse rule rejected the exact npm install --package-lock-only --ignore-scripts --no-audit --no-fund command under a blanket npm install * pattern. Explicit approval for that command has been requested; no bypass or manual lockfile rewrite was attempted. No dependency PR, merge, or deployment has occurred.

    Remaining: finish provenance evidence, generate and inspect the narrow lock diff, independently review all resolutions, run focused/full qualification and latest-head CI/reviews, and retain an explicit disposition for residual moderate/low findings. Passing the high-severity audit gate will not mean zero advisories.

  3. mickdarling commented on Sep 25, 2026

    @mickdarling
    MemberAuthor

    Update: Mick explicitly approved the exact lockfile-only command. The agent retried it verbatim in the isolated worktree, but the outer PreToolUse hook still rejected it with Dangerous command pattern: npm install *. This is now a tooling block, not outstanding user approval. The supported Dollhouse CLI approval queue contains no pending request to approve. No policy configuration was weakened, no alternative command was used to evade the hook, and the lockfile remains unchanged.

    Package review continued independently: published browserslist changes bound caches and replace quadratic query parsing; smol-toml adds the EOF-comment termination fix alongside a string-parser rewrite; fast-uri and ip-address receive broader parser/classifier changes. Representative AJV reference and IPv6 rate-key compatibility probes passed in independent review. These checks do not replace the pending clean-install, focused/full regression, lockfile, and CI qualification.

  4. mickdarling commented on Sep 25, 2026

    @mickdarling
    MemberAuthor

    Root cause and existing feature tracking identified: #2356 already covers a human-verified, scoped override for static dangerous-command denials. Added the exact npm lockfile incident, source-path evidence, and one-shot/exact-command/working-directory binding requirements there.

    approve_cli_permission exists, but requires a pending approval request. This hook denial exits during static classification before creating one, so that operation cannot unblock the current command. DangerZone verification/deadlock relief is not an override for this classifier. No permissions were changed; the dependency draft and lockfile status remain unchanged.

  5. mickdarling commented on Sep 25, 2026

    @mickdarling
    MemberAuthor

    2026-09-25 beta audit qualification update

    At beta 174b0fe0, a fresh root audit reproduced 29 vulnerable package paths (10 high, 18 moderate, 1 low); production-only audit had 5 high and 7 moderate. Parent package paths are not independent root flaws. The aged, exact high-severity candidate manifest now proposes js-yaml@4.3.2 plus two scoped 3.15.2 overrides, fast-uri@3.1.6, ip-address@10.3.1, smol-toml@1.7.1, browserslist@4.28.7, and brace-expansion@1.1.18/2.1.4. Each named version exceeds the 21-day registry-publication gate in #2452; published tarballs, source tags, dependency/lifecycle changes, and focused semantics have been inspected. No age exception is requested.

    The owner manually ran the exact root npm install --package-lock-only --ignore-scripts --no-audit --no-fund command after the agent's outer PreToolUse hook rejected it, including after explicit approval. This first, provisional root lock has 19 changed package records, no additions/removals, but npm selected four Browserslist children published September 23–24, less than 21 days old: baseline-browser-mapping@2.11.26, caniuse-lite@1.0.30001812, electron-to-chromium@1.5.439, and node-releases@2.0.57. Their earliest eligibility dates are October 14–15. The lock has not been installed, executed, committed, or proposed for merge. Draft exact, aged alternatives are baseline-browser-mapping@2.11.0 (also clears its moderate advisory), caniuse-lite@1.0.30001806, electron-to-chromium@1.5.393, and node-releases@2.0.51; these versions have had registry integrity, signatures/provenance metadata, source-tag identity, and published artifact changes reviewed.

    A read-only audit of the provisional lock reports 1 high, 15 moderate, 1 low in the full tree and 7 moderate, 0 high/critical in production. The sole remaining high is brace-expansion in unchanged packages/safety copies. Draft exact safety overrides are prepared, but its standalone lock and the root lock's embedded safety copies remain unchanged. Both locks must be regenerated through the approved npm route, in safety-then-root order; the embedded copies and complete lock diff must be inspected afterward because the first root regeneration retained them. A passing pre-commit high threshold cannot be claimed yet.

    Next qualification gate: regenerate the safety lock from packages/safety with npm install --package-lock-only --ignore-scripts --no-audit --no-fund --workspaces=false, then regenerate the root lock with the owner's previously approved command; verify every resolved version is aged, inspect all lock movement, run fresh npm ci --ignore-scripts, both full and production audits, focused YAML/TOML/SDK/tooling tests, and the required CI/security/package/container matrix. No npm audit fix, force update, broad refresh, approval waiver, or Nodemailer exception transfer has been used.

  6. mickdarling commented on Sep 25, 2026

    @mickdarling
    MemberAuthor

    The separate workers/license-email/package-lock.json audit is tracked in #2836. Its five high paths are in the private worker’s Wrangler/Miniflare development-tool graph and require their own reachability and #2452 qualification; they are outside this root/safety lockfile remediation.

  7. mickdarling commented on Sep 25, 2026

    @mickdarling
    MemberAuthor

    2026-09-25 follow-up: corrected age gate, workspace lock blocker

    The owner manually regenerated the safety and root locks in that order. The current root lock (216000ec29e55723b67c51ef0718a376d3cd50f5ba844b3607f53ce1789678ae) now contains the exact aged Browserslist children; the four under-21-day resolutions from my prior comment are gone. The standalone safety lock (627a6ca3afd69f13b6864402fff1ac71909739075837e7495ff3ef768851b811) upgrades six brace-expansion copies to aged patched versions. No unrelated package family moved in either observed diff.

    Qualification still fails. The root lock retains four embedded safety-workspace brace-expansion@1.1.12 copies and a read-only root audit remains 1 high, 15 moderate, 1 low (production-only: 7 moderate, 0 high). A separate npm audit --workspaces=false in packages/safety reports three high families (browserslist, js-yaml, picomatch), one moderate, one low. The draft safety manifest now has exact aged overrides for those three high families, brace-expansion, and the Browserslist children, but its lock predates those new overrides. There is no claim that either audit gate is clear.

    The installed npm 11.13.0 Arborist lacks override forwarding across workspace links. npm/cli #9659 and its v11 backport describe the same root-override failure; exact npm 11.18.0 is an aged tool-only candidate containing the fix. The next proposed operator step is to regenerate safety then root locks using that pinned CLI with scripts disabled, then inspect every resolved version and run full plus standalone safety audits. No alternate npm binary was run by the agent, no lock was hand-edited, and no commit/push/PR has been made.

    Provisional compatibility on the current aged, audit-blocked locks passed: root npm ci --ignore-scripts, root build including standalone safety build, seven focused YAML/TOML/MCP unit suites (467 tests), three integration suites (18 passed, 2 skipped for unavailable Postgres), rapid security tests (108 passed, 46 filtered), script typecheck, and lint. These results do not replace tests and required CI/security/package/container gates on the final qualified locks.

  8. mickdarling commented on Sep 25, 2026

    @mickdarling
    MemberAuthor

    Latest candidate lock check: the standalone packages/safety lock now contains the reviewed, older-than-21-day exact fixes for brace expansion, both js-yaml lines, Browserslist and its four children, and picomatch. Its fresh audit is 0 high / 0 moderate / 1 low. A clean npm ci --ignore-scripts --workspaces=false, safety TypeScript build, 79 Jest tests, and npm audit signatures --workspaces=false (371 verified signatures, 15 attestations) passed.

    The root lock still retains four embedded packages/safety/node_modules/.../brace-expansion@1.1.12 copies even after npm 11.18.0 regenerated both locks. Root audit remains 1 high / 15 moderate / 1 low; production is 0 high / 7 moderate. The sole high finding comes from those four dev-tool copies. Independent diff review found no unrelated package movements, and all 13 newly resolved versions have matching registry integrity and exceed the 21-day age gate.

    The npm 11.18.0 read-only named-update dry run from the root selected exact brace-expansion@1.1.18 for four safety minimatch@3.1.5 edges in its ideal-tree log. Dry-run did not write a lock, and no final clearance is claimed. The operator has one narrowly scoped root-lock command to run, recorded in docs/security/beta-dependency-qualification-2026-09-25.md; afterward both locks and audits must be inspected, then final CI/security gates run. No commit or PR has been made.

  9. mickdarling commented on Sep 25, 2026

    @mickdarling
    MemberAuthor

    The current high-threshold fix leaves 15 moderate and 1 low root audit paths (7 moderate in the production-installed tree). Advisory-specific ownership, reachability review, and next review date are tracked in #2837, so this high-gate issue can close after its own acceptance checks without losing residual work.

  10. mickdarling commented on Sep 25, 2026

    @mickdarling
    MemberAuthor

    Resolved on beta by PR #2838, merged as 961029c. The final root, production, and standalone safety audits have zero high or critical findings; pre-commit passed and all 24 final-head CI checks succeeded. Codex and Claude reviewed the exact head with no actionable findings. Remaining moderate/low paths are tracked in #2837; the separate worker graph is #2836 and container packaging follow-up is #2839. Controlled deployment is in progress and is not yet claimed complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: securitydependenciespriority: hightarget: beta

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions