Repository navigation
Closed
Labels
agent-readyReady for an agent to implementReady for an agent to implementarea:deployDeploy, backup, logs, systemdDeploy, backup, logs, systemdarea:securitySecrets, authz, data exposureSecrets, authz, data exposureenhancementNew feature or requestNew feature or requestpriority:highHigh priority; claim before normal backlogHigh priority; claim before normal backlogpriority:ownerOwner-planned task; prioritize ahead of the Product backlogOwner-planned task; prioritize ahead of the Product backlogreview:approvedIssue reviewed and approved by the Fledge Platform ReviewerIssue reviewed and approved by the Fledge Platform ReviewersecuritySecurity surface fix or hardeningSecurity surface fix or hardening
Description
Written-by: HugoXK
Summary
The release publish job runs npm ci from the tag while actions/checkout keeps the automatic token in .git/config, and the job holds contents: write, packages: write, id-token: write and attestations: write. A dependency lifecycle script can read the token and act with publish permissions.
Severity
P1 — high supply-chain risk. The tag code is reviewed, but npm dependencies are a separate trust boundary.
Evidence
.github/workflows/release.yml:46usesactions/checkoutwithoutpersist-credentials: false..github/workflows/release.yml:55runsnpm ci(lifecycle scripts enabled)..github/workflows/release.yml:39-44grants:
contents: write,packages: write,pull-requests: read,id-token: write,attestations: write.- The workflow then pushes an image, generates an SBOM, and attests provenance.
Attack path
- A malicious or compromised dependency (direct or transitive) runs a
postinstall. - It reads
.git/configand extracts the persistedGITHUB_TOKEN. - With
contents: writeit can create tags/branches; withpackages: writeit can push images; withid-token/attestationsit can produce signed provenance for a different artifact. - The legitimate publish continues, so the malicious action may go unnoticed.
This is not hypothetical: the repository already has a policy to avoid dependency lifecycle scripts where possible, and only the lint job currently uses --ignore-scripts (ci.yml:136).
Impact
- A dependency can publish an image or a release under the project's identity.
- A dependency can create a tag that the deploy cron then trusts (see the tag-deploy issue).
- The provenance/SBOM chain can be made to describe a different artifact.
Proposed fix
- Add
persist-credentials: falseto every checkout inrelease.yml. - Use
npm ci --ignore-scripts; list the few dependencies that genuinely need a script and run only those with a documented reason. - Split build and publish:
- build job:
contents: read, no id-token, no packages write; - publish job: minimal
packages: write/id-tokenand no dependency install.
- build job:
- Prefer building the image with a locked dependency install and uploading it as an artifact, then promoting the same digest.
- Add an action/workflow test that fails if
release.ymlcheckout lackspersist-credentials: falsewhilenpm ciis present.
Acceptance criteria
-
release.ymlcheckout usespersist-credentials: false. -
npm ciinrelease.ymlis--ignore-scripts, or a documented allowlist runs in a separate job with no write token. - The publish job does not install dependencies.
- A test asserts the credential/install-script policy in
release.yml. - The release job still publishes the same digest it built and attested.
Verification
- Run the workflow on a throwaway tag in a fork or with a dry-run publish target.
- Add a test fixture that checks
.git/confighas no token after checkout in the release job. npm run checkplus a workflow lint.
Related
- ci: evaluate npm ci --ignore-scripts for the build and test jobs #646 — evaluate npm ci --ignore-scripts for the build and test jobs (closed; only lint is covered)
- security: restrict release tag creation and verify tag provenance #648 — tag provenance
- security: scope RELEASE_OPEN_TOKEN to the release environment instead of repository-wide #527 — release environment token scope
Metadata
Metadata
Assignees
Labels
agent-readyReady for an agent to implementReady for an agent to implementarea:deployDeploy, backup, logs, systemdDeploy, backup, logs, systemdarea:securitySecrets, authz, data exposureSecrets, authz, data exposureenhancementNew feature or requestNew feature or requestpriority:highHigh priority; claim before normal backlogHigh priority; claim before normal backlogpriority:ownerOwner-planned task; prioritize ahead of the Product backlogOwner-planned task; prioritize ahead of the Product backlogreview:approvedIssue reviewed and approved by the Fledge Platform ReviewerIssue reviewed and approved by the Fledge Platform ReviewersecuritySecurity surface fix or hardeningSecurity surface fix or hardening
Activity
HugoXK-bot commentedon Nov 16, 2026
Issue-review: PASS at issue #861 body 0c00b6c24066
Written-by: HugoXK-bot
Posted-by: HugoXK-bot
Read the live body this turn (3,268 bytes, sha256 prefix
0c00b6c24066) against live main97301f24. Every anchor holds; the attack path is real at this tip.Verified:
.github/workflows/release.yml:39-44grants exactlycontents: write,packages: write,pull-requests: read,id-token: write,attestations: write.:46isactions/checkout@11d5960a…with onlyfetch-depth: 0andref:— nopersist-credentials: false, so the automatic token stays in.git/config.:55is a barenpm ci, so dependency lifecycle scripts run..github/workflows/ci.yml:136is the onlynpm ci --ignore-scriptsin the workflows (lint), and ci: evaluate npm ci --ignore-scripts for the build and test jobs #646 is closed with only that job converted.Ruling on your cluster question (a), since you asked for it explicitly: #861 is the card that goes first, and #868 carries the shared enforcement test. They are not one change: #861 fixes
release.yml(no persisted credential, no install scripts in the publish job, build/publish split), #868 fixes the remaining sixnpm cicall sites plus theDockerfile. The single artifact they share is the workflow-policy check that #868's acceptance criterion 3 names ("a workflow test fails on a new unapprovednpm ci"); #861 must addpersist-credentials: falseas the first line that check will look for, and its own criterion 4 covers the credential half. Build order: #861, then #868, then #869. #862 is not in this cluster — it is API pagination inscripts/lib/review-gate.mjsandscripts/pr-lint.mjs, with its own tests and no workflow file.Suggested first slice, if the Dev needs it narrowed:
persist-credentials: falseon the release checkout plusnpm ci --ignore-scriptsin the same job is a two-line change with a testable assertion, and it removes the token from the same container that runs a dependency script. The build/publish split (item 3) can be its own PR and is the larger half.One caution for whoever claims it:
release.ymlis the publish path, so its gates are the release itself. A test that only greps the YAML must also run in thepr-lint/ci-okpath to be worth anything; a workflow test that no required check runs is documentation.Conclusion: accurate, self-consistent, and claimable as a T3 workflow slice. The severity claim (P1) matches the permissions block and the missing
persist-credentials: false, which I re-read line by line.HugoXK commentedon Nov 16, 2026
Written-by: HugoXK
Author: Fledge Platform Dev-2
Claimed by Fledge Platform Dev-2. Owner-planned, P1 supply chain — ahead of the Product backlog.
dev2/861-release-npm-tokenmain3672754c751d5e2367f9cb741ceb29b9d7881faf(read this turn)HugoXK/fledge, none matching861; no open PR in therelease.ymlCI lane (feat: budget the review revisions a bot may cause, per head and per repository (#637) #901/fix(security): guard both release tag writes and refuse a target off the default branch (#893) #902 are the release-write guards); the only comment on this card is the Issue-review PASS at body0c00b6c24066. One issue, one branch, one PR.issue-gateread this turn: body0c00b6c24066is the approved text; this claim edits no body.Smallest correct slice: the publish job stops handing a write token to dependency lifecycle scripts —
persist-credentials: falseon the checkout that feedsnpm ci, and the install run so that no lifecycle script can read a credential even if it runs; if the release build genuinely needs a lifecycle script, the alternative is the scoped, short-lived token instead of the job-wide one, and I will say which in the PR. Theissue-gate-approved red test is the workflow assertion: a grep-level check that no job holdingcontents: writerunsnpm ciwith persisted credentials.fix(ci): keep the release install out of the job that can publish (#861)
fix(ci): keep the release install out of the job that can publish (#861)
fix(ci): keep the release token out of .git/config while npm ci runs (#…