Skip to content

reject control characters in bearer token in BearerScheme - #863

Merged
ok2c merged 1 commit into
apache:masterfrom
dxbjavid:bearer-token-control-chars
Jul 28, 2026
Merged

reject control characters in bearer token in BearerScheme#863
ok2c merged 1 commit into
apache:masterfrom
dxbjavid:bearer-token-control-chars

Conversation

@dxbjavid

Copy link
Copy Markdown
Contributor

BearerScheme writes the token straight into the Authorization header, and unlike BasicScheme it never checks the credential for control characters. A bearer token carrying CR/LF is neutralised by the HTTP/1.1 line formatter, which replaces those bytes with spaces, but the HTTP/2 request converter passes header values through unchanged, so over h2 such a token can inject extra header material into the request. This applies the same control-character guard BasicScheme already uses, rejecting the token before the header is built.

@ok2c
ok2c merged commit 23a70f9 into apache:master Jul 28, 2026
16 of 17 checks passed
@dxbjavid

Copy link
Copy Markdown
Contributor Author

TY!

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.

2 participants