Skip to content

fix(ci): stop persisting a write-scoped git credential through npm ci - #55

Open
wyre-agent-fleet[bot] wants to merge 1 commit into
mainfrom
fix/cwe-250-persist-credentials
Open

wyre-agent-fleet[bot] wants to merge 1 commit into
mainfrom
fix/cwe-250-persist-credentials

Conversation

@wyre-agent-fleet

@wyre-agent-fleet wyre-agent-fleet Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Stops persisting a write-scoped git credential through npm ci (CWE-250).

The release job declares contents: write, which overrides this repo's
read-only default workflow permission — so actions/checkout's default
persisted credential was write-scoped and stayed live in .git/config
through dependency install, build and test, readable by any compromised
dependency lifecycle script during that window. persist-credentials: false
is semantic-release's own documented GitHub Actions recipe: it authenticates
its own pushes from GITHUB_TOKEN directly and never needed the persisted
credential.

Part of a pattern-set fix across WYRE-AI/node-*. Originally found and
fixed on 4 repos (node-spanning#46, node-domotz#48,
node-kaseya-quote-manager#16, node-alternative-payments#20), then a
propagation scope-check found the same pattern on 18 more repos. Full set
(18, this repo included) so reviewers can see membership:

node-axcient, node-blumira, node-clio, node-connectwise-cpq, node-datto-bcdr, node-datto-saas-protection, node-huntress, node-iqms, node-kaseya-bms, node-kaseya-vsa, node-mailprotector, node-mimecast, node-ncentral, node-proofpoint-essentials, node-rootly, node-scalepad, node-threatlocker, node-unitrends

Generated by warden's Gate-3 CWE-250 review, per boss's set-completeness ruling.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Summary by CodeRabbit

  • Documentation
    • Added an Unreleased changelog entry documenting updated release credential handling.
  • Chores
    • Improved release workflow security by preventing checkout credentials from being persisted locally while preserving automated release authentication.

The release job declares `contents: write`, which overrides this repo's
read-only default workflow permission, so actions/checkout's default
persisted credential was write-scoped and stayed live in .git/config through
npm ci / build / test -- readable by any compromised dependency lifecycle
script. persist-credentials: false is semantic-release's own documented
recipe; it authenticates its pushes from GITHUB_TOKEN directly.

Part of the CWE-250 pattern-set fix across WYRE-AI/node-*. Sibling PRs:
node-spanning#46, node-domotz#48, node-kaseya-quote-manager#16,
node-alternative-payments#20 (already merged/merging), plus this repo and
17 others in the same follow-up set.
@coderabbitai

coderabbitai Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: e5d09262-8c3d-4896-8a6b-ad17b3b81c2a

📥 Commits

Reviewing files that changed from the base of the PR and between e142432 and 5995464.

📒 Files selected for processing (2)
  • .github/workflows/release.yml
  • CHANGELOG.md

Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The release workflow disables persisted checkout credentials during dependency installation. semantic-release continues to authenticate pushes with GITHUB_TOKEN. The changelog documents this change.

Changes

Release credential handling

Layer / File(s) Summary
Workflow credential handling
.github/workflows/release.yml, CHANGELOG.md
The checkout step sets persist-credentials: false. The changelog records that semantic-release uses GITHUB_TOKEN for pushes.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: asachs01

Merge Risk: ⚪ Minimal · up to 59954

The release workflow retains authentication for publishing and pushes while reducing token exposure during dependency installation.

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: preventing the write-scoped Git credential from persisting during npm ci.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Changelog Entry ✅ Passed PASS. The authoritative PR diff adds a ### Changed entry beneath ## [Unreleased] in the root CHANGELOG.md. The other change is limited to the CI release workflow, which also independently qualif…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/cwe-250-persist-credentials
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch fix/cwe-250-persist-credentials

Comment @coderabbitai help to get the list of available commands.

@wyre-agent-fleet

Copy link
Copy Markdown
Author

Peer review (comment-only, per the shared-identity self-approval gate).

Verdict: approve, no blockers.

Verified independently against the actual diff content (not just warden's filing summary), as part of the 18-PR CWE-250 follow-up set-review:

  • release.yml: adds persist-credentials: false to the release job's actions/checkout step, with the same explanatory comment across all 18 PRs (CWE-250: the release job's contents: write permission makes checkout's default persisted credential write-scoped and live in .git/config through npm ci; persist-credentials: false is semantic-release's own documented recipe since it authenticates pushes via GITHUB_TOKEN directly). The core fix content is byte-identical across the batch -- raw diff size varies only where a repo's pre-existing checkout step used a different YAML style (inline vs multi-line map).
  • CHANGELOG.md: entry added under this repo's existing Unreleased section, correct per this repo's own convention.
  • No unrelated files touched -- scope is clean.

Full batch (all independently verified): node-axcient#2, node-blumira#41, node-clio#2, node-connectwise-cpq#2, node-datto-bcdr#55, node-datto-saas-protection#55, node-huntress#43, node-iqms#39, node-kaseya-bms#48, node-kaseya-vsa#50, node-mailprotector#2, node-mimecast#44, node-ncentral#4, node-proofpoint-essentials#1, node-rootly#27, node-scalepad#2, node-threatlocker#31, node-unitrends#51

@asachs01 asachs01 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review

Verdict: Approve

Verified the diff fixes the described issue: the release job declares contents: write (overriding the repo default read-only workflow permission), so the actions/checkout step's default persisted git credential was write-scoped and remained on disk in .git/config through npm ci, build, and test — readable by any compromised dependency lifecycle script (CWE-250).

Checklist:

  • Correctness: persist-credentials: false is added to the correct checkout step, in the job with elevated contents: write permission. This is the documented semantic-release recipe — it authenticates pushes via GITHUB_TOKEN directly and never needed the persisted credential, so no regression to the release flow.
  • Security: This is exactly the fix for the flagged CWE-250 exposure window. No new secrets/credentials introduced, no injection surface added.
  • Code quality: Change is minimal, well-commented inline explaining the why, consistent with the sibling fixes across the WYRE-AI/node-* set.
  • Tests: N/A — CI workflow config change; no test coverage expected/needed for this.
  • Docs/changelog: CHANGELOG entry added under Unreleased accurately describes the fix and references CWE-250. Accurate and consistent with the code change.

No regressions or gaps found. Approving.

@asachs01

Copy link
Copy Markdown
Contributor

Code Review Summary — Claude Code

Verdict: Approve

Critical

None

Warnings

None

Suggestions

None

Looks Good

  • Correct fix: adds persist-credentials: false to the actions/checkout step in the release job, preventing the write-scoped git credential (from the job's contents: write permission) from staying in .git/config through npm ci, build, and test.
  • Matches semantic-release's own documented recommendation — semantic-release authenticates its pushes via GITHUB_TOKEN directly, so the persisted credential was never needed.
  • Minimal, targeted diff (workflow + changelog only), no unrelated changes.
  • Inline comment in the workflow clearly explains the CWE-250 rationale for future maintainers.
  • CHANGELOG entry accurately documents the change.
  • Consistent with the same fix already applied and presumably reviewed on other WYRE-AI/node-* repos.

@asachs01 asachs01 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed by Claude Code. Adds persist-credentials: false to the release job's checkout step so the write-scoped credential (from contents: write) no longer lingers in .git/config during npm ci/build; semantic-release still authenticates pushes via GITHUB_TOKEN directly, so no functionality is lost. Safe, minimal, well-documented fix.

@asachs01

Copy link
Copy Markdown
Contributor

Code Review Summary (Reviewed by Hermes Agent)

Critical: None.

Warnings: None.

Suggestions:

  • Correct, minimal fix: adds persist-credentials: false to the release job's actions/checkout step. This job declares contents: write (overriding the repo's read-only default), so without this flag the write-scoped token would have stayed live in .git/config through npm ci/build — readable by any compromised dependency lifecycle script (CWE-250).
  • Confirmed semantic-release still authenticates its own push/API calls via GITHUB_TOKEN passed directly in the Release step's env, so removing the persisted credential does not break the release flow.
  • No new leak introduced: nothing in the diff writes the token to a log, file, or artifact.

Looks Good: Sound, well-scoped credential-hardening fix.

@asachs01

Copy link
Copy Markdown
Contributor

Reviewed against the verified fleet-wide fix pattern: this diff adds persist-credentials: false to the actions/checkout step in .github/workflows/release.yml (with matching CHANGELOG entry), preventing the write-scoped git credential from persisting through npm ci in the release job (CWE-250). semantic-release authenticates its own pushes via GITHUB_TOKEN directly, so this credential was unnecessary and its removal introduces no functional regression. Matches the pattern confirmed in WYRE-AI/node-unitrends#51. Approved.

Reviewed by Hermes Agent

@asachs01

Copy link
Copy Markdown
Contributor

Review — headRefOid 5995464988e11fbda3a7bcd8a2fec93f423bbc4f

Minimal, well-scoped CI fix. Adds persist-credentials: false to the release job's actions/checkout step (which currently runs with an inherited contents: write-scoped credential live in .git/config through npm ci/build/test), plus a matching CHANGELOG entry. This matches the semantic-release documented pattern (auth via GITHUB_TOKEN directly, no persisted credential needed) and closes a real CWE-250 exposure window where a compromised dependency lifecycle script could read a write-scoped token off disk.

Critical: None.

Warnings: None. The change is additive/config-only and doesn't touch runtime code paths.

Suggestions:

  • Confirm semantic-release's push step still authenticates correctly post-change (CI run on this PR should confirm; also confirmed already by CodeRabbit's approval + prior propagation to the other 17 sibling repos).
  • No functional/unit tests apply here since this is CI-workflow-only; that's appropriate for this change.

Looks Good:

  • Correct root-cause diagnosis (implicit contents: write overriding default read-only permissions).
  • Rationale is clearly documented inline and in the changelog.
  • Consistent with the same fix already applied/reviewed across 17 other WYRE-AI node-* repos.

Verdict: Comment only — looks correct and low-risk; deferring to CODEOWNERS/CI to confirm the release job still runs green before merge.

@asachs01 asachs01 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review Summary

Verdict: Approve

Correctness

Adds persist-credentials: false to the actions/checkout step in the release workflow. This is correct: the release job declares contents: write, which overrides the repo's read-only default GITHUB_TOKEN permission, so the checkout step's persisted credential was write-scoped and stayed live in .git/config for the whole job (dependency install, build, test) — readable by any compromised dependency lifecycle script (CWE-250). persist-credentials: false is semantic-release's own documented recipe; semantic-release authenticates its own push via GITHUB_TOKEN directly, so no functional regression is expected.

Security

This is the security fix — closes a credential-exposure window. No new secrets or credentials introduced. Scope is minimal (workflow file + changelog only).

Code Quality

Change is small, well-commented inline explaining the why, and consistent with the sibling fixes already merged in node-spanning#46 / node-domotz#48 / node-kaseya-quote-manager#16 / node-alternative-payments#20.

Tests

No test coverage for CI workflow YAML is expected/typical; nothing to add here. Recommend confirming the next automated release run on main still succeeds (semantic-release push, tag, npm publish) since that's the one behavior this touches at runtime.

Documentation

CHANGELOG.md entry accurately describes the change and rationale. Good.

Looks Good

  • Root cause explanation is precise and matches GitHub Actions' documented permission-override behavior for job-level contents: write.
  • No unrelated changes bundled in.

Reviewed SHA: 5995464

@asachs01

Copy link
Copy Markdown
Contributor

Claude Code Review

Verdict: Approve

Critical

None.

Warnings

None.

Suggestions

  • None beyond the shared nit about comment verbosity — not blocking.

Looks Good

  • Adds persist-credentials: false to the release job's actions/checkout step, correctly closing the CWE-250 exposure window (write-scoped credential from contents: write staying live in .git/config through npm ci/build/test).
  • semantic-release authenticates pushes via GITHUB_TOKEN directly, so disabling credential persistence does not affect the release job's ability to publish.
  • CHANGELOG.md updated consistently and accurately under Unreleased/Changed.
  • Tightly scoped diff — no functional/business logic touched, no secrets, no unrelated changes.

@asachs01 asachs01 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hermes Agent Review

Verdict: Approve

Correct, minimal fix for CWE-250 (write-scoped git credential left live in .git/config through npm ci). persist-credentials: false is the documented semantic-release recipe since it authenticates its own pushes via GITHUB_TOKEN — no functional regression, changelog entry included, scoped to the affected job only.

Looks Good

  • Fix is correctly scoped (only the release job, which is the one declaring contents: write)
  • Rationale comment inline explains the CWE and why persist-credentials: false is safe here
  • Changelog entry present

No blocking issues.


Reviewed by Hermes Agent

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.

1 participant