Skip to content
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

[8.x] Fix code locating Bearer token in InteractsWithInput #39150

Merged
merged 2 commits into from
Oct 8, 2021
Merged

[8.x] Fix code locating Bearer token in InteractsWithInput #39150

merged 2 commits into from
Oct 8, 2021

Conversation

adi64
Copy link
Contributor

@adi64 adi64 commented Oct 8, 2021

The code currently only looks for the Bearer string when locating the Bearer token. However, since the token is base64-encoded, it is possible that the encoded token can also contain the string Bearer which actually bit me once in tests.

The correct behavior is to look for the string Bearer with a trailing space. Spaces cannot be part of the token (see https://datatracker.ietf.org/doc/html/rfc6750#section-2.1).
The code already correctly splits the string after 7 characters, assuming that a trailing space is present.

This is a small fix for #38426 which introduced this regression. Before, the code checked the trailing space.

@GrahamCampbell GrahamCampbell changed the title Fix code locating Bearer token in InteractsWithInput [8.x] Fix code locating Bearer token in InteractsWithInput Oct 8, 2021
@taylorotwell taylorotwell merged commit 02bc7ad into laravel:8.x Oct 8, 2021
chu121su12 pushed a commit to chu121su12/framework that referenced this pull request Oct 9, 2021
…9150)

* Fix code locating Bearer token

* Update HttpRequestTest.php
victorvilella pushed a commit to cdsistemas/framework that referenced this pull request Oct 12, 2021
…9150)

* Fix code locating Bearer token

* Update HttpRequestTest.php
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.

3 participants