Get ahead
VMware offers training and certification to turbo-charge your progress.
Learn moreSpring 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:
save(…) method from export, either explicitly or by disabling the export of repository methods by default without re-exporting save(…).On affected applications the integrity of aggregates intended to be read-only can be compromised.
Spring Data REST:
| Fix version | Availability |
|---|---|
| 5.1.3 | OSS |
| 5.1.2.1 | Enterprise Support Only |
| 5.0.9 | OSS |
| 5.0.8.1 | Enterprise Support Only |
| 4.5.15 | Enterprise Support Only |
| 4.4.17 | Enterprise Support Only |
| 3.7.22 | Enterprise Support Only |
Users who cannot upgrade immediately can apply one of the following:
POST requests on association resources to trusted principals at the web security layer.@RestResource(exported = false).To report a security vulnerability for a project within the Spring portfolio, see the Security Policy