-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpClient] strengthen bearer validation #30561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
adc63ae
to
fabbac1
Compare
In my experience, when using bearer tokens and Guzzle I passed the token "as is". Will this change require us to do a manual It looks cumbersome and too low-level. Also, Basic authentication is base64-encoded when including it as a HTTP header, but we don't force users to do a I agree with Nico's main argument about potential security issues ... but we can instead throw an error when the token doesn't include "normal" characters. |
that's exactly what happens here. the RFC says that only some characters are allowed, so this is what the regexp checks, only that. |
@nicolas-grekas ah sorry! My confusion then is that the error message says that "this must be a base-64 encoded string" ... but that's "not true", at least not always. Maybe Kévin proposal is better? Thanks. |
fabbac1
to
e6e1620
Compare
This PR was merged into the 4.3-dev branch. Discussion ---------- [HttpClient] strengthen bearer validation | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - Better be sure CR/LF/etc cannot be passed inside raw header values, opening potential security risks. Commits ------- e6e1620 [HttpClient] strengthen bearer validation
Better be sure CR/LF/etc cannot be passed inside raw header values, opening potential security risks.