spring-projects / spring-projects/spring-framework
Ability to suppress "rejectedValue" in error responses [SPR-14771]
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 60.2k
- Forks
- 38.8k
- Avg merge
- 5d 2h
- Merged PRs (30d)
- 27
Description
James Howe opened SPR-14771 and commented
By default, validation errors on @Controller method parameters result in a response body detailing the specific FieldErrors.
Primarily for security purposes, it would be desirable to disable the echoing of the rejectedValue, both globally and perhaps with some kind of field annotation.
This would reduce the chance of sensitive data (passwords, PII, etc.) ending up in logs, for example.
I realise that the whole response can be fully customised anyway, but it seems like this sort of thing should be available by default, to help people secure their systems.
Issue Links:
- #18408 Addressing Mass Assignment vulnerabilities with
@NoBindannotation for domain objects - #21857 Quartz job bean can't have constructor with injected parameters
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how validation errors from @Controller method parameters become response bodies, focusing on FieldError and rejectedValue handling. Clarify whether suppression should be global, field-specific, or both, then define completion as preventing sensitive rejected values from appearing while preserving useful validation errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- api, backend, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100