-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
HttpURI considers %25 to be ambiguous, preventing access to static resources with % in their name #7160
Comments
@wilkinsona This was done as a protection against things like double URI decoding vulnerabilities. You will need to configure your You can use one of the following compliance modes; There is a setting in connector.getConnectionFactory(HttpConnectionFactory.class)
.getHttpConfiguration()
.setUriCompliance(UriCompliance.LEGACY); |
Isn't the protection over-zealous in this case as there's no double encoding involved? How can one access static resources with |
@wilkinsona It might be over-zealous to be rejecting ambiguous path encodings by default. The double decoding vulnerability was reported against @gregw what do you think about the default |
I'm inclined to relax double encoding check in 10 & 11 by default. We don't protect for this in 9, and with servlet6 there is a much better definition of what we should be doing, so it will be better fixed in jetty-12, so let's not be special in jetty-10 & jetty-11. i.e let's go with the flow and act the same as the other containers. |
Signed-off-by: Lachlan Roberts <[email protected]>
…tUri Issue #7160 - Add AMBIGUOUS_PATH_ENCODING to default UriCompliance mode.
Jetty version(s)
11.0.7
Java version/vendor
(use: java -version)
openjdk version "17" 2021-09-14
OpenJDK Runtime Environment Temurin-17+35 (build 17+35)
OpenJDK 64-Bit Server VM Temurin-17+35 (build 17+35, mixed mode, sharing
OS type/version
macOS
Description
This is a follow on from the discussion in #4033. With Jetty 11.0.7, a static resource with a
%
in its filename cannot be accessed due toHttpURI
considering it to be ambiguous:https://github.com/eclipse/jetty.project/blob/0c6acfc1a2f7889e577c9a565aff2f4fa32d855c/jetty-http/src/main/java/org/eclipse/jetty/http/HttpURI.java#L1210-L1212
I have a (rather extreme) test that tries to load static resources from a jar. This jar contains an entry named
META-INF/resources/nested-reserved-!#\$%&()*+,:=?@[]-meta-inf-resource.txt
and the test tries to access it using the URL/nested-reserved-%21%23%24%25%26%28%29%2A%2B%2C%3A%3D%3F%40%5B%5D-meta-inf-resource.txt
. This works with Jetty 9.4.x but fails with 11.0.7. I haven't tried 10.0.x. FWIW, it also works with Tomcat 9 and 10 and Undertow 2.2How to reproduce?
Hopefully the above is sufficient. I can try to extract the test from Spring Boot's build into something standalone if that would be useful.
The text was updated successfully, but these errors were encountered: