CVE-2021-22047 Exposure of Resource to Wrong Sphere in Spring Data REST

Medium 5.3 Published Updated

Custom controllers may expose resources under unintended URIs, potentially allowing unauthorized data access if Spring Security is not configured to block them.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2021-22047?

CVE-2021-22047 is a medium-severity missing authorization vulnerability in Spring Data REST, published on 28 Oct 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official 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.

Weakness: CWE-668, CWE-200

Which versions are affected by CVE-2021-22047?

4 open source packages ship an affected version, including org.springframework.data:spring-data-rest-core. It affects 1 product.

PackageAffectedFixed in
org.springframework.data:spring-data-rest-core MavenFrom 3.4.03.4.14
org.springframework.data:spring-data-rest-core MavenFrom 3.4.03.4.14
org.springframework.data:spring-data-rest-core MavenFrom 3.5.03.5.6
org.springframework.data:spring-data-rest-core MavenFrom 3.5.03.5.6

Products include Vmware Spring Data Rest.

How do I fix CVE-2021-22047?

Upgrade org.springframework.data:spring-data-rest-core to a fixed version for your release line: 3.4.14 or 3.5.6.

Upgrade, and check permissions on every request on the server, not only in the interface. More about Missing authorization.

Is CVE-2021-22047 being exploited?

There is no known exploitation of CVE-2021-22047 in the wild and no public exploit code.

Sources

Also known as GHSA-4926-qpxg-6r3w.

Is CVE-2021-22047 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free