Skip to content

ci: drop persisted Git credentials in actions/checkout (Aikido) - #622

Closed
dorothyyzh wants to merge 1 commit into
masterfrom
fix/aikido-persist-credentials-2026-07-27
Closed

ci: drop persisted Git credentials in actions/checkout (Aikido)#622
dorothyyzh wants to merge 1 commit into
masterfrom
fix/aikido-persist-credentials-2026-07-27

Conversation

@dorothyyzh

Copy link
Copy Markdown
Contributor

Summary

Aikido flags actions/checkout for leaving the job token in .git/config (http.extraheader) after checkout, where any later step — including third-party actions — can read it. This repo accounts for 4 of the 10 sub-issues in that group.

Added persist-credentials: false to all four workflows.

No-op for three of them — they run no git operations after checkout:

  • go.ymlgo build / go test
  • vuetifyjs-test.ymlpnpm install / build / test:unit
  • doc-build.ymlpeaceiris/actions-gh-pages authenticates via its own github_token input, not the ambient credential

vuetifyjs-build.yml needed a real change. It pushes the rebuilt dist bundle back to the PR branch, so the push is now authenticated explicitly through a token URL instead of relying on the credential checkout used to leave behind:

-  git push origin HEAD:${{ github.head_ref }}
+  git push "https://x-access-token:${GITHUB_TOKEN}@github.com/${REPOSITORY}.git" "HEAD:${HEAD_REF}"

While rewriting that line I also moved github.head_ref into the environment. Interpolating ${{ github.head_ref }} straight into a run: block is a script-injection vector — a branch name containing shell metacharacters executes in the job. Passing it via env: makes it inert data.

Aikido Issues Resolved

Group 33607621 — 4 sub-issues in this repo:

Verification

  • All four workflow files parse as valid YAML
  • No source changes — dist/ is untouched, so no bundle rebuild is needed here
  • The vuetifyjs-build push path is only exercised when the built dist actually differs; reviewers wanting to confirm it should watch the first PR after merge that changes ui/vuetifyx/vuetifyxjs sources

Note

Branch is fix/aikido-persist-credentials-2026-07-27 rather than the usual dated name — fix/aikido-dependency-vulnerabilities-2026-07-27 is already taken by #621.

Aikido flags actions/checkout leaving the job token in .git/config
(http.extraheader), where any later step — including third-party actions —
can read it. Added persist-credentials: false to all four workflows.

go.yml, vuetifyjs-test.yml and doc-build.yml run no git operations after
checkout (doc-build's peaceiris/actions-gh-pages authenticates via its own
github_token input), so this is a no-op for them.

vuetifyjs-build.yml does push the rebuilt dist bundle, so its push is now
authenticated explicitly through the token URL instead of relying on the
credential checkout used to leave behind. While rewriting that line, moved
github.head_ref into the environment as well — interpolating it directly
into the shell is a script-injection vector via crafted branch names.
@dorothyyzh

Copy link
Copy Markdown
Contributor Author

Superseded by #624 — same commits replayed on a fresh branch off the current default branch (fix/aikido-2026-08-06). The explicit-token push in vuetifyjs-build.yml is carried over unchanged. Verified with the doctor-lint check GH_CHECKOUT_CREDENTIALS_PERSISTED and re-parsed with a real YAML parser.

@dorothyyzh dorothyyzh closed this Aug 6, 2026
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