Skip to content

Security scan: resolve findings (2026-07-29) - #8

Merged
FlyOverCoderKY merged 2 commits into
mainfrom
claude/security-scan-fixes
Jul 30, 2026
Merged

FlyOverCoderKY merged 2 commits into
mainfrom
claude/security-scan-fixes

Conversation

@FlyOverCoderKY

Copy link
Copy Markdown
Contributor

Works the two open findings in docs/securityscan.md. Both were independently
re-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. prepare uploads .release/
(tarballs plus package-manifest.json); publish downloads it and
verifyPreparedManifest checks each tarball against the manifest that shipped
in the same artifact
. The other anchors (prepared.gitCommit, the release-event
commit, the tag) are all public values an attacker would know, so a
self-consistent replacement of tarballs and manifest satisfied every check.

Fix: prepare records the SHA-256 of package-manifest.json as a job output, so
it crosses the boundary through run metadata rather than the artifact. publish
passes it as --expected-manifest-digest and release:publish now requires the
digest and compares it with timingSafeEqual before 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:

  • self-consistently tampered tarball + manifest → the prepared package manifest does not match the digest recorded by the preparation job
  • missing / empty digest → an expected prepared manifest digest is required
  • genuine manifest + genuine digest → passes all verification and proceeds to the registry step
  • the digest printed by the script matches sha256sum exactly, 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=dev
reports 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.2 plus
older uuid ^3.3.2 and @azure/ms-rest-js ^1.5.0. Downgrading would resolve
nothing, 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 "shipped
dependencies 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 are
    absent from a fresh clone — nothing to remove in the repository.
  • npm's azurite 3.33.0 "fix": verified and rejected, see above.

Release

All four published packages bumped 0.1.0 → 0.1.1 (the release script requires one
exact shared version), inter-package @pegma/storage-blobs pins updated to
0.1.1, and package-lock.json synced. No public API changed — the new
release:publish flag and the two new script exports are additive and live in
unpublished scripts/.

Checks

npm ci, npm run format:check, npm run check, npm test (223 passed),
npm run release:check all pass locally. Four new tests cover the digest gate
and its workflow wiring, following the existing tests/release-packages.test.ts
conventions. Edited files verified byte-clean (LF only, no literal control
characters) per AGENTS.md.

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings July 30, 2026 00:28
@cursor

cursor Bot commented Jul 30, 2026

Copy link
Copy Markdown

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.

@github-actions

github-actions Bot commented Jul 30, 2026 •

Copy link
Copy Markdown

Grok Grok Build Review — no issues

Review complete. Nothing actionable to report.

This pull request correctly closes both security-scan findings with changes that match the documented threat model. The publish path now anchors package-manifest.json across the prepare/publish boundary through job outputs and rejects a missing, malformed, or mismatched SHA-256 digest before the manifest is parsed; tarball self-consistency checks therefore cannot be satisfied by a replaced artifact alone. The CI runtime audit gate is appropriately scoped to shipped dependencies, and the 0.1.1 version alignment across packages and the lockfile is consistent. No correctness, security, or maintainability defects requiring change were identified.

Reviewed commit 8dc956a · workflow run

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.json across the prepare → publish job 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.1 and 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.

Comment thread tests/release-packages.test.ts Resolved
Comment thread docs/securityscan.md Resolved
Comment thread docs/securityscan.md Resolved
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>
@FlyOverCoderKY
FlyOverCoderKY merged commit b724fb9 into main Jul 30, 2026
5 checks passed
@FlyOverCoderKY
FlyOverCoderKY deleted the claude/security-scan-fixes branch July 30, 2026 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants