Skip to content

ci(anchor-drift): stop persisting credentials on all six checkout steps (CWE-522) - #55

Merged
hyperpolymath merged 2 commits into
mainfrom
fix/anchor-drift-persist-credentials
Sep 9, 2026
Merged

ci(anchor-drift): stop persisting credentials on all six checkout steps (CWE-522)#55
hyperpolymath merged 2 commits into
mainfrom
fix/anchor-drift-persist-credentials

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Closes #53.

What this fixes

.github/workflows/anchor-drift.yml has six actions/checkout steps and, on
main, zero persist-credentials settings — so all six fall back to the
action's default of true, leaving the job token in .git/config for every
subsequent step (CWE-522).

No job in this workflow pushes or otherwise uses the token, and it runs on
pull_request executing repository-controlled code, so the persisted credential
is exposure with no upside.

Why it wasn't fixed in #52

This exact commit (6a5d1a7) was written as part of PR #52 but rejected at push
time
, because the acting token then lacked the workflow OAuth scope:

! [remote rejected] (refusing to allow an OAuth App to create or update workflow
  '.github/workflows/anchor-drift.yml' without 'workflow' scope)

That rejection fails the whole push if any single commit touches a workflow
path, so the validator commit landed while this one did not — which is why #52
looked complete and was merged around the gap. The scope has since been granted,
so it is cherry-picked here onto current main.

Verification

Checked semantically by parsing the YAML rather than grepping, so a comment or a
near-miss key cannot pass:

YAML parses OK; checkout steps = 6 ; steps still persisting = []

Before, on main: 6 checkout steps, 0 persist-credentials lines.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QNjWX2B4FffG7zqMBMui6v

The workflow triggers on pull_request and every job runs repository-controlled
code (scripts/, conformance/, validate-a2ml.sh from the PR ref). checkout
leaves the token in .git/config by default, so that code runs beside a usable
credential.

No job in this workflow pushes, commits, or reads GITHUB_TOKEN/secrets — the
grep is empty — so persistence buys nothing and is pure exposure. Applied to
all six checkouts rather than only the one flagged: it is the same defect at
each, and leaving five would just be five findings waiting to be filed.

Job permissions were already minimal at the top level (actions: read,
contents: read) and are left as they are.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QNjWX2B4FffG7zqMBMui6v
@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 24 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: a507481f-15dc-46f5-bf5e-0cf2e14441da

📥 Commits

Reviewing files that changed from the base of the PR and between 7b7b379 and 3b378e1.

📒 Files selected for processing (1)
  • .github/workflows/anchor-drift.yml

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@hyperpolymath
hyperpolymath enabled auto-merge (squash) September 9, 2026 09:14
@hyperpolymath
hyperpolymath merged commit f7a40a4 into main Sep 9, 2026
10 of 11 checks passed
@hyperpolymath
hyperpolymath deleted the fix/anchor-drift-persist-credentials branch September 9, 2026 09:14
@sonarqubecloud

sonarqubecloud Bot commented Sep 9, 2026

Copy link
Copy Markdown

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.

CWE-522: anchor-drift.yml persists credentials on all six checkout steps (fix in PR #55)

1 participant