spring-framework icon indicating copy to clipboard operation
spring-framework copied to clipboard

Support magic-bytes/file extension validation for multipart requests

Open zakaria-shahen opened this issue 1 month ago • 0 comments

It would be great if Spring support magic-bytes validation for FilePart or Part, so I could specify allowed file extensions per endpoint (perhaps depending on Apache Tika to handle this).

Also, I see spring.servlet.multipart.max-file-size and spring.webflux.multipart.max-disk-usage-per-part exists, but unfortunately it's not customizable per endpoint. It would be great if Spring could support that in some way.

Lastly, it would be great if by default Spring disallowed all file extensions when Spring Security exists in the classpath for better secure default configuration.

Thanks :)

zakaria-shahen avatar Oct 15 '25 23:10 zakaria-shahen