Spring Data REST CVE-2026-47849: JSON Patch and id/version
Spring Data REST does not guard @Id and @Version against JSON Patch. Check your version, which entities carry those properties, and if a fix can be downloaded.
This is CVE-2026-47849 (2026-08-20, High), a flaw where Spring Data REST does not guard @Id and @Version properties against JSON Patch requests. Per the advisory, the PUT and merge-patch paths skip these properties but the JSON Patch path does not, so an authenticated client with PATCH access can overwrite them, defeat optimistic locking, or overwrite another principal's record.
[1] Read the spring-data-rest-* version you use. With a build tool, print the dependency tree.
$ ./mvnw dependency:tree -Dincludes=org.springframework.data$ ./gradlew dependencies --configuration runtimeClasspath | grep spring-data-restFor a built executable jar, look at the file names inside. The result below is from a test app.jar that holds spring-data-rest-webmvc-5.0.6.jar under BOOT-INF/lib.
$ unzip -l app.jar | grep -E 'spring-(security|data|ai)' | awk '{print $4}'BOOT-INF/lib/spring-data-rest-webmvc-5.0.6.jarA single jar also records its version in the manifest.
$ unzip -p spring-data-rest-webmvc-5.0.6.jar META-INF/MANIFEST.MF | grep -E 'Implementation-(Title|Version)'Implementation-Title: Spring Data REST - WebMVCImplementation-Version: 5.0.6[2] Match against the advisory's affected and fixed versions.
| Line | Affected | Fixed | Open source? |
|---|---|---|---|
| 5.1 | 5.1.0 | 5.1.1 | Open source |
| 5.0 | 5.0.0 to 5.0.6 | 5.0.7 | Open source |
| 4.5 | 4.5.0 to 4.5.12 | 4.5.13 | Enterprise Support Only |
| 4.4 | 4.0.0 to 4.4.15 | 4.4.16 | Enterprise Support Only |
| 3.7 | 3.7.20 and earlier | 3.7.21 | Enterprise Support Only |
For 5.1.0 and 5.0.6 the Enterprise side also has separate fixes, 5.1.0.1 and 5.0.6.1. The 5.0.6 from step 1 is an affected version.
[3] Check that a fixed version can be downloaded from the public repository. Maven Central answers 200 when the jar exists and 404 when it does not.
$ for v in 5.0.6 5.0.7 4.5.12 4.5.13 4.4.13 4.4.14; do echo "$v $(curl -s -o /dev/null -w '%{http_code}' -I https://repo.maven.apache.org/maven2/org/springframework/data/spring-data-rest-webmvc/$v/spring-data-rest-webmvc-$v.jar)"; done5.0.6 2005.0.7 2004.5.12 2004.5.13 2004.4.13 2004.4.14 4045.0.7 is published, so the 5.x lines can be fixed with open source. Line 4.4 stops at 4.4.13 in the public repository, so 4.4.14 and 4.4.15 (listed as affected) and the fix 4.4.16 cannot be downloaded from it.
[4] With Spring Boot, look at the version Boot manages. The dependency versions table in the Boot 4.1.2 docs sets spring-data-rest-core and spring-data-rest-webmvc to 5.1.2, so that Boot release is at or above the fixed 5.1.1. For other Boot versions, check appendix/dependency-versions in that version's docs.
[5] If you are on an affected version, list which entities have @Id and @Version. The advisory's condition is an exposed Spring Data REST repository whose entity has an identifier or version property visible to Jackson's deserialization, meaning a public setter and no explicit @JsonIgnore. The result below is the same search over two test entities. Order has no marking on either property, and Invoice has @JsonIgnore.
$ grep -rn -A2 -E "@(Id|Version)\b" src/main/javasrc/main/java/com/example/shop/Order.java:8: @Id @GeneratedValuesrc/main/java/com/example/shop/Order.java-9- private Long id;src/main/java/com/example/shop/Order.java-10-src/main/java/com/example/shop/Order.java:11: @Versionsrc/main/java/com/example/shop/Order.java-12- private Long version;src/main/java/com/example/shop/Order.java-13---src/main/java/com/example/shop/Invoice.java:8: @Id @GeneratedValuesrc/main/java/com/example/shop/Invoice.java-9- @JsonIgnoresrc/main/java/com/example/shop/Invoice.java-10- private Long id;--src/main/java/com/example/shop/Invoice.java:12: @Versionsrc/main/java/com/example/shop/Invoice.java-13- @JsonIgnoresrc/main/java/com/example/shop/Invoice.java-14- private Long version;Use this list to decide which repositories to review first.
Look for setters too. In the same test files, Order has public setters for both properties and Invoice has none.
$ grep -rnE "public .* set(Id|Version)\(" src/main/javasrc/main/java/com/example/shop/Order.java:17: public void setId(Long id) { this.id = id; }src/main/java/com/example/shop/Order.java:19: public void setVersion(Long version) { this.version = version; }A property with a public setter and no @JsonIgnore (both properties of Order) meets the advisory's condition. This search sees only field annotations and setter names, so it misses inherited classes, Lombok-generated setters and class-level Jackson settings. Do not read an empty result as not affected; on an affected version, upgrade regardless of annotations. Whether such a property escapes the condition was not tested with a real app.
[6] List which repositories are exposed over REST too. Spring Data REST publishes repository interfaces as endpoints, so find the interfaces and check who can call PATCH on them, together with your security configuration. This search cannot confirm exposure; also check the exposure strategy setting and exclusions such as @RepositoryRestResource(exported = false).
$ grep -rnE "RepositoryRestResource|interface \w+ extends \w*Repository" src/main/java[7] After changing versions, run step 1 again and confirm the version is at or above the fixed one in the step 2 table. The advisory says no further mitigation steps exist, so the upgrade is the only action.
Where the check goes wrong
- A fixed version number in the advisory does not mean you can download it. The advisory lists only 5.1.1 and 5.0.7 as open source (5.1.1 was not part of this Maven Central lookup). 4.4.16 and the like are on the Enterprise side.
- In this lookup, Maven Central listed 4.5.13, while the advisory marks 4.5.13 as Enterprise Support Only. Which build that number holds was not confirmed, so for line 4 follow the advisory's wording and check the file that actually arrives in your own repository.
- The
@JsonIgnoreand setter searches only narrow the advisory's condition. They miss properties configured elsewhere, so on an affected version upgrade regardless of the result.