Skip to content

[KB-05] Prepare verified KB release artifacts and recovery - #6

Merged
FlyOverCoderKY merged 4 commits into
mainfrom
claude/kb-05-release
Nov 7, 2026
Merged

FlyOverCoderKY merged 4 commits into
mainfrom
claude/kb-05-release

Conversation

@FlyOverCoderKY

Copy link
Copy Markdown
Contributor

Release preparation could retain ignored incremental build output, and the four KB packages had no source-bound publication/recovery workflow. Preparation now clears validated owned outputs, forces fresh builds, and binds the exact ordered artifact set to an approved signed tag, main ancestry, event commit, and an independently transferred manifest digest.

The workflow validates Node 22 and 24 before packing, transfers an immutable artifact ID, and limits OIDC authority to publishing the prepared tarballs. Full-set public-registry preflight treats only HTTP 404 as absence; matching existing versions are byte-verified and skipped, conflicts stop before any publication. A separate unprivileged job verifies exact registry consumers and cryptographic provenance before imports.

Validation:

  • Formatting/types and the synthetic composition passed.
  • 115 release cases: 113 passed locally; two file-symlink cases need Windows Developer Mode and must execute in Linux CI.
  • Full runtime run: 371 passed and one native D1 request encountered Windows TCP EADDRINUSE. The affected ordering scenario then passed on all three backends with one worker. Complete current-head Node 22/24 CI remains required.
  • Four actual tarballs passed clean-consumer imports and MCP metadata checks.
  • The five-package authenticated MCP proof passed discovery, S256/browser-session approval, all five tools, exact evidence, replay, refresh/device, and negative authority cases.
  • A test-only temporary clone with an ephemeral approved SSH signer completed strict preparation after all four ignored outputs were deliberately poisoned; independent manifest/tarball checks confirmed fresh output and excluded orphan files. No refs were created in the actual repository.
  • Independent adversarial review is clean after the stale-output and verification-order corrections.

This is KB-05 release-preparation source in the approved Knowledge/AI plan. All four packages remain unpublished at 0.1.0. The bootstrap handoff requires maintainer 2FA and separate trusted-publisher/environment/signer configuration. No tag, release, registry publication, external setting, host installation, or activation is performed by this PR.

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

OpenRouter review posted (clean). #6 (review)

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-11-07T17:57:53.331727Z c8ef14a Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Comment thread scripts/release-registry.mjs Fixed
Comment thread tests/release/registry.test.mjs Fixed

@github-actions github-actions Bot 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.

OpenRouter pull-request review

Verdict: issues
Scope: full-pr (full-pr)
Mode: initial
Commit: 4a877198f99766c7dc8cc80a73dc4163c09be13f
Judge: openai/gpt-5.6-luna
Cost: $0.5246 (lanes $0.5182 + judge $0.0064)

Lanes

  • meta/muse-spark-1.2: ok (8 finding(s), 81.7s, 436774+9365 tokens (132179 cached), 5 tool round(s), via Meta, $0.44)
  • z-ai/glm-5.3-flash: ok (5 finding(s), 529.2s, 826377+75348 tokens (698624 cached), 7 tool round(s), via Modal, $0.0778)

Findings

🟠 Issue 1 — Incomplete Git environment sanitization in verifyReleaseIdentity

scripts/release-contract.mjs:40 · risk · identified by meta/muse-spark-1.2

Calling prepare with GIT_CONFIG_COUNT / GIT_CONFIG_KEY_0 / GIT_CONFIG_VALUE_0 (or GIT_CONFIG, GIT_CEILING_DIRECTORIES) set can override gpg.ssh.allowedSignersFile and force verification against an attacker-controlled signer file, even though the script claims signer approval comes from the workflow's reviewed configuration.

scripts/release-contract.mjs:git() deletes only GIT_DIR, GIT_WORK_TREE, GIT_INDEX_FILE, GIT_OBJECT_DIRECTORY, GIT_ALTERNATE_OBJECT_DIRECTORIES, GIT_COMMON_DIR. Git also respects GIT_CONFIG, GIT_CONFIG_COUNT, GIT_CONFIG_PARAMETERS, GIT_CEILING_DIRECTORIES, and GIT_CONFIG_NOSYSTEM? The function inherits process.env verbatim, so an environment-injected override can replace gpg.ssh.allowedSignersFile after the workflow wrote the reviewed file.

Checked current callers: prepareArtifacts and tests via signedGitFixture set GIT_CONFIG_GLOBAL/GIT_CONFIG_NOSYSTEM intentionally; no guard for GIT_CONFIG_COUNT. Counterevidence checked: workflow sets GIT_NO_REPLACE_OBJECTS=1 but not a deny-list for config overrides.

🔴 Issue 2 — Symlink bypass for reviewed npm CLI in prepare path

scripts/release-packages.mjs:68 · bug · identified by meta/muse-spark-1.2

An attacker who can create a symlink at the path supplied via RELEASE_NPM_CLI can make prepare execute a different npm-cli.js than the hash-verified tarball while still passing npmCliPath(true) checks.

scripts/release-registry.mjs:npmContext() correctly does lstat and rejects symlinks. scripts/release-packages.mjs:npmCliPath() only checks isAbsolute, basename, and exists plus a --version probe; it never calls lstat/realpath to reject a symlink or a symlink-to-file that points outside the verified extraction directory. The workflow extracts npm to RUNNER_TEMP/release-npm-11.18.0 with a hash check, but a later symlink swap before prepare would not be detected.

Checked blast radius: publish.yml sets RELEASE_NPM_CLI via GITHUB_ENV after extraction; npmCliPath(true) is the only gate before pack/prepare. No other symlink check exists on that path.

🟠 Issue 3 — publish.yml tag verification relies on implicit set -e

.github/workflows/publish.yml:60 · risk · identified by meta/muse-spark-1.2

If the runner shell is invoked without set -e (or with set +e via SHELL override), git verify-tag --raw failing would not abort the Verify the approved tag signer step and the workflow could issue tag/commit outputs for an unapproved tag.

The step runs git verify-tag --raw "${tag_ref}" and git merge-base --is-ancestor ... as bare commands without || exit 1 and without set -euo pipefail in the script header. GitHub's default is bash -e -o pipefail, but the script does not enforce it, so a future runner change or a shell: bash without -e would silently pass. The same pattern appears in Configure approved release signers.

Checked other steps: Validate release event inputs explicitly exit 1 on regex failure, but the signing steps do not.

🟠 Issue 4 — Registry preflight rejects legitimate tarball redirects

scripts/release-registry.mjs:72 · risk · identified by meta/muse-spark-1.2

Publishing to npm via registry.npmjs.org often serves tarballs with a 302 to a CDN (npm-registry -> registry.yarnpkg.com or *.cloudfront.net). scripts/release-registry.mjs:request() uses redirect: "error" and registryRecord() treats any non-200 as unknown failure, so a normal redirect would be reported as registry lookup failed; package availability is unknown and block any release.

Evidence: tarballUrl() builds https://registry.npmjs.org/<name>/-/<file>.tgz and the subsequent request(metadata.dist.tarball, fetch) is executed with redirect: "error". preflightRegistry and publishPreparedRelease both depend on this; the test fixture fakeRegistry returns direct 200 responses, so the suite never exercises a redirect and cannot fail.

No counterevidence found – docs claim preflight must succeed before any publish, so a redirect would strand the release.

🔵 Issue 5 — Bootstrap leaves packages without latest dist-tag

docs/BOOTSTRAP.md:35 · nit · identified by meta/muse-spark-1.2

A host running npm install @​pegma/knowledge-base-* (or npx) after the one-time 2FA bootstrap will resolve no latest tag and fail to install, because the handoff publishes with --tag bootstrap.

docs/BOOTSTRAP.md explicitly publishes all four tarballs with --tag bootstrap. npm's latest remains unset until a later npm dist-tag add or a trusted-publisher publish with default latest. The document says Do not advertise this bootstrap as the released dependency set but does not instruct the maintainer to add latest after verification, so an operator copying the commands verbatim will create un-installable packages.

Checked RELEASING.md publish command in OIDC path – it uses --provenance without explicit --tag, correctly defaulting to latest. The mismatch between bootstrap and OIDC paths is not documented.

🔵 Issue 6 — Manifest unpacked-size limits checked only on declared sizes

scripts/release-manifest.mjs:56 · nit · identified by meta/muse-spark-1.2

A malicious manifest could declare small files[].size values to pass PREPARED_MANIFEST_LIMITS.unpackedBytesPerArtifact while the actual tarball expands to far larger content; validateFiles and validatePreparedManifest never extract or measure real unpacked bytes.

scripts/release-manifest.mjs:validateFiles() sums file.size from the manifest and checks total <= unpackedBytesPerArtifact. verifyArtifacts() only verifies tarball size/shasum/integrity, not the individual file sizes inside the tar. An attacker with control of the prepare output could under-report file sizes and bypass repository bounds.

Checked callers: tests craft files with synthetic sizes matching the tar blob; no test forces a mismatch between declared file size and real tar content.

🔵 Issue 7 — DER parser does not reject indefinite-length or trailing bytes

scripts/release-registry.mjs:245 · nit · identified by meta/muse-spark-1.2

A crafted provenance certificate with indefinite-length encoding or trailing garbage after the outer SEQUENCE could cause derValue/certificateIssuer to parse only a prefix and return a spoofed issuer, potentially passing verifyCertificateIdentity.

scripts/release-registry.mjs:derValue() handles short and long definite length but never rejects 0x80 indefinite form and never verifies that bytes.length == end at the top level. certificateIssuer() iterates tbs.value.length but trusts inner end pointers without ensuring no leftover bytes inside extensions. Fed a malformed certificate, the loop could miss an extra critical extension.

Checked tests: syntheticCertificate() builds well-formed definite-length fixtures; no negative parsing tests exist for indefinite length or trailing bytes.

🟠 Issue 8 — prepare re-verifies identity after build but checkout may still be dirty via ignored files

scripts/release-packages.mjs:429 · risk · identified by meta/muse-spark-1.2

A build step that writes an ignored file outside dist (e.g., packages/core/.env or a root .release artifact) would not be caught by the second verifyReleaseIdentity because git status --porcelain=v1 --untracked-files=all hides ignored files, allowing a dirty checkout to be published.

scripts/release-packages.mjs:prepareArtifacts() calls verifyReleaseIdentity, builds, runs consumer checks, then assert.deepEqual(verifyReleaseIdentity(...), identity) before writing preparedDir. The git status invocation does not include --ignored, so untracked ignored files are invisible. .gitignore ignores dist, *.tsbuildinfo, *.tgz, .release/, which means a malicious or accidental artifact dropped there during prepare would be overlooked.

Counterevidence checked: cleanBuildOutputs() only cleans dist and tsconfig.tsbuildinfo; it does not scan other ignored locations. No test covers an ignored file outside those paths.

🔴 Issue 9 — publish.yml pins two different commit SHAs, both labeled actions/setup-node v7 — one is not the reviewed action

.github/workflows/publish.yml:179 · bug · identified by z-ai/glm-5.3-flash

A maintainer creating the GitHub release has at least one of the release workflow's setup-node steps executing code that is not the reviewed actions/setup-node v7 — in the jobs that surround the OIDC-privileged publish step (id-token: write). The repository's pre-existing reviewed pin (used untouched by ci.yml:32 and by publish.yml's own validate job at line 118) is 949feb2413d6458794dcd2491c4babbbce0c15c1; this PR adds 820762786026740c76f36085b0efc47a31fe5020 # v7 in the prepare (line 179), publish (line 272), and verify (line 335) jobs. Two distinct SHAs cannot both be the same action's v7 commit, so at least one is a wrong/mistaken pin.

The inconsistency is provable from the checkout alone: grep for setup-node under .github/workflows shows both SHAs annotated # v7. The strongest counterevidence — that the v7 tag moved between when ci.yml and this PR were written — would still leave one SHA stale, which is the same defect for a supply-chain-sensitive pin. Resolution requires checking the real action history, which I cannot do from here; the safe fix is to reconcile all three new occurrences to the SHA already reviewed in ci.yml.

🟠 Issue 10 — Prepare job never fetches the annotated tag object, so the strict prepare step can hard-fail on every release run

.github/workflows/publish.yml:158 · risk · identified by z-ai/glm-5.3-flash

The prepare job checks out needs.identity.outputs.commit (a SHA ref) and then scripts/release-packages.mjs prepare must locally verify the tag: verifyReleaseIdentity runs git cat-file -t refs/tags/<tag> and aborts with "release ref must be an annotated tag object" if the tag object is not present in the clone. Concrete failure scenario: a maintainer signs and publishes v0.1.0; the identity job passes (it checks out the tag ref itself, so the tag object is fetched by the explicit refspec), but the prepare job's clone may contain no refs/tags/v0.1.0 — the checkout action's fetch-tags default is false and the only explicit fetch is git fetch --no-tags origin main:refs/remotes/origin/main (line 158). Every release run would then fail in prepare after the full validate gate, and the only recovery is editing the workflow after the tag and release already exist.

What I checked: no fetch-tags: input appears anywhere in publish.yml (grep for fetch-tags|--no-tags), and neither actions/checkout call in the prepare path requests tags. Proof gap I could not resolve from the checkout: actions/checkout's README also states fetch-depth: 0 fetches "all history for all branches and tags", and some versions materialize +refs/tags/*:refs/tags/* on full fetches, so the behavior for a SHA ref at depth 0 is action-version dependent — that is exactly why the finding is fixable cheaply by adding fetch-tags: true to the prepare checkout (or git fetch --tags origin) rather than relying on action internals. Note also that the PR's own validation describes only local script/test runs and a temp-clone prepare; nothing demonstrates the release-event path of this workflow executing end to end, so this prepare-job behavior is unverified.

🟠 Issue 11 — Registry provenance verification hard-codes npm's audit flag and JSON shape, pinned only by fixtures — first real run can brick the release's verify gate

scripts/release-registry.mjs:547 · risk · identified by z-ai/glm-5.3-flash

After publication, the verify job runs npm audit signatures --json --include-attestations --registry … (scripts/release-registry.mjs:547) and then verifyProvenanceAudit (line 410), which requires: audit.invalid and audit.missing both empty, each package matching exactly one verified[] entry with exact name/version/location/registry fields, exactly one predicateType bundle, verificationMaterial in either the certificate or x509CertificateChain shape, a DSSE payload whose SLSA statement matches exact strings (pkg:npm/%40pegma/…@​… purl subject, one-element resolvedDependencies with git+https://github.com/…@​refs/tags/…, internalParameters.github.event_name === "release", the GitHub-hosted builder id), plus hand-parsed DER for the Fulcio issuer OID. Concrete failure scenario: the first real release reaches verify only after the tag, release, and npm publication all succeeded — and then fails because, e.g., npm rejects the unknown --include-attestations flag (npm exits non-zero → "release npm or consumer verification command failed"), or npm's missing array includes unsigned transitive dependencies such as zod or @​pegma/spine (audit.missing.length !== 0 fails at line 416), or any property name/encoding differs (attestations vs attestationBundles, unencoded @​ in the purl subject, extra resolved dependencies). The release then cannot be advertised until the script is changed post-tag.

Evidence that nothing pins this to reality: tests/release/registry.test.mjs builds the audit with the same constants (provenanceAudit) and injects it through the run seam — the fixture fixture() writes a comment-only npm-cli.js and no test executes the real npm CLI — and the repository contains no recorded real npm audit signatures output (greps for audit in tests and docs only reach the fixture path). Proof gap: npm 11.18.0's flag and output shape cannot be verified from this checkout; the entire check rests on shape agreement between the code and its own fixture. Mitigation would be recording an observed real-run audit (as a documented shape or integration fixture) or making the shape checks fail with field-level diagnostics.

🔵 Issue 12 — release:prepare silently uses an unpinned npm when RELEASE_NPM_CLI is unset

scripts/release-packages.mjs:70 · nit · identified by z-ai/glm-5.3-flash

A maintainer running pnpm run release:prepare -- --tag v0.1.0 --expected-commit <sha> on a machine without the documented env vars gets whatever npm is found beside Node or on PATH — with no version assertion — while both docs/BOOTSTRAP.md (step 3) and docs/RELEASING.md instruct that preparation use the reviewed npm 11.18.0 via RELEASE_NPM_CLI/RELEASE_NPM_VERSION. The consumer jobs enforce this hard (npmContext fails without the absolute pinned CLI and matching version), so the asymmetry is easy to trip: preparation output produced under a different npm version than every other job of the pipeline is accepted, and the "use the reviewed npm" instruction is only convention for prepare.

Evidence: scripts/release-packages.mjs:70 gates all pin enforcement on preparedRelease && process.env.RELEASE_NPM_CLI !== undefined; the fallback search path has no version check. Mitigation: since prepared bytes are hashed into the schema-2 manifest the release is not integrity-unsafe, so this is an enforce-the-docs gap rather than a security hole — the fix is to require the pinned CLI for prepare unconditionally, or to log a warning when the fallback path is taken.

🔵 Issue 13 — The reviewed-npm extraction block is duplicated verbatim three times in publish.yml

.github/workflows/publish.yml:185 · nit · identified by z-ai/glm-5.3-flash

The identical ~20-line "Use the reviewed npm release" step (download tarball, verify NPM_TARBALL_SHA256, extract, check version, export RELEASE_NPM_CLI/RELEASE_NPM_VERSION) is copy-pasted into the prepare (~line 185), publish (~line 278), and verify (~line 341) jobs. Concrete maintenance failure: a future npm bump — e.g., a security release of the pinned npm — must update three blocks plus two duplicated NPM_VERSION/NPM_TARBALL_SHA256 constant pairs; a missed job leaves a mixed pipeline (prepare with npm X, publish with Y), where each job's self-check still passes because it validates only its own CLI against its own constants.

Evidence: the three blocks are byte-identical apart from nothing (compared in the full file read). A shared composite action or a single reusable step would remove the divergence risk; the per-job version assertion already limits (but does not eliminate) the cost of a mistake.

Workflow run

Comment thread scripts/release-contract.mjs Resolved
Comment thread scripts/release-packages.mjs Resolved
Comment thread .github/workflows/publish.yml Resolved
let size = 0;
if (response.body === null || response.body === undefined)
return Buffer.alloc(0);
for await (const chunk of response.body) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟠 Registry preflight rejects legitimate tarball redirects (risk)

Publishing to npm via registry.npmjs.org often serves tarballs with a 302 to a CDN (npm-registry -> registry.yarnpkg.com or *.cloudfront.net). scripts/release-registry.mjs:request() uses redirect: "error" and registryRecord() treats any non-200 as unknown failure, so a normal redirect would be reported as registry lookup failed; package availability is unknown and block any release.

Evidence: tarballUrl() builds https://registry.npmjs.org/<name>/-/<file>.tgz and the subsequent request(metadata.dist.tarball, fetch) is executed with redirect: "error". preflightRegistry and publishPreparedRelease both depend on this; the test fixture fakeRegistry returns direct 200 responses, so the suite never exercises a redirect and cannot fail.

No counterevidence found – docs claim preflight must succeed before any publish, so a redirect would strand the release.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Redirect rejection is an intentional public-registry boundary, not an absence result: a redirect fails closed before publication. I checked the actual pinned @pegma/spine@0.1.2 and zod@4.6.7 canonical registry.npmjs.org tarball endpoints with redirect following disabled; both returned HTTP 200 without Location. No current legitimate redirect reproduction is supplied. A future CDN/domain change needs an explicit reviewed destination policy rather than automatic destination expansion.

Comment thread docs/BOOTSTRAP.md
```sh
node scripts/release-packages.mjs prepare --tag v0.1.0 --expected-commit FULL_COMMIT_SHA
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Bootstrap leaves packages without latest dist-tag (nit)

A host running npm install @​pegma/knowledge-base-* (or npx) after the one-time 2FA bootstrap will resolve no latest tag and fail to install, because the handoff publishes with --tag bootstrap.

docs/BOOTSTRAP.md explicitly publishes all four tarballs with --tag bootstrap. npm's latest remains unset until a later npm dist-tag add or a trusted-publisher publish with default latest. The document says Do not advertise this bootstrap as the released dependency set but does not instruct the maintainer to add latest after verification, so an operator copying the commands verbatim will create un-installable packages.

Checked RELEASING.md publish command in OIDC path – it uses --provenance without explicit --tag, correctly defaulting to latest. The mismatch between bootstrap and OIDC paths is not documented.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This separation is intentional and documented under “First advertised trusted release.” Bootstrap creates the names under the bootstrap tag; it must not be advertised or promoted for host installation. An exact version remains installable without latest, but publication authority is a separate policy gate. A later, separately reviewed version is published through OIDC and receives the default latest tag only after its strict verification succeeds. Adding latest to the manual bootstrap after an integrity-only check would bypass the required trusted-provenance release boundary.

Comment thread .github/workflows/publish.yml Resolved
Comment thread .github/workflows/publish.yml Resolved
Comment thread scripts/release-registry.mjs Resolved
Comment thread scripts/release-packages.mjs Resolved
Comment thread .github/workflows/publish.yml Resolved

Copy link
Copy Markdown
Contributor Author

@codex security review

@github-actions github-actions Bot 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.

OpenRouter pull-request review

Verdict: issues
Scope: latest-commit (commit-range)
Mode: verify
Commit: 256d1bc9fdd2f14e1c5578052ea487035642bb0f
Judge: openai/gpt-5.6-luna
Cost: $0.1749 (lanes $0.1741 + judge $0.0008)

Lanes

  • meta/muse-spark-1.2: ok (0 finding(s), 58.9s, 126255+7216 tokens (32723 cached), 3 tool round(s), via Meta, $0.15)
  • z-ai/glm-5.3-flash: ok (1 finding(s), 88.0s, 229303+9234 tokens (145152 cached), 10 tool round(s), via Venice, $0.0216)

Round 2 resolution

  • ✅ r1-2 fixed correctly — Symlink bypass for reviewed npm CLI in prepare path: Added resolveReleaseNpmCli with lstat/realpath canonical check: rejects leaf symlinks and linked ancestor directories, requires absolute npm-cli.js regular file and RELEASE_NPM_VERSION=11.18.0, probes version in isolated env via tmpdir. npmContext also lstats. Tests cover leaf and ancestor links. Composite action extracts verified tarball to canonical path.
  • ✅ r1-9 fixed correctly — publish.yml pins two different commit SHAs, both labeled actions/setup-node v7 — one is not the reviewed action: publish.yml now pins single SHA 949feb2413d6458794dcd2491c4babbbce0c15c1 # v7 in validate, prepare, publish, verify jobs. Duplicate 820762... removed; prepare/publish/verify now via setup-release-npm action.
  • ✅ r1-1 fixed correctly — Incomplete Git environment sanitization in verifyReleaseIdentity: release-contract.mjs:git() now copies env and deletes case-insensitive GIT_CONFIG*, GIT_CONFIG_COUNT, GIT_CONFIG_PARAMETERS, GIT_CONFIG_KEY_/VALUE_*, plus GIT_DIR etc., then forces GIT_NO_REPLACE_OBJECTS=1. Preserves GIT_CONFIG_GLOBAL/NOSYSTEM as intended. Tested with indexed, serialized, direct and lower-case injections. Proof gap: GIT_CEILING_DIRECTORIES (cited in original evid…
  • ✅ r1-3 fixed correctly — publish.yml tag verification relies on implicit set -e: Added set -euo pipefail headers to Validate release event inputs, Verify the approved tag signer and main ancestry, Configure approved release signers, and Record independent manifest digest steps, so git verify-tag --raw and merge-base --is-ancestor failures abort the step without relying on runner default -e.
  • 🤝 r1-4 disputed — Registry preflight rejects legitimate tarball redirects: Fixing agent provides reasoned rebuttal: redirect is intentional fail-closed boundary before publication; canonical registry.npmjs.org tarball/metadata endpoints observed to return 200 without redirect (tested for @​pegma/spine@​0.1.2 and zod@​4.6.7 with redirects disabled). Automatic redirect following would expand trust to unreviewed CDNs. No new evidence of legitimate required redirect supplied.
  • 🤝 r1-8 disputed — prepare re-verifies identity after build but checkout may still be dirty via ignored files: Fixing agent rebuts that ignored files outside dist are deliberately allowed (node_modules, .release, caches). cleanBuildOutputs validates/removes owned dist/tsconfig.tsbuildinfo, prepareArtifacts forcibly rebuilds with tsc -b --force, and validateInventory allowlists tarball contents. Poisoned ignored-output proof confirmed fresh inventories. Blanket --ignored gate would reject re…
  • ✅ r1-10 fixed correctly — Prepare job never fetches the annotated tag object, so the strict prepare step can hard-fail on every release run: Both identity and prepare checkouts now use fetch-tags: true with fetch-depth: 0. Tag object refs/tags/<tag> is present for verifyReleaseIdentity's cat-file -t check even when prepare checks out the SHA, preventing hard-fail on missing tag.
  • ✅ r1-11 fixed correctly — Registry provenance verification hard-codes npm's audit flag and JSON shape, pinned only by fixtures — first real run can brick the release's verify gate: Provenance purl now uses split('/').map(encodeURIComponent).join('/') for scoped names. RELEASING.md records two real isolated npm 11.18.0 consumer runs (npm audit signatures --json --include-attestations): single package and 102-package graph both returned invalid=0, missing=0 with expected attestationBundles/verificationMaterial.certificate.rawBytes shape. Official npm docs link co…
  • 5 nit finding(s) from earlier rounds retired (severity floor for follow-up rounds is risk).
  • Open findings after this round: 1 (0 bug-severity).

Findings

🟠 Issue 1 — release-registry npmContext still accepts a CLI path reached through a symlinked ancestor directory

scripts/release-registry.mjs:304 · risk · identified by z-ai/glm-5.3-flash

The new resolveReleaseNpmCli() in scripts/release-packages.mjs closes the r1-2 symlink bypass by requiring lstat on a regular non-symlink file and realpath(path) === path, with tests for both leaf and ancestor links. The equivalent check in scripts/release-registry.mjs:npmContext() (used by the OIDC-privileged verify and publish paths) only performs lstat(cli) on the final component and then invokes resolve(cli); resolve() normalizes but does not canonicalize symlinks.

A path like ${RUNNER_TEMP}/link/npm-cli.js where link is a symlink to an attacker directory containing a fake npm-cli.js passes the leaf lstat check, returns 11.18.0 from the probe invocation, and is then executed again during publication with ACTIONS_ID_TOKEN_REQUEST_URL/ACTIONS_ID_TOKEN_REQUEST_TOKEN in its environment. A fake CLI can return the correct version on one invocation and exfiltrate or misuse the OIDC credential on the publish invocation.

I checked whether the workflow neutralizes this: the new composite action sets RELEASE_NPM_CLI from its own hash-verified extraction, so in-workflow runs get a canonical path, and docs/RELEASING.md instructs standalone users to supply a canonical path — but nothing in npmContext enforces it, unlike the prepare path. This is the same threat model and failure mechanism that r1-2 accepted as a bug for the prepare path; the prior finding's evidence only credited registry's leaf lstat, which does not cover linked ancestors.

Proof gap: this code is not newly introduced in this commit, and the attacker needs local filesystem write access on the runner between the setup action and the npm step — the same precondition r1-2 was judged on.

Workflow run

Copy link
Copy Markdown
Contributor Author

Round-1 fixes are pushed at 256d1bc. CodeQL package-URL encoding is corrected; Git config injection, strict canonical pinned npm selection, publisher environment isolation, workflow pins/tag fetching/strict Bash, duplicate npm setup, and test discovery are addressed. Fixed threads include the exact commit and are resolved. The five evidence-based disputes r1-4/r1-5/r1-6/r1-7/r1-8 were answered before the push and remain visible.

Local release regressions now have 125 cases (122 passed; three Windows permission-only symlink skips must execute in Linux CI). Both signed-clone preparation proofs passed with poisoned ignored outputs. The shared action's exact Bash block downloaded the pinned npm tarball, matched its SHA-256, and exported actual npm 11.18. The actual audit command passed for all seven exact external runtime pins and 102 installed packages: invalid=0, missing=0, verified=21. RELEASING records the observed real entry/SLSA/certificate shape, without claiming unpublished KB/Agent Access provenance.

Please complete the current-head follow-up review against the full release implementations and retained proof boundaries. All current-head Node 22/24, CodeQL, review and security gates still apply; no package publication or host activation is being performed.

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: 256d1bc9fd

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Copy link
Copy Markdown
Contributor Author

@codex security review

@github-actions github-actions Bot 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.

OpenRouter pull-request review

Verdict: clean
Scope: latest-commit (commit-range)
Mode: verify
Commit: c8ef14af0ec32e3903b9399543b7a9f2e48df2f9
Judge: openai/gpt-5.6-luna
Cost: $0.0799 (lanes $0.0798 + judge $0.0001)

Lanes

  • meta/muse-spark-1.2: ok (0 finding(s), 23.3s, 55330+2630 tokens (2033 cached), 2 tool round(s), via Meta, $0.0781)
  • z-ai/glm-5.3-flash: ok (0 finding(s), 17.1s, 24584+1879 tokens (13056 cached), 3 tool round(s), via Wafer, $0.0017)

Round 3 resolution

  • ✅ r2-1 fixed correctly — release-registry npmContext still accepts a CLI path reached through a symlinked ancestor directory: scripts/release-registry.mjs:npmContext now canonicalizes the CLI path exactly like resolveReleaseNpmCli in scripts/release-packages.mjs: const resolvedCli = resolve(cli); lstat(resolvedCli) checks isFile && !isSymbolicLink, plus (await realpath(resolvedCli)) !== resolvedCli fails. This catches a symlink leaf and a symlinked ancestor (resolve preserves the link component, realpath resolves it). Th…
  • Open findings after this round: 0 (0 bug-severity).

No structured findings from the successful lane(s).

Workflow run

Copy link
Copy Markdown
Contributor Author

r2-1 is fixed in c8ef14a. Publication and registry verification now require the CLI's resolved path to equal its canonical real path before any npm subprocess, matching preparation. New publish/verify tests use linked ancestor directories (Windows junctions where applicable) and prove rejection before any command or publication. The local release runner passed 128 cases apart from three Windows permission-only symlink skips; Linux CI must run all cases. This remains a path-validity check, with no claim of isolation from arbitrary concurrent runner compromise. Fresh current-head review, CI and security gates are running.

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: c8ef14af0e

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Copy link
Copy Markdown
Contributor Author

Current head c8ef14a passes both Node lanes (372 runtime + 128 release tests each, zero skipped), actual example/artifact/five-package protocol proof, both CodeQL checks, OpenRouter clean with zero open actionable ledger entries, and explicit Codex Security no-issues receipt 6710997171. Independent adversarial review is also clean.

No Copilot review or work-start event arrived during the bounded wait despite accepted REST and GraphQL review requests. That absence is recorded rather than treated as a completed review. Proceeding under the documented review-bot fallback with the completed OpenRouter/security/independent reviews; no required CI or security check is skipped or overridden.

@FlyOverCoderKY
FlyOverCoderKY merged commit 7f5eee6 into main Nov 7, 2026
5 checks passed
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