Skip to content

fix(release): use inline http.extraheader instead of git remote set-url - #84

Merged
asachs01 merged 2 commits into
mainfrom
fix/http-extraheader
Sep 4, 2026
Merged

fix(release): use inline http.extraheader instead of git remote set-url#84
asachs01 merged 2 commits into
mainfrom
fix/http-extraheader

Conversation

@asachs01

@asachs01 asachs01 commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Second security follow-up (CWE-522) -- set-url wrote the token to .git/config. task_1788457898992.


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

CodeRabbit catch (CWE-522) on the retrofit's rollout to the other repos:
set-url writes the token into .git/config, readable by any later
process in the job. Authenticate each git network call individually
via -c http.extraheader instead -- nothing persists to disk.
task_1788457898992.
@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 6 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: ae2a80bc-617c-4b6c-9a30-afe1412ccdcd

📥 Commits

Reviewing files that changed from the base of the PR and between abcabc2 and d572f9e.

📒 Files selected for processing (1)
  • .github/workflows/release.yml

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

GitHub auto-masks GITHUB_TOKEN itself but not derived/transformed
values like its base64 encoding -- a stray verbose/trace output could
otherwise print the header in a public workflow log. ::add-mask:: right
after computing it, before any git command uses it, at all 3 call
sites.
@asachs01

asachs01 commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator Author

Reviewed the full diff directly. Confirmed all 3 sites correctly: fetch (env GITHUB_TOKEN, already present), tag push (added a new env block since that step had none before -- correct, it needs GITHUB_TOKEN now), release/next push (uses a distinct PUSH_TOKEN rather than the step's GITHUB_TOKEN, which is correctly claimed by the App token for the gh pr calls in that same step -- important catch on your end, since the App token is scoped to contents:read only and would have failed a push if reused here). Masking is registered before first use at all 3 sites, matches GitHub's documented pattern for a derived/computed secret value (the raw token's auto-masking wouldn't cover the base64-transformed header string on its own). base64 construction (printf without trailing newline, tr -d '\n' to strip base64's own line-wrapping) is correct and you already validated it against the real API. No issues found.

One thing worth knowing rather than assuming: CodeRabbit's check on this PR shows "Review rate limited" -- it did NOT actually perform a substantive automated review this round (same repo/topic reviewed too many times today, presumably). So this LGTM is from my manual read alone, not double-covered by CodeRabbit this time -- worth being aware of when this same diff propagates to the retrofits, in case CodeRabbit picks back up there and finds something neither of us caught here.

LGTM to merge #84. Go ahead with the live verification, then the retrofits/remaining-3.

@asachs01
asachs01 merged commit aa5c4e4 into main Sep 4, 2026
3 checks passed
@asachs01
asachs01 deleted the fix/http-extraheader branch September 4, 2026 00:47
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