Repository navigation
Security scan: resolve findings (2026-07-29) - #8
Conversation
Anchor the prepared release manifest across the publish job boundary. The manifest previously travelled to the publish job inside the same artifact as the tarballs it describes, so a self-consistent replacement of both would have satisfied every internal check. The prepare job now records the manifest SHA-256 as a job output and the publish job passes it to `release:publish`, which requires the digest and compares it with `timingSafeEqual` before the manifest is parsed. Gate CI on `npm audit --omit=dev` so a future advisory in a shipped dependency fails the build. The remaining advisories are confined to the dev-only Azurite chain, which has no upstream fix: 3.36.0 is the latest release and npm's proposed 3.33.0 is a downgrade that keeps the same vulnerable rimraf and pulls older uuid and @azure/ms-rest-js. Bump all four published packages to 0.1.1 for the release. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
There was a problem hiding this comment.
Pull request overview
Strengthens the release/publish security boundary and CI security enforcement, addressing findings tracked in docs/securityscan.md for the Storage Blobs release pipeline.
Changes:
- Anchor
package-manifest.jsonacross theprepare→publishjob boundary by passing a SHA-256 digest via workflow run metadata and verifying it (timing-safe) before parsing. - Add a CI gate for shipped dependencies via
npm audit --omit=dev --audit-level=low. - Bump published package versions to
0.1.1and update inter-package pins / lockfile accordingly.
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/release-packages.test.ts | Adds coverage for manifest digest parsing/verification and asserts workflow wiring. |
| scripts/release-packages.mjs | Implements manifest digest computation + verification and threads expected digest into publish verification. |
| scripts/release-packages.d.mts | Updates type surface for the new digest-related exports/options and updated prepareRelease return shape. |
| .github/workflows/publish.yml | Records manifest digest as a job output and passes it to release:publish as an expected digest. |
| .github/workflows/ci.yml | Adds a runtime-only npm audit step to gate shipped dependency advisories. |
| docs/securityscan.md | Marks findings as resolved/mitigated and updates summary content. |
| packages/storage-blobs/package.json | Version bump to 0.1.1. |
| packages/storage-azure-blob/package.json | Version bump to 0.1.1 and updates @pegma/storage-blobs pin. |
| packages/storage-cloudflare-r2/package.json | Version bump to 0.1.1 and updates @pegma/storage-blobs pin. |
| packages/storage-s3/package.json | Version bump to 0.1.1 and updates @pegma/storage-blobs pin. |
| package-lock.json | Syncs lockfile versions and internal pins to 0.1.1. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Assert the workflow section boundaries before slicing in the manifest-anchoring test, matching the existing publish-workflow test so a layout change fails with an actionable message instead of a confusing slice. Reword the azurite finding as contained rather than eliminated: the advisories are still open upstream and only the runtime boundary changed. Mark the summary counts as the original scan record and add the current state per severity. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Works the two open findings in
docs/securityscan.md. Both were independentlyre-verified against the code before changing anything; both turned out valid,
though the dependency one is valid only in part.
Findings
[LOW] Publish pipeline trusts the cross-job artifact's self-consistency — fixed
Confirmed by reading the handoff end to end.
prepareuploads.release/(tarballs plus
package-manifest.json);publishdownloads it andverifyPreparedManifestchecks each tarball against the manifest that shippedin the same artifact. The other anchors (
prepared.gitCommit, the release-eventcommit, the tag) are all public values an attacker would know, so a
self-consistent replacement of tarballs and manifest satisfied every check.
Fix:
preparerecords the SHA-256 ofpackage-manifest.jsonas a job output, soit crosses the boundary through run metadata rather than the artifact.
publishpasses it as
--expected-manifest-digestandrelease:publishnow requires thedigest and compares it with
timingSafeEqualbefore the manifest is parsed.The gate is fail-closed: a missing or malformed digest aborts the publish.
Verified end to end locally with a real
release:pack:the prepared package manifest does not match the digest recorded by the preparation joban expected prepared manifest digest is requiredsha256sumexactly, so the workflow's shell computation agrees[MEDIUM] Dev-only azurite chain carries 12 known vulnerabilities — fixed (the actionable half)
The finding is factually accurate: 12 advisories (5 high, 7 moderate), and every
chain terminates at the root devDependency
azurite.npm audit --omit=devreports 0 vulnerabilities, so nothing reaches consumers.
The report's suggested upgrade is not available, and I verified npm's proposed
"fix" is bogus: azurite 3.36.0 is already the latest release, and the proposed
3.33.0 is a downgrade that declares the same vulnerable
rimraf ^3.0.2plusolder
uuid ^3.3.2and@azure/ms-rest-js ^1.5.0. Downgrading would resolvenothing, so the devDependency stays at
^3.36.0.What is actionable, and what this PR does, is the report's second recommendation:
CI now runs
npm audit --omit=dev --audit-level=low, turning "shippeddependencies are clean" from a current fact into an enforced invariant. Dev-chain
advisories remain tracked and non-gating so they cannot wedge every PR.
Previously "needs manual review" items — both closed by investigation
.tmp-sc//.grok/scratch dirs: local-only. Neither is tracked and both areabsent from a fresh clone — nothing to remove in the repository.
Release
All four published packages bumped 0.1.0 → 0.1.1 (the release script requires one
exact shared version), inter-package
@pegma/storage-blobspins updated to0.1.1, andpackage-lock.jsonsynced. No public API changed — the newrelease:publishflag and the two new script exports are additive and live inunpublished
scripts/.Checks
npm ci,npm run format:check,npm run check,npm test(223 passed),npm run release:checkall pass locally. Four new tests cover the digest gateand its workflow wiring, following the existing
tests/release-packages.test.tsconventions. Edited files verified byte-clean (LF only, no literal control
characters) per AGENTS.md.
🤖 Generated with Claude Code