Spring AI's Redis cache needs a tenant boundary, not only a prompt hash

Spring AI applications that share a SemanticCacheAdvisor across end users can return one user's cached answer to another. CVE-2026-59417 describes a cache pool keyed only by the hash of the system prompt. That key does not separate users, sessions, or tenants, so similar questions can converge on the same stored response.

What the advisory confirms

The affected Spring AI ranges are 2.0.0 through 2.0.2, 1.1.0 through 1.1.9, and 1.0.0 through 1.0.10. The open-source fix is 2.0.3; Spring published enterprise-only fixes for the older branches. The advisory states that entries written through the advisor do not expire.

Two failure modes follow. A response containing one user's data may be served to another user. An attacker may also seed a response and have later users receive it. Both require the application to share the advisor in a way that permits reuse across trust boundaries.

The boundary must match the data

The fix makes applications provide a SemanticCacheScopeResolver. That resolver determines where a cached answer may be shared. A trusted source such as the authenticated principal can feed it. A request parameter, model-generated tenant name, or other user-controlled value should not.

Teams should decide whether the cache is per user, per tenant, or global only for content that contains no protected or personalized material. The decision belongs beside authorization logic because the cache becomes part of the response path. A cache hit bypasses the model call and every check that would have run inside it.

Remediation beyond the version bump

Upgrade to a fixed release and configure the new scope explicitly. Then invalidate entries created under the old key. Changing the resolver does not repair records that are already shared, and the advisory notes that advisor-written entries do not expire on their own.

Review the code path that constructs the advisor. Confirm that the resolver cannot receive a tenant identifier from an untrusted header or prompt. Also inspect logs and traces for cache hits that cross account or tenant identifiers. Avoid recording prompts or responses in those logs while investigating.

If an upgrade is delayed, do not use SemanticCacheAdvisor for applications that serve more than one end user or tenant. Disabling the shared cache is a temporary containment step and needs an explicit operational owner.

Verification checklist

  • Confirm the running Spring AI artifact is one of the fixed versions named by Spring.
  • Identify every advisor instance and the trust scope of its callers.
  • Verify the scope resolver derives identity from an authenticated and authoritative source.
  • Remove or invalidate old entries before traffic returns to the shared cache.
  • Add a test that asks the same semantic question under two identities and verifies separate cache keys.

References