-
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
Adding leadings slashes bypass security #35785
Comments
/cc @sberyozkin (security) |
I'm not sure what can be done with blocking the extra slashes, the simple expression expects the very first path segment start with @michalvavrik I wonder, instead of supporting only wildcards, may be we can introduce a convention, similar to what is used for CORS, if users want a given path be treated as a regex, then it should be surrounded by |
@will421 You can probably request the security for |
Path matching is performance sensitive feature, I'm still not finished, but ATM I believe what I'm doing won't have impact on performance (also thanks to your suggestion to only support path segments So no regex :-) |
Thanks, not the most practical when adding public /* endpoints but it works. @sberyozkin Is it expected behavior for the path resolution to ignore empty leading slashes ? I can't find informations on this or if it can be disabled. |
Ah, I just assumed this is different issue so I didn't read description. So FYI this is duplicated and we should close it as such #13756. @will421 no, this needs to be fixed or well documented, thanks for reporting and you certainly have a point. Please feel free to reopen in case you disagree. I suggest that you subscribe for the other issue. In general, and probably not very practical either, you can implement your own global HTTP policy |
I think we need to discuss this more carefully. It's definitely not my expectation that, as a user, I have to handle the /cc @cescoffier @geoand |
I agree with this and I already gave it a lot of thought as I'm changing path matching for different issue. It's not like I propose to stale this, I am going to propose solution for #13756 relatively soon. |
Yeah, so I agree it's the same issue. What triggered me to reopen was this sentence: I don't think this needs to be well documented. It needs to be fixed and we also need to talk about if it's necessary to open a CVE. And the old issue if from 2020, that's definitely a bummer. Will your solution be backportable? My understanding is that you are also tackling a different problem that might make it harder to backport? |
good point, it wouldn't be, okay, let's do this first |
@michalvavrik So we choose to migrate to Quarkus 3 and use the management interface. This way we manage the security of /q/* path ( denying everying and adding needed exclusions ) without messing with our applications endpoints. |
Glad it worked out @will421 . There is going to be fix, just hold a short while. As of |
This has been fixed in 2.16.11.Final, 3.2.6.Final and 3.3.3. |
Looks like a typo here, seems to have been fixed in 2.16.11.Final https://github.com/quarkusio/quarkus/releases/tag/2.16.11.Final |
Indeed, that's what Guillaume meant |
Yeah, sorry, last week has been hard, I fixed the comment :/ |
Describe the bug
Hi,
I'm trying to secure every /q/* path with basic auth. Configuration :
It's working.
But when I add leadings slashes to my requests like
curl 'http://localhost:8080//q/openapi'
, it will access the endpoint.I can add more leadings slashes, it will still access the endpoint.
Expected behavior
I expect calls like
//q/openapi, //q/health/ready or custom resources like //q/hello to return 404 or 401 because of security policy
Actual behavior
Calls //q/... return the value expected by /q/...
How to Reproduce?
mvn quarkus:dev
curl 'http://localhost:8080//q/openapi'
orcurl 'http://localhost:8080//q/health/ready'
orcurl 'http://localhost:8080//q/hello'
Output of
uname -a
orver
MINGW64_NT-10.0-19045 PC3747 3.4.7-ea781829.x86_64 2023-07-05 12:05 UTC x86_64 Msys
Output of
java -version
openjdk version "17.0.1" 2021-10-19
OpenJDK Runtime Environment Temurin-17.0.1+12 (build 17.0.1+12)
OpenJDK 64-Bit Server VM Temurin-17.0.1+12 (build 17.0.1+12, mixed mode, sharing)
Quarkus version or git rev
2.16.10 (reproduced in 3.3.2)
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.3 (ff8e977a158738155dc465c6a97ffaf31982d739)
Maven home: D:\Programs\maven
Java version: 17.0.1, vendor: Eclipse Adoptium, runtime: D:\Programs\jdk\jdk-17.0.1+12
Default locale: fr_FR, platform encoding: UTF-8
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
Additional information
No response
The text was updated successfully, but these errors were encountered: