spring-projects / spring-projects/spring-security

regression: Spring Security 7 Filters interfere with Spring Web StandardMultipartHttpServletRequest

Open
#18,156 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-triage type: bug
Dominant language
Java
Stars
9.6k
Forks
6.3k
Avg merge
2d 11h
Merged PRs (30d)
52

Description

Describe the bug
When an authenticated user uploads a file larger than the configured spring.servlet.multipart.max-file-size then Spring Security returns 401.

To Reproduce

Clone the repo at https://github.com/filiphr/spring-security-boot-4-max-upload-size.
It has 2 folders:

  • boot-3 - Displaying the behavior with Spring Boot 3.5 and Spring Security 6.5
  • boot-4 - Displaying the same behavior with Spring Boot 4.0.0-RC2 and Spring Security 7.0.0-RC3

Expected behavior
The expected behavior is that an authenticated user uploading a file larger than the configured size returns 413.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Clone the linked reproducer and compare its boot-3 and boot-4 folders. First run the oversized authenticated upload case and confirm the difference between the expected 413 and observed 401 responses. Trace the Spring Security 7 filter handling around the multipart request; done means the boot-4 behavior matches the authenticated Spring Security 6.5 case.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
authentication, backend, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.