-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
StringIndexOutOfBoundsException on OAuth2AuthMechanism #42591
Comments
I think we should also check that the string starts with ´Bearer ´. Probably case insensitively. Because atm, we are somehow implying it which is a bad idea. |
From what I can see here, we can be case sensitive: https://datatracker.ietf.org/doc/html/rfc6750#section-2.1 |
#42595 should address it. Thanks for the very detailed report. |
vsevel
pushed a commit
to vsevel/quarkus
that referenced
this issue
Aug 19, 2024
gsmet
added a commit
to gsmet/quarkus
that referenced
this issue
Aug 19, 2024
Fixes quarkusio#42591 (cherry picked from commit 51834c5)
gsmet
added a commit
to gsmet/quarkus
that referenced
this issue
Aug 20, 2024
Fixes quarkusio#42591 (cherry picked from commit 51834c5)
danielsoro
pushed a commit
to danielsoro/quarkus
that referenced
this issue
Sep 20, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
I'm seeing a
StringIndexOutOfBoundsException
when the Authorization header is not validExpected behavior
It should return an invalid header
Actual behavior
throwing
StringIndexOutOfBoundsException
How to Reproduce?
We have an application deployed and we get the usual random worldpress requests trying to access our system, most of the requests don't cause any issues but from time to time we get a 500, the last time we saw the 500 error we noticed this error message on our logs
java.lang.StringIndexOutOfBoundsException: begin 7, end 6, length 6
. Looking at the entire error log we noticed that the error was being thrown insideelytron-security-oauth2
more specifically in here.What is causing this error is the fact that the "malicious" user is not setting the Bearer token correctly. When the user sends an empty
Bearer
the code throws an error.Output of
uname -a
orver
No response
Output of
java -version
21
Quarkus version or git rev
3.14.2
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
The error is caused by the string size not being checked before the substring method is called.
Potential solution
The text was updated successfully, but these errors were encountered: