Skip to content

Commit 63ec178

Browse files
committed
Fix security issue with GH token being added to repo URI
1 parent 9b66a98 commit 63ec178

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

ci/release_notes.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
### Improvements
2+
3+
- Don't add the Github token in the repo URL anymore, thanks @paulcwarren for raison the security concern, @beyhan for reaching out, and all CF community members that have participated to this bugfix!
4+
- Built with go v1.24.13 (latest 1.24 version), packaged in an image based on Alpine v3.23.3

git.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,14 @@ func (g *GitClient) GitCryptUnlock(base64key string) error {
226226
return nil
227227
}
228228

229-
// Endpoint takes an uri and produces an endpoint with the login information baked in.
229+
// Endpoint takes an URI and produces a endpoint that is verified to be
230+
// parsable. No login information needs to be baked in, because it is already
231+
// transmitted by the custom X_OAUTH_BASIC_TOKEN environment variable, and the
232+
// ad hoc askpass.sh script.
230233
func (g *GitClient) Endpoint(uri string) (string, error) {
231234
endpoint, err := url.Parse(uri)
232235
if err != nil {
233236
return "", fmt.Errorf("failed to parse commit url: %s", err)
234237
}
235-
endpoint.User = url.UserPassword("x-oauth-basic", g.AccessToken)
236238
return endpoint.String(), nil
237239
}

0 commit comments

Comments
 (0)