-
Notifications
You must be signed in to change notification settings - Fork 41.1k
Authentication is checked after Multipart fileupload stream is consumed by Jetty #17345
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
Comments
Thanks for the sample. The behaviour that you have observed is due to the auto-configured The hidden HTTP method filter can be disabled by setting Please open a Spring Security issue for the second part of the problem. Hopefully it's possible for the I'll leave this issue open so that we can consider what to do about HTTP method filters role in the problem. We can certainly update the documentation to highlight the effect that it is. I wonder if we should also consider no longer enabling it by default. |
This is somewhat related to #16953 in sense that both issues describe problematic behavior caused by
I also believe that |
@wilkinsona @vpavic Thank you for your help trying to track down this issue. I have created the Spring Security issue as suggested. |
Currently when you make a
POST
request for a file upload on a secure endpoint, the Underlying Jetty Server consumes the whole file first then passes the request to Spring security. This means that security is checked after the file is already uploaded.To replicate this issue, you can clone the demo repository I have created and simply upload a file to the endpoint
/upload
with no authentication, you can see in the logs that the inputstream from the file is getting consumed by Jetty before the request is checked for Authentication.The
spring.servlet.multipart.resolve-lazily
property is also not respected.For testing, (on a linux machine), you can create a random file with the command
head -c 256MB /dev/urandom > randomFile.txt
If you would like to try the request out with authentication, the credentials are
admin:admin
The text was updated successfully, but these errors were encountered: