{"id":"CVE-2026-41695","aliases":["CVE-2026-41695","GHSA-88fw-v6x4-3f58"],"related":[],"kind":"vulnerability","state":"published","title":"Denial of Service in Spring Data Commons Property Path Resolution","summary":"Spring Data Commons applications may be vulnerable to denial of service through resource exhaustion when attacker-controlled property path strings are passed to MappingContext property path resolution.\n\nAffected versions:\nSpring Data Commons 4.0.0 through 4.0.5; 3.5.0 through 3.5.11; 3.4.0 through 3.4.14.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Spring Data Commons applications may be vulnerable to denial of service through resource exhaustion when attacker-controlled property path strings are passed to MappingContext property path resolution.\n\nAffected versions:\nSpring Data Commons 4.0.0 through 4.0.5; 3.5.0 through 3.5.11; 3.4.0 through 3.4.14.","source":"cvelist"},{"lang":"en","text":"`src/main/java/org/springframework/data/mapping/context/PersistentPropertyPathFactory.java:175` · Unbounded Resource Allocation (Algorithmic DoS)\n\n### Impact\n\nWhen a consuming module routes user-supplied dot-paths (sort parameters, projection paths, PATCH paths) through `MappingContext.getPersistentPropertyPath(String, Class)`, each distinct string — including invalid ones — is cached forever. A remote attacker can send millions of requests with unique `?sort=aaaa<n>` values and grow the heap until the service OOMs.\n\n### Description\n\n`PersistentPropertyPathFactory.propertyPaths` (line 53) is a `ConcurrentHashMap<TypeAndPath, PathResolution>` populated by `getPotentiallyCachedPath()` (line 174-177) via `computeIfAbsent`. The key is `(TypeInformation, rawPathString)`. Crucially, unresolvable paths are also cached (as `PathResolution.unresolved`, line 204) so that the same `InvalidPersistentPropertyPath` can be re-thrown — meaning every distinct garbage string an attacker sends creates a permanent entry. There is no eviction. This is reachable from `AbstractMappingContext.getPersistentPropertyPath(String, Class)` (`AbstractMappingContext.java:345`), which Spring Data REST and several store query mappers call with HTTP-request-derived sort/filter property names.\n\nBy contrast, the sibling `SimplePropertyPath.cache` was already hardened to use `ConcurrentReferenceHashMap` (soft refs); this cache was not given the same treatment.\n\n### Exploit scenario\n\nAgainst a Spring Data REST endpoint, an attacker scripts `GET /things?sort=<random-40-char-string>` in a loop. Each request fails fast with `InvalidPersistentPropertyPath`, but each distinct random string leaves behind a `TypeAndPath` key, a `PathResolution` object holding the split segments list, and the source string in the map. After ~10M requests the JVM OOMs.\n\n### Preconditions\n\n- A downstream component (Spring Data REST, a store-specific `QueryMapper`, or application code) passes externally-supplied strings to `MappingContext.getPersistentPropertyPath(String, ...)`\n- No upstream rate-limiting or path-string validation\n\n### How to fix\n\nA cache whose key can be derived from external input must be bounded. Replace `propertyPaths` (line 53) with a `ConcurrentLruCache<TypeAndPath, PathResolution>` of fixed capacity, or `ConcurrentReferenceHashMap` (matching the sibling `SimplePropertyPath.cache`). Additionally, do not cache `PathResolution.unresolved` results at all (line 204 in `createPersistentPropertyPath`) — re-computing a failed lookup is cheap, and caching negative results for arbitrary attacker strings is what makes this exploitable.\n\n### Adversarial verification\n\n**Verdict:** TRUE_POSITIVE (confidence: 7/10) — unbounded hard-ref `ConcurrentHashMap` keyed by raw path string, caches unresolved entries (line 204), reachable via public `MappingContext.getPersistentPropertyPath(String, ...)`; sibling `PropertyPath` cache was already converted to soft-refs but this one was missed. -3 confidence because the HTTP-input wiring lives in downstream modules (Spring Data REST / store mappers), not verifiable in this repo.\n\n**Code at the line — CONFIRMED**\n- Line 53: `private final Map<TypeAndPath, PathResolution> propertyPaths = new ConcurrentHashMap<>();` — plain CHM, hard refs, no eviction, no size bound.\n- Line 175: `propertyPaths.computeIfAbsent(TypeAndPath.of(type, propertyPath), ...)` — every distinct `(type, string)` pair is inserted.\n- Line 204: `return PathResolution.unresolved(parts, segment, type, currentPath);` — returned from inside `computeIfAbsent`'s mapping function, so unresolvable paths are cached. The `PathResolution` retains the full attacker string (`source = StringUtils.collectionToDelimitedString(parts, \".\")`, line 452).\n\n**Callers within spring-data-commons**\n- `AbstractMappingContext.getPersistentPropertyPath(String, Class<?>)` (line 345) and `(String, TypeInformation<?>)` (line 350) → `persistentPropertyPathFactory.from(type, propertyPath)` → straight into the unbounded cache. No validation, no `PropertyPath.from` gate.\n- This is the public `MappingContext` interface (`MappingContext.java:174,186`), documented to throw `InvalidPersistentPropertyPath` on bad input — i.e., the contract explicitly anticipates being called with possibly-invalid strings.\n- No in-repo caller routes HTTP input directly into the `String` overload. The `Sort.Order.property` → `getPersistentPropertyPath(String, ...)` bridge lives in store modules (Spring Data MongoDB `QueryMapper`, Spring Data REST sort translator). That wiring is out-of-repo as the finding states.\n\n**Protections — NONE on this cache**\nContrast: `SimplePropertyPath.java:52` (the `PropertyPath.from` cache) uses `ConcurrentReferenceHashMap` (soft refs, GC-evictable). Spring already hardened the sibling cache against exactly this pattern. `PersistentPropertyPathFactory.propertyPaths` was not given the same treatment.\n\n**Stress-test**\nIs this exclusion #3 (intended design)? The `PathResolution` javadoc (line 426-430) says caching unresolved paths is deliberate — to make repeated lookups of the *same* bad path cheap. But unbounded hard-ref caching of *arbitrary attacker-chosen* keys is not the intent; the sibling fix proves Spring considers this a bug class.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Aplicaciones Spring Data Commons pueden ser vulnerables a denegación de servicio a través de agotamiento de recursos cuando cadenas de ruta de propiedad controladas por el atacante se pasan a la resolución de rutas de propiedad de MappingContext.\n\nVersiones afectadas:\nSpring Data Commons 4.0.0 hasta 4.0.5; 3.5.0 hasta 3.5.11; 3.4.0 hasta 3.4.14.","source":"nvd"}],"published":"2026-06-09T23:47:33.927Z","modified":"2026-09-10T03:51:11.064Z","severity":{"scorer":"vmware","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"vmware","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"}],"cwes":["CWE-400"],"affected":[{"ranges":[{"type":"custom","introduced":"4.0.0","fixed":"4.0.5.1","status":"affected"},{"type":"custom","introduced":"3.5.0","fixed":"3.5.11.1","status":"affected"},{"type":"custom","introduced":"3.4.0","fixed":"3.4.15","status":"affected"}],"vendor":"Spring","product":"Spring Data Commons","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"4.0.0","status":"affected","fixed":"4.0.6"}],"ecosystem":"Maven","package":"org.springframework.data:spring-data-commons","purl":"pkg:maven/org.springframework.data/spring-data-commons","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"3.5.0","status":"affected","fixed":"3.5.12"}],"ecosystem":"Maven","package":"org.springframework.data:spring-data-commons","purl":"pkg:maven/org.springframework.data/spring-data-commons","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"3.4.0","status":"affected","lastAffected":"3.4.13"}],"ecosystem":"Maven","package":"org.springframework.data:spring-data-commons","purl":"pkg:maven/org.springframework.data/spring-data-commons","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"3.4.0","fixed":"3.4.15"},{"status":"affected","introduced":"3.5.0","fixed":"3.5.11.1"},{"status":"affected","introduced":"4.0.0","fixed":"4.0.5.1"}],"vendor":"broadcom","product":"spring_data_commons","cpe":"cpe:2.3:a:broadcom:spring_data_commons:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://spring.io/security/cve-2026-41695","tags":["vendor-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/spring-projects/security-advisories/security/advisories/GHSA-88fw-v6x4-3f58","tags":["web"],"sources":["ghsa"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-41695","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/spring-projects/spring-data-commons/commit/96e9475b963218bb702959524187342671f6b080","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/spring-projects/spring-data-commons/commit/a4f893b66c18c70f2b22f29a2b55097b73c89941","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/spring-projects/security-advisories","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/spring-projects/spring-data-commons/releases/tag/3.5.12","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/spring-projects/spring-data-commons/releases/tag/4.0.6","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"vmware","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-06-10T17:55:11.129Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-41695","url":"https://www.cve.org/CVERecord?id=CVE-2026-41695","licence":"CVE Terms of Use","modified":"2026-06-27T21:31:50.685Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-88fw-v6x4-3f58","url":"https://github.com/advisories/GHSA-88fw-v6x4-3f58","licence":"CC-BY-4.0","modified":"2026-09-10T03:51:11.064Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-41695","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-41695","licence":"Public domain","modified":"2026-07-23T09:10:00.113Z"}],"updatedAt":"2026-11-25T22:59:24.287Z","epss":{"score":0.00364,"percentile":0.32246,"date":"2026-12-01T12:00:22.000Z"}}