Fix non-ASCII characters in headers being rejected (#5377)#5699
Open
Eruis2579 wants to merge 1 commit intoStirling-Tools:mainfrom
Open
Fix non-ASCII characters in headers being rejected (#5377)#5699Eruis2579 wants to merge 1 commit intoStirling-Tools:mainfrom
Eruis2579 wants to merge 1 commit intoStirling-Tools:mainfrom
Conversation
- Add HttpFirewall bean to allow non-ASCII characters in header values - Configure StrictHttpFirewall to accept valid UTF-8 encoded header values - Fixes issue where Remote-User header with non-ASCII characters (e.g., "Dvořák") was rejected with 400 Bad Request even when authentication is disabled - Also allow non-ASCII characters in parameter values for consistency Fixes Stirling-Tools#5377
f6744d9 to
dc69c7d
Compare
Member
|
/deploypr |
Contributor
🚀 PR Test DeploymentYour PR has been deployed for testing! 🔗 Test URL: http://98.89.26.138:5699 This deployment will be automatically cleaned up when the PR is closed. |
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.
Description
Fixes #5377
This PR fixes an issue where HTTP headers containing non-ASCII characters (e.g., "Dvořák" in the
Remote-Userheader) were rejected with a 400 Bad Request error, even when authentication was disabled.Problem
Spring Security's default
StrictHttpFirewallrejects header values containing non-ASCII characters. This causes issues when reverse proxies (like Authelia) set headers with international usernames containing non-ASCII characters.Solution
HttpFirewallbean that allows non-ASCII characters in header valuesStrictHttpFirewallto accept valid UTF-8 encoded header valuesChanges
httpFirewall()bean method that configuresStrictHttpFirewallto allow non-ASCII charactersTesting
Headers with non-ASCII characters (e.g.,
Remote-User: Dvořák) should now be accepted instead of returning 400 Bad Request.Security
The fix maintains security by validating that header values are valid UTF-8 encoded strings, preventing malformed or malicious input.