MODERATE

CVE-2026-59377

Spring Data REST allows POST requests on association resources although save(…) is not exported

Description

Spring Data REST can be configured to make an aggregate read-only by excluding the repository's save(…) method from export, for example via @RestResource(exported = false). In that case, the PUT, PATCH and DELETE methods on the aggregate's association resources are correctly withheld.

However, the POST method on collection-like association resources is not subject to the same check.

An attacker can send a POST request with a text/uri-list body to such an association resource, for example /orders/42/items. Spring Data REST adds the referenced resources to the association and invokes the repository's save(…) method for the parent aggregate. This persists the new association links despite the read-only configuration.

The application is vulnerable if all of the following are true:

A repository that is exported over REST excludes its save(…) method from export, either explicitly or by disabling the export of repository methods by default without re-exporting save(…). The domain type declares a writable, collection-like association whose target type is exported through a repository as well. The attacker can reach the Spring Data REST endpoints. Whether that requires authentication depends on the application.

On affected applications the integrity of aggregates intended to be read-only can be compromised.

Affected Maven artifacts (1)

ArtifactAffected versionsFixed in
org.springframework.data » spring-data-rest-core
<= 3.7.21>= 4.0.0, <= 4.4.16>= 4.5.0, <= 4.5.14>= 5.0.0, < 5.0.9>= 5.1.0, < 5.1.3
5.0.9, 5.1.3

Blast radius

1affected artifacts
350affected versions
684dependent artifacts (est.)
39,388dependent versions

70% of the dependent artifacts (481) still pull an affected version in their latest release.

DepthDependent versions
Direct
491
2 hops
1,927
3 hops
11,757
4 hops
21,825
5 hops
2,940
6 hops
448

Most used dependents

Computed from the dependency graph of build 20261125.0317 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.