Skip to content

[sec-check] Gate proposal: dev-tree npm advisories are never audited in CI (6th instance: re2js GHSA-gg6h-894w-4m9c via markdownlint-cli2) #515

Closed

Description

@hivecommons-hive

Security Finding

Severity: low (process gap; current instance is a dev-only quadratic ReDoS)
Type: unsafe-pattern / missing gate

Risk: governance

Why this is a gate proposal and not another per-package issue

This is the sixth dev-tree transitive advisory in this repository that nothing in CI detects, and that only surfaces when an agent runs npm audit (without --omit=dev) by hand:

# Package (pinned by) Advisory Fix shape
#56 smol-toml (markdownlint-cli2) — lockfile bump
#133 js-yaml, markdown-it (markdownlint-cli2) GHSA-r3ph-w7gj-g6xm, GHSA-253c-mchw-3w2r lockfile bump
#306 smol-toml 1.8.0 (markdownlint-cli2) GHSA-r4xh-jqrq-34v2 overrides
#406 markdown-it 15.0.2 (markdownlint-cli2) GHSA-gfr2-rv44-r23c, GHSA-vfgh-jcmw-g37q overrides
#448 undici 8.11.2 (jsdom) GHSA-4qv8-2p9j-2685 +2 overrides
this re2js 2.8.6 (markdownlint 0.42.0 → markdownlint-cli2 0.24.0) GHSA-gg6h-894w-4m9c (high, quadratic lookbehind) overrides

Every one of these was the same root cause: .github/workflows/npm-audit.yml runs npm audit --omit=dev, so advisories in devDependencies never fail a check, and Dependabot cannot bump them because the parent (markdownlint) pins an exact version. The repo already has the machinery to gate this class — scripts/npm-audit-gate.ts with .github/npm-audit-exceptions.json (GHSA id + reason + expiry) — it is just not pointed at the dev tree.

Proposed gate

Add a second audit step that includes dev dependencies. Because the exceptions file supports an expiry, an unpatched upstream (the usual case for dev tooling) can be acknowledged without blocking every PR.

Exact replacement in .github/workflows/npm-audit.yml (after the existing "Audit production dependencies" step):

      # Dev-tree advisories (markdownlint-cli2, jsdom, …) have repeatedly gone
      # unnoticed because the step above omits devDependencies. Gate them too;
      # unpatched upstreams are acknowledged, with an expiry, in
      # .github/npm-audit-exceptions.json.
      - name: Run npm audit (including devDependencies)
        run: npm audit --json > npm-audit-dev.json || true

      - name: Audit development dependencies
        run: npx tsx scripts/npm-audit-gate.ts npm-audit-dev.json --level=high

No change to scripts/npm-audit-gate.ts is needed; it already accepts any npm audit --json report.

Why this needs a human (or an ISSUES_PRS_MERGE agent)

The change lives under .github/workflows/. This agent's token is minted at the contributor tier, which GitHub rejects server-side for any push touching workflow files, so no PR from this lane can contain it. Applying the block above is mechanical.

The current instance (fixed separately)

[email protected] is pinned exactly by [email protected]; 2.8.7+ fixes GHSA-gg6h-894w-4m9c and no markdownlint release carries it yet. A PR adding "re2js": ">=2.8.7" to overrides (the same pattern as #307/#407/#449) is linked below; it resolves the advisory but not this issue — the gate is what is missing.

  • Add the dev-dependency audit step to .github/workflows/npm-audit.yml (human / merge-tier agent)
  • Accept or decline this gate (/hive approve or /hive decision)

Impact

Without the gate, the next dev-tree advisory also waits for a manual scan. Current instance impact is bounded: markdownlint runs on CI against PR-supplied markdown, so a crafted file can slow the markdownlint-cli2 job (quadratic, not exponential; the job has timeout-minutes).

Recommendation

Accept the gate above (option A), or decline and record in SECURITY.md/CONTRIBUTING.md that devDependency advisories are out of scope (option B) so future scans honour that policy instead of refiling.


Filed by sec-check agent (ACMM L6 — full mode)


🐝 Hive Agent: security | Instance: hosted-available-oke-11-placeholder-r05x | SHA: e57701f

— hive: agent=sec-check backend=copilot model=claude-fable-5.1 copilot=1.0.88

Activity

  1. added
    security
    agent/sec-check
    stage/045-needs-decision
    on Oct 29, 2026
  2. hivecommons-hive commented on Oct 29, 2026

    @hivecommons-hive
    ContributorAuthor

    What to reply

    • /hive approve: go with the recommendation
    • /hive decision <your instructions>: go ahead, following your instructions
    • /hive help: show these again

    If what this issue waited on has been done (a merged fix, or an action taken outside this repository), a maintainer can reply /fixed to close it as completed; Hive clears its park labels.

    Only a maintainer with write access can un-park; everything else is ignored. Full command reference: https://github.com/hivecommons/hive/blob/v5/src/docs/maintainer-commands.md.

  3. hivecommons-hive commented on Oct 29, 2026

    @hivecommons-hive
    ContributorAuthor

    task-list sweep: 0 of 2 items ticked. Not closing yet — outstanding boxes remain.

    Outstanding items:

    • 🔲 Add the dev-dependency audit step to .github/workflows/npm-audit.yml (human / merge-tier agent)
    • 🔲 Accept or decline this gate (/hive approve or /hive decision)

    Merged PRs referencing this issue so far:

    This comment is edited in place by the task-list sweep on every cycle; it is not duplicated.

  4. hivecommons-hive commented on Oct 29, 2026

    @hivecommons-hive
    ContributorAuthor

    /hive decision approve as a ratchet: record the baseline now, fail only on increases, warning-only for one release then enforce

    Rationale: CI hygiene gates land as ratchets so they never block existing work.

    Hive decided: Accepted as a ratchet.
    Why: A CI hygiene gate, landed as a ratchet.
    What happens next: The issue leaves Needs decision and an agent picks it up — expected within 30 min.
    If it doesn't happen: Re-run the decision, or remove the park label by hand.

    Decided by the hive at @clubanderson's request as the owner's delegate under the owner-delegate policy (rule ci-ratchet).

  5. added
    stage/010-actionable
    and removed
    stage/045-needs-decision
    on Oct 29, 2026
  6. hivecommons-hive commented on Oct 29, 2026

    @hivecommons-hive
    ContributorAuthor

    Un-parked by @clubanderson. Decision: approve as a ratchet: record the baseline now, fail only on increases, warning-only for one release then enforce

    stage/045-needs-decision is cleared when present and approved-direction is applied; any hold label is left exactly as it was.

    Recorded from the hive dashboard.

  7. added
    triage/accepted
    stage/020-claimed
    and removed
    stage/010-actionable
    on Oct 29, 2026
  8. hivecommons-hive commented on Oct 29, 2026

    @hivecommons-hive
    ContributorAuthor

    🔒 Claimed by agent scanner (agent on hive hosted-available-oke-11-placeholder-r05x). The claim lasts 2h0m0s without activity and renews while the work continues. Reply /unclaim to release, or /claim to take it over if you outrank the holder.

  9. added
    stage/030-pr-in-progress
    stage/040-covered-by-pr
    and removed
    stage/020-claimed
    stage/030-pr-in-progress
    on Oct 29, 2026
  10. hivecommons-hive commented on Oct 30, 2026

    @hivecommons-hive
    ContributorAuthor

    🔓 Claim by agent scanner released (holding agent relaunched).

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

    agent/sec-checkapproved-directionhive/verified-opensecuritytriage/accepted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions