Repository navigation
Strip a bare https backup token when the URL does not start at the scheme - #261
Merged
Merged
Conversation
…heme. credentials() treated every byte before :// as the scheme, so a leading space or newline left a colon-free token in the pushed config and in shown locations. http(s) now uses the same trailing scheme token as redacted(). Finding: backup.https-bare-userinfo.scheme-prefix Co-authored-by: Saeed <smarzban@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Oct 22, 2026
smarzban
marked this pull request as ready for review
October 22, 2026 11:57
…rl-scheme # Conflicts: # CHANGELOG.md
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Finding
backup.https-bare-userinfo.scheme-prefix.credentials()insrc/backup.rstreated every byte before://as the scheme. A leading space or newline made that string fail the exacthttp/httpstest. A colon-free userinfo then returnedNone, sowithout_credentialsleft the token in place.sanitized_configwrote it into the backed-upconfig.toml, and the backup push published it.shown_locationprinted the same token.redacted()already masked it, because that scan uses only the trailing ASCII scheme token.httpandhttpsare now that shared trailing token. The raw prefix is still returned, so a leading space stays in the reconstructed URL and a non-ASCII scheme such asé://still reconstructs. An ssh URL with a bare user name is unchanged.Test plan
cargo fmt --checkcargo clippy --lib --tests -- -D warningscargo test --lib backup::tests::(46 passed, includinga_prefixed_bare_https_token_is_not_pushed)a_prefixed_bare_https_token_is_not_pushedfailed:without_credentialsreturnedNoneforhttps://dummy-token@example.test/repo.git. Restored the hunk; the test passed.cargo clippy --all-targets -- -D warningsand fullcargo testwere not runcd site && npm ci && npm test && npm run build(site unchanged)