[security] Stop embedding token in push URL (use http.extraheader) #7

Merged
stephen merged 1 commit from fix/6-token-url-leak into main 2026-06-23 22:11:28 +00:00
Owner

Closes #6.

Why: the token was embedded in the push remote URL. setSecret masks the raw token but git stderr echoes the URL-encoded credential, which can leak into logs on a push failure.

  • Credential moved out of the URL into http.extraheader (Authorization: Basic) via GIT_CONFIG_* env, applied to push/fetch/ls-remote.
  • Defense-in-depth: setSecret the encodeURIComponent(token) form too.

Testing: tests/run.sh + new assertion that the remote URL carries no credential.

DO NOT MERGE: security-sensitive; lead/operator review.

Closes #6. Why: the token was embedded in the push remote URL. setSecret masks the raw token but git stderr echoes the URL-encoded credential, which can leak into logs on a push failure. - Credential moved out of the URL into `http.extraheader` (Authorization: Basic) via GIT_CONFIG_* env, applied to push/fetch/ls-remote. - Defense-in-depth: setSecret the encodeURIComponent(token) form too. Testing: tests/run.sh + new assertion that the remote URL carries no credential. DO NOT MERGE: security-sensitive; lead/operator review.
Avoid token-bearing git remote URLs
All checks were successful
test / unit (pull_request) Successful in 11s
e40dc2e935
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
rasterstate/create-pull-request-action!7
No description provided.