Spring Security Advisories

CVE-2021-22047: Potential Security Bypass for customized Spring Data REST Resource

MEDIUM | OCTOBER 26, 2021 | CVE-2021-22047

Description

In Spring Data REST versions 3.4.0 - 3.4.13, 3.5.0 - 3.5.5, and older unsupported versions, HTTP resources implemented by custom controllers using a configured base API path and a controller type-level request mapping are additionally exposed under URIs that can potentially be exposed for unauthorized access depending on the Spring Security configuration. The vulnerability only applies to projects for which all the following points are true:

  • The project uses Spring Data REST in one of the versions declared vulnerable above.
  • The Spring Data REST base path configuration is set to a non-empty string.
  • The project registers a custom Spring MVC controller to customize HTTP resources in the URI space of Spring Data REST and that controller uses a type-level @RequestMapping annotation;the project only secures the paths exposed by Spring Data REST within the base path but does not apply security measures to URIs matching the mappings without the configured base path prepended.

Affected Spring Products and Versions

  • Spring Data REST
    • 3.4.0 to 3.4.13
    • 3.5.0 to 3.5.5
    • Older, unsupported versions are also affected

Mitigation

Users of affected versions should upgrade to one of the versions below. No other steps are necessary.

  • Spring Data REST
    • 3.4.14+ (included in Spring Boot 2.4.12+)
    • 3.5.6+ (included in Spring Boot 2.5.6+)

Credit

This vulnerability was initially discovered and responsibly reported by Brian Schrader.

History

  • 2021-10-26: Initial vulnerability report published.

Get ahead

VMware offers training and certification to turbo-charge your progress.

Learn more

Get support

Tanzu Spring Runtime offers support and binaries for OpenJDK™, Spring, and Apache Tomcat® in one simple subscription.

Learn more

Upcoming events

Check out all the upcoming events in the Spring community.

View all