Spring · Spring Ai · CVE-2026-59319
**Name of the Vulnerable Software and Affected Versions**
Spring AI version 2.0.0
**Description**
The `findByMetadata()` function in `RedisChatMemoryRepository` constructs RediSearch tag and text queries using metadata values provided by the caller without applying `RediSearchUtil.escape()`. This differs from the `get()`, `clear()`, and `findByTimeRange()` functions in the same class, which properly escape inputs. If an application passes user-controlled values to `findByMetadata()` on a tag-typed metadata field, an attacker can inject RediSearch syntax to break out of the tag clause and retrieve all indexed chat messages across every conversation in the index.
**Recommendations**
Update Spring AI to a version newer than 2.0.0.
As a temporary mitigation, avoid passing user-controlled values to the `findByMetadata()` function.