Skip to content

Fix redaction of scheme-less and unparseable URI strings - #940

Merged
GrahamCampbell merged 1 commit into
3.6from
fix-redaction-of-scheme-less-and-unparseable-uri-strings-3.6
Nov 22, 2026
Merged

GrahamCampbell merged 1 commit into
3.6from
fix-redaction-of-scheme-less-and-unparseable-uri-strings-3.6

Conversation

@GrahamCampbell

@GrahamCampbell GrahamCampbell commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

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.com was 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 ://.

@GrahamCampbell
GrahamCampbell force-pushed the fix-redaction-of-scheme-less-and-unparseable-uri-strings-3.6 branch from a694060 to 7df7a16 Compare November 22, 2026 00:02
@GrahamCampbell
GrahamCampbell force-pushed the fix-redaction-of-scheme-less-and-unparseable-uri-strings-3.6 branch from 7df7a16 to 6703953 Compare November 22, 2026 00:48
@GrahamCampbell
GrahamCampbell marked this pull request as ready for review November 22, 2026 01:03
@GrahamCampbell
GrahamCampbell merged commit 0bfc046 into 3.6 Nov 22, 2026
40 checks passed
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