Skip to content

Authentication is checked after Multipart fileupload stream is consumed by Jetty #17345

Closed
@a-sayyed

Description

@a-sayyed

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

2019-06-28_09h29_33

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: supersededAn issue that has been superseded by another

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions