Update dependency org.springframework.data:spring-data-commons to v3.5.0 [SECURITY] (main) - #64
Draft
renovatebot-confluentinc[bot] wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For any questions/concerns about this PR, please review the Renovate Bot wiki/FAQs, or the #renovatebot Slack channel.
This PR contains the following updates:
3.4.4→3.5.0Warning
Some dependencies could not be looked up. Check the warning logs for more information.
Spring Data: Unbounded property-path cache keyed by externally-supplied path string
CVE-2026-41695 / GHSA-88fw-v6x4-3f58
More information
Details
src/main/java/org/springframework/data/mapping/context/PersistentPropertyPathFactory.java:175· Unbounded Resource Allocation (Algorithmic DoS)Impact
When 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.Description
PersistentPropertyPathFactory.propertyPaths(line 53) is aConcurrentHashMap<TypeAndPath, PathResolution>populated bygetPotentiallyCachedPath()(line 174-177) viacomputeIfAbsent. The key is(TypeInformation, rawPathString). Crucially, unresolvable paths are also cached (asPathResolution.unresolved, line 204) so that the sameInvalidPersistentPropertyPathcan be re-thrown — meaning every distinct garbage string an attacker sends creates a permanent entry. There is no eviction. This is reachable fromAbstractMappingContext.getPersistentPropertyPath(String, Class)(AbstractMappingContext.java:345), which Spring Data REST and several store query mappers call with HTTP-request-derived sort/filter property names.By contrast, the sibling
SimplePropertyPath.cachewas already hardened to useConcurrentReferenceHashMap(soft refs); this cache was not given the same treatment.Exploit scenario
Against a Spring Data REST endpoint, an attacker scripts
GET /things?sort=<random-40-char-string>in a loop. Each request fails fast withInvalidPersistentPropertyPath, but each distinct random string leaves behind aTypeAndPathkey, aPathResolutionobject holding the split segments list, and the source string in the map. After ~10M requests the JVM OOMs.Preconditions
QueryMapper, or application code) passes externally-supplied strings toMappingContext.getPersistentPropertyPath(String, ...)How to fix
A cache whose key can be derived from external input must be bounded. Replace
propertyPaths(line 53) with aConcurrentLruCache<TypeAndPath, PathResolution>of fixed capacity, orConcurrentReferenceHashMap(matching the siblingSimplePropertyPath.cache). Additionally, do not cachePathResolution.unresolvedresults at all (line 204 increatePersistentPropertyPath) — re-computing a failed lookup is cheap, and caching negative results for arbitrary attacker strings is what makes this exploitable.Adversarial verification
Verdict: TRUE_POSITIVE (confidence: 7/10) — unbounded hard-ref
ConcurrentHashMapkeyed by raw path string, caches unresolved entries (line 204), reachable via publicMappingContext.getPersistentPropertyPath(String, ...); siblingPropertyPathcache 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.Code at the line — CONFIRMED
private final Map<TypeAndPath, PathResolution> propertyPaths = new ConcurrentHashMap<>();— plain CHM, hard refs, no eviction, no size bound.propertyPaths.computeIfAbsent(TypeAndPath.of(type, propertyPath), ...)— every distinct(type, string)pair is inserted.return PathResolution.unresolved(parts, segment, type, currentPath);— returned from insidecomputeIfAbsent's mapping function, so unresolvable paths are cached. ThePathResolutionretains the full attacker string (source = StringUtils.collectionToDelimitedString(parts, "."), line 452).Callers within spring-data-commons
AbstractMappingContext.getPersistentPropertyPath(String, Class<?>)(line 345) and(String, TypeInformation<?>)(line 350) →persistentPropertyPathFactory.from(type, propertyPath)→ straight into the unbounded cache. No validation, noPropertyPath.fromgate.MappingContextinterface (MappingContext.java:174,186), documented to throwInvalidPersistentPropertyPathon bad input — i.e., the contract explicitly anticipates being called with possibly-invalid strings.Stringoverload. TheSort.Order.property→getPersistentPropertyPath(String, ...)bridge lives in store modules (Spring Data MongoDBQueryMapper, Spring Data REST sort translator). That wiring is out-of-repo as the finding states.Protections — NONE on this cache
Contrast:
SimplePropertyPath.java:52(thePropertyPath.fromcache) usesConcurrentReferenceHashMap(soft refs, GC-evictable). Spring already hardened the sibling cache against exactly this pattern.PersistentPropertyPathFactory.propertyPathswas not given the same treatment.Stress-test
Is this exclusion #3 (intended design)? The
PathResolutionjavadoc (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.Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:HReferences
This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR has been generated by Mend Renovate.