Skip to content

fix(ci): stop running markdownlint from an unverified npx cache #8405

Closed

Description

@kyle-sexton

Refs: #8294

Problem

lint-repo in .github/workflows/pr-require-checks.yml (lines 862-869) restores ~/.npm/_npx and ~/.npm/_cacache under a static key, npx-markdownlint-cli2-${{ runner.os }}-<composite sha>, before the markdownlint composite runs npx --yes markdownlint-cli2@<pin>. Lines 877-884 save the cache only from refs/heads/main.

GitHub's dependency caching docs say: "Cache contents are not signed or verified, and any workflow run that can read a cache may extract its contents. Extracted caches may modify files that are subsequently executed in a workflow run, leading to malicious code execution."

npx does not appear to re-verify a matching tree it finds in _npx (UNVERIFIED by the filer: from a reading of npm/cli workspaces/libnpmexec/lib/index.js, where a tree whose node.pkgid equals the requested spec skips fetch and reify and its bin runs as found).

  • Attacker precondition: a write to main's cache scope under that exact key while it is absent (a pin bump or an eviction; the repo sits near the 10 GB cap). Jobs on trusted triggers such as workflow_dispatch on main get a write-mode cache token by default, and the lane workflows dispatched that way run PR-head code with a model holding Bash (fix(lanes): read-only cache and no id-token in jobs that run PR code #8294). Whether that Bash can reach a cache-write path is unproven: the runtime token is set only for node and container action steps, and CLAUDE_CODE_SUBPROCESS_ENV_SCRUB isolates the PID namespace. Tampering with files a later node step in the same job executes has not been probed.
  • Impact: code runs in lint-repo on every PR, merge group and scheduled run. That job holds contents: read, checks: read and no secrets, so it cannot steal credentials. It can forge the markdownlint, typos, zizmor and actionlint results that feed ci-status.
  • Contrast: the shfmt cache checks its binary with sha256sum -c before use.

Fix

Delete the "Restore the markdownlint download" and "Save the markdownlint download" steps so npx fetches from the registry each run. Keying on a lockfile hash would not help, because npx ignores lockfiles. Writer-side hardening (cache-mode: read on the jobs that call the lanes) stays in #8294.

Priority

Low: no secret exposure, and it needs a write-capable main-scope run executing untrusted code first.

Activity

  1. added
    needs-triage
    on Oct 19, 2026
  2. github-actions commented on Oct 19, 2026

    @github-actions
    Contributor

    Proposed work class: work-class: scoped
    Basis: automated intake triage; the lanes App applied this class.

    Size: Small
    Complexity: Low
    Uncertainty: Known
    Flags: none
    Blocked by: none

    Understood: remove the "Restore the markdownlint download" and "Save the markdownlint download" steps (and the comment above them) from the lint-repo job in pr-require-checks.yml. markdownlint-cli2 is then fetched from the registry on every run instead of coming from an unverified npx cache. Nothing is missing. The refinement comment's acceptance criteria are specific enough to build from. The exploit path is unproven, the job holds no secrets, and the owner's 2026-10-26 rule applies, so no person hold is needed. Writer-side hardening stays in #8294. No likely duplicates among the open issues.

    Automated triage, applied by the lanes App.

  3. added
    needs-human
    and removed
    needs-triage
    on Oct 19, 2026
  4. removed
    needs-human
    on Oct 25, 2026
  5. kyle-sexton commented on Oct 25, 2026

    @kyle-sexton
    MemberAuthor

    Released for re-triage under the owner's 2026-10-24 rule: an issue stops for a person only for an intent or vision question, a security call, a host or attended run, or spend outside prepaid credit. The hold label came off and intake triage runs again now; it re-applies a hold, with a numbered question, when one of those applies.

    To hold this issue again, add needs-human (or status: needs-decision) and say why in a comment.

  6. added
    needs-triage
    needs-human
    and removed
    needs-triage
    on Oct 25, 2026
  7. changed the issue type fromtoon Oct 25, 2026
  8. melodic-automation-lanes commented on Oct 25, 2026

    @melodic-automation-lanes
    Contributor

    The latest triage verdict holds nothing: the issue is at status: ready.

  9. added
    needs-owner-decision
    on Oct 25, 2026
  10. kyle-sexton commented on Oct 26, 2026

    @kyle-sexton
    MemberAuthor

    Builder: the Automation Lanes session builds this from the owner's machine. The fix edits .github/workflows, which the lanes App cannot push (patch-rules.json:3); that boundary stays. Its PR closes this issue. needs-human came off under the owner's 2026-10-26 rule (a person only for an intent or vision change, an implementation finding that alters intent or the primary design, or a HIGH/CRITICAL security issue); none applies. agent-ready stays off so the issue lane does not race the build.

  11. added
    status: confirmed
    on Oct 26, 2026
  12. 4 remaining items

  13. added
    needs-triage
    on Oct 26, 2026
  14. added
    status: ready
    and removed
    needs-triage
    status: ready
    on Oct 26, 2026
  15. melodic-automation-lanes commented on Oct 26, 2026

    @melodic-automation-lanes
    Contributor

    Not admitted to the issue lane: no trusted-human acceptance criteria: a listed human must put the confirmed - [ ] criteria in the body or post them as their own comment, or, on an issue a listed human filed, intake's newest refinement comment must hold them unedited. Admission takes the issue once each of those is met, when intake triages it again (.github/actions/resolve-config/admission-rules.json).

  16. added
    needs-triage
    on Oct 26, 2026
  17. melodic-automation-lanes commented on Oct 26, 2026

    @melodic-automation-lanes
    Contributor

    Refinement. A read-only run explored this repository, searched its issues and pull requests, and read the allowed docs to draft what follows. On an issue a listed human filed, it counts as the issue's spec once posted, while unedited; it is still model text, so check it.

    Intended outcome: The lint-repo job in pr-require-checks.yml no longer restores or saves the unverified npx cache, so markdownlint-cli2 is fetched from the registry on each run.

    Acceptance criteria

    • .github/workflows/pr-require-checks.yml has no step named Restore the markdownlint download
    • .github/workflows/pr-require-checks.yml has no step named Save the markdownlint download
    • grep -rn 'npx_cache\|npx-markdownlint-cli2\|~/.npm/_npx\|~/.npm/_cacache' .github prints nothing
    • The Lint markdown step still uses the melodic-software/ci-workflows markdownlint composite at the same pinned SHA with unchanged config and globs inputs
    • The comment above the removed restore step (it says the npx cache keeps the download) is removed too, leaving no stale text
    • The workflow file still parses as valid YAML and actionlint passes on it
    • The shfmt cache step and its sha256sum -c check are unchanged

    Dependencies

    • #​8294: writer-side hardening (cache-mode: read on lane-calling jobs) stays there and is not part of this change
    • The fix edits .github/workflows, which the lanes App cannot push, so the owner's Automation Lanes session builds it per the 2026-10-26 maintainer comment

    Sources read

    • .github/workflows/pr-require-checks.yml:867-869: comment says the npx cache keeps the markdownlint download, keyed on the composite pin
    • .github/workflows/pr-require-checks.yml:870-877: restore step for ~/.npm/_npx and ~/.npm/_cacache under a static key (id npx_cache)
    • .github/workflows/pr-require-checks.yml:878-884: Lint markdown step uses the pinned composite
    • .github/workflows/pr-require-checks.yml:885-892: save step runs only on refs/heads/main when the restore missed; it is the only other use of npx_cache
    • repo-wide grep: npx_cache and the cache key appear only in pr-require-checks.yml, so nothing else depends on them

    Automated refinement by the lanes App. Intake triages the issue again with it.

  18. added
    status: ready
    and removed
    status: confirmed
    needs-triage
    on Oct 26, 2026
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: securitystatus: ready

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions