Repository navigation
Fix redaction of scheme-less and unparseable URI strings - #940
Merged
GrahamCampbell merged 1 commit intoNov 22, 2026
Merged
GrahamCampbell merged 1 commit into
GrahamCampbell merged 1 commit into
Conversation
GrahamCampbell
force-pushed
the
fix-redaction-of-scheme-less-and-unparseable-uri-strings-3.6
branch
from
November 22, 2026 00:02
a694060 to
7df7a16
Compare
GrahamCampbell
force-pushed
the
fix-redaction-of-scheme-less-and-unparseable-uri-strings-3.6
branch
from
November 22, 2026 00:48
7df7a16 to
6703953
Compare
GrahamCampbell
marked this pull request as ready for review
November 22, 2026 01:03
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.
UriRedactor::redactUserInfoInString()took the first://anywhere in a string for the end of the scheme and treated every string without one as authority-form. A reference without a scheme was therefore read wrongly: for//user:pass@host/path?next=http://example.com/the text after the later://was taken for the authority and nothing was redacted, and a relative reference such as/path?mail=user@example.comwas run through the fallback for input that does not parse and came out as***@example.com.redactUriStringForMessage()also kept whatever followed the last@of a URI that cannot be parsed, which is part of the query when the@sits there.A scheme is now only read before the first
/,?or#, a leading//starts the authority, and a reference that starts with?,#or a single/has no userinfo. Text before an@in such a reference, which the fallback used to redact, is now left as it is. When a URI cannot be parsed and its last@comes after the first?or#, the message keeps nothing after the redacted part, because that text may belong to the query or fragment.redactUserInfoInString()is unchanged for strings that start with a scheme and://.