Skip to content

admin: fix origin allow-list host comparison to be case-insensitive - #7973

Merged
steadytao merged 2 commits into
masterfrom
fix-admin-origin-case-insensitive
Sep 2, 2026
Merged

steadytao merged 2 commits into
masterfrom
fix-admin-origin-case-insensitive

Conversation

@mohammed90

Copy link
Copy Markdown
Member

The admin origin allow-list compared origin.Host against the allowed URL's Host with byte-for-byte equality. url.Parse does not normalize host case, so an allowed http://Example.com:8080 rejected a client origin of http://example.com:8080 even though RFC 3986 §3.2.2 says host names are case-insensitive. Use strings.EqualFold.

Assistance Disclosure

Test was generated by copilot/Claude 4.7; fixed by the same.

Related to #7227

The admin origin allow-list compared origin.Host against the allowed
URL's Host with byte-for-byte equality. url.Parse does not normalize
host case, so an allowed 'http://Example.com:8080' rejected a client
origin of 'http://example.com:8080' even though RFC 3986 §3.2.2 says
host names are case-insensitive. Use strings.EqualFold.

Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
@mohammed90 mohammed90 added the bug 🐞 Something isn't working label Aug 30, 2026
@steadytao steadytao added this to the v2.11.5 milestone Sep 2, 2026

@steadytao steadytao left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@steadytao
steadytao merged commit af29f9e into master Sep 2, 2026
30 checks passed
@steadytao
steadytao deleted the fix-admin-origin-case-insensitive branch September 2, 2026 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 🐞 Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants