Executive brief
Spring AI is a Java framework for building AI-powered applications. The RedisChatMemoryRepository component, which stores and retrieves conversation history, fails to sanitize user-supplied metadata values before using them in RediSearch queries. An attacker who controls metadata passed to the findByMetadata() method can inject RediSearch syntax to break out of intended query constraints and access all chat messages in the entire system, potentially exposing sensitive conversations across multiple users.
Technical details
The vulnerability is a RediSearch query injection flaw in the findByMetadata() method of RedisChatMemoryRepository. The method constructs tag and text queries directly from caller-supplied metadata values without invoking RediSearchUtil.escape(), unlike other methods in the same class (get(), clear(), findByTimeRange()) that properly escape inputs. An attacker who provides user-controlled values to metadata parameters on tag-typed fields can inject RediSearch syntax operators (e.g., "x} | *") that escape the tag clause and match all indexed documents. The attack requires the ability to invoke findByMetadata() with attacker-controlled input, but does not require authentication or special privileges beyond application-level access. This allows unauthorized access to chat messages across all conversations in the Redis index.
Affected products
- Spring Spring AI 2.0.0
Timeline
- 2026-08-27: disclosed