Skip to main content

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

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

© 2023 VMware, Inc. or its affiliates. Terms of Use PrivacyTrademark Guidelines Your California Privacy Rights Cookie Settings

Apache®, Apache Tomcat®, Apache Kafka®, Apache Cassandra™, and Apache Geode™ are trademarks or registered trademarks of the Apache Software Foundation in the United States and/or other countries. Java™, Java™ SE, Java™ EE, and OpenJDK™ are trademarks of Oracle and/or its affiliates. Kubernetes® is a registered trademark of the Linux Foundation in the United States and other countries. Linux® is the registered trademark of Linus Torvalds in the United States and other countries. Windows® and Microsoft® Azure are registered trademarks of Microsoft Corporation. “AWS” and “Amazon Web Services” are trademarks or registered trademarks of Amazon.com Inc. or its affiliates. All other trademarks and copyrights are property of their respective owners and are only mentioned for informative purposes. Other names may be trademarks of their respective owners.