{"slug": "spring-ai-typesense-filter-injection-fixed-in-2-0-3-cve-2026-59415", "title": "Spring AI Typesense Filter Injection, Fixed in 2.0.3 (CVE-2026-59415)", "summary": "Spring disclosed on 2026-11-19 that Spring AI releases before 2.0.3 and 2.1.0 contain CVE-2026-59415, a Typesense filter injection in which TypesenseVectorStore.doDelete(List<String>) concatenates unvalidated document identifiers into a Typesense filter_by clause, letting crafted identifiers delete arbitrary records or wipe the collection. The CVE record scores the flaw 10.0 Critical while Spring scores it 8.1 High; versions 1.0.0 through 1.0.10, 1.1.0 through 1.1.9, 2.0.0 through 2.0.2 and the 2.1.0 pre-releases are affected, and two companion filter bugs, CVE-2026-59369 and CVE-2026-59442, were fixed at the same time. Spring AI 2.0.3 and 2.1.0 carry commit c27dac074d to fix the issues, with 1.0.11, 1.1.10 and 2.0.2.1 available only under Enterprise Support; no exploitation is known and the CVE is not in CISA KEV as of 2026-11-24.", "body_md": "[Deep Dive](https://blog.ostorlab.co/category/deep-dive.html)\n\n# Spring AI Typesense Filter Injection, Fixed in 2.0.3 (CVE-2026-59415)\n\nSpring AI before 2.0.3 and 2.1.0 lets untrusted document IDs and filter values alter Typesense queries to delete or expose records; fixed in 2.0.3 and 2.1.0.\n\n## TL;DR\n\n- `TypesenseVectorStore.doDelete(List<String>)` concatenates document identifiers into a Typesense`filter_by` clause without validation and lets crafted identifiers delete arbitrary records or wipe the collection.[Spring](https://spring.io/security/cve-2026-59415) disclosed the flaw on 2026-11-19.\n- Spring AI 1.0.0 through 1.0.10 and 1.1.0 through 1.1.9 are affected alongside 2.0.0 through 2.0.2 and the 2.1.0 pre-releases. Two companion filter bugs in the same module were fixed simultaneously.\n- The Common Vulnerabilities and Exposures (CVE) record scores CVE-2026-59415 at 10.0 Critical while Spring scores it at 8.1 High. No exploitation is known and the CVE is not in CISA KEV as of 2026-11-24.\n- Upgrade to [Spring AI 2.0.3](https://github.com/spring-projects/spring-ai/releases/tag/v2.0.3) or[2.1.0](https://github.com/spring-projects/spring-ai/releases/tag/v2.1.0) to apply commit[c27dac074d](https://github.com/spring-projects/spring-ai/commit/c27dac074dca878fab424a2828f0c398374d8331) . See \"How do I fix it?\" for workarounds and commercial branch options.\n\n## Am I affected?\n\nAn application is affected when it uses an unpatched `spring-ai-typesense-store` artifact and passes untrusted document identifiers or filter inputs into Typesense vector store operations. All of these conditions must hold for an application to be exposed to CVE-2026-59415:\n\n- The application resolves `org.springframework.ai:spring-ai-typesense-store` at version 1.0.0 through 1.0.10 or 1.1.0 through 1.1.9, or at version 2.0.0 through 2.0.2 or 2.1.0-M1 through 2.1.0-RC2.\n- The application configures a `TypesenseVectorStore` bean directly or through`org.springframework.ai:spring-ai-starter-vector-store-typesense` .\n- An endpoint or background job passes externally supplied or user-controlled document identifiers to `VectorStore.delete(List<String>)` or`TypesenseVectorStore.doDelete(List<String>)` .\n- The caller does not restrict each identifier to safe characters before calling the vector store.\n\nApplications that only generate document identifiers internally with Universally Unique Identifier (UUID) values and never accept an identifier to delete from outside input are not exposed to CVE-2026-59415. However, the same `spring-ai-typesense-store` releases also carry two companion flaws in `TypesenseFilterExpressionConverter` that affect similarity search and filter-based deletion.\n\nThe first companion is [CVE-2026-59369](https://spring.io/security/cve-2026-59369). `TypesenseFilterExpressionConverter.doSingleValue` serializes filter values as double-quoted JSON strings. Because Typesense uses backticks to delimit string literals in `filter_by`, an untrusted value passed into `SearchRequest.filterExpression(...)` or `VectorStore.delete(Filter.Expression)` can inject `||` or `&&` clauses.\n\nThe second companion is [CVE-2026-59442](https://spring.io/security/cve-2026-59442) (tracked as [GHSA-34gj-fj65-637x](https://github.com/advisories/GHSA-34gj-fj65-637x)). `TypesenseFilterExpressionConverter.doGroup` omits parentheses around grouped expressions. Because Typesense evaluates `&&` and `||` with equal precedence from left to right, a grouped filter loses its boundary and matches documents across tenants.\n\n| Branch | Affected versions | Fixed version | \n|---|---|---|\n| Spring AI 2.1.x | 2.1.0-M1 through 2.1.0-RC2 | 2.1.0 (open source on Maven Central) | \n| Spring AI 2.0.x | 2.0.0 through 2.0.2 | 2.0.3 (open source on Maven Central) or 2.0.2.1 (Enterprise Support Only) | \n| Spring AI 1.1.x | 1.1.0 through 1.1.9 | 1.1.10 (Enterprise Support Only) | \n| Spring AI 1.0.x | 1.0.0 through 1.0.10 | 1.0.11 (Enterprise Support Only) | \n\nThe table lists all 4 release branches. Two branches (`2.1.x` and `2.0.x`) have open-source fixed releases on Maven Central (` 2.1.0` and `2.0.3` published on 2026-11-19). The other two branches (`1.1.x` and `1.0.x`) have fixes only through commercial VMware Tanzu Spring Enterprise Support (`1.1.10` and `1.0.11` alongside `2.0.2.1`). Their public Maven Central artifacts stop at `1.1.8` and `1.0.9`.\n\nThe [CVE-2026-59415 record](https://www.cve.org/CVERecord?id=CVE-2026-59415) (published by the VMware CVE Numbering Authority on 2026-11-24) scores CVE-2026-59415 at Common Vulnerability Scoring System (CVSS) v3.1 10.0 Critical (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H`). Both the National Vulnerability Database (NVD) and GitHub Security Advisory (GHSA) entry [GHSA-hr93-6g2r-m7rp](https://github.com/advisories/GHSA-hr93-6g2r-m7rp) carry that same 10.0 Critical vector.\n\nThe Spring advisory page labels CVE-2026-59415 High under Common Weakness Enumeration (CWE) identifier CWE-917 and links the NVD calculator for `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H` (base score 8.1 High). Both CVE-2026-59369 (CWE-943) and CVE-2026-59442 (CWE-783) carry a CVSS v3.1 base score of 7.5 High (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N`).\n\nSpring AI is the official AI engineering framework in the Spring portfolio with 9,682 stars and 3,089 forks on [GitHub](https://github.com/spring-projects/spring-ai) as of 2026-11-24. The underlying `typesense/typesense` container image has 35,097,946 pulls on [Docker Hub](https://hub.docker.com/r/typesense/typesense) and 27,168 stars on [GitHub](https://github.com/typesense/typesense).\n\nCheck the resolved version of the Typesense store artifact in a Maven project:\n\n```\nmvn dependency:tree -Dincludes=org.springframework.ai:spring-ai-typesense-store,org.springframework.ai:spring-ai-starter-vector-store-typesense\n```\n\nCheck the resolved version in a Gradle project:\n\n```\n./gradlew dependencyInsight --dependency spring-ai-typesense-store --configuration runtimeClasspath\n```\n\nCheck the packaged JAR inside a built artifact or a running container:\n\n```\nunzip -l target/*.jar | grep \"spring-ai-typesense-store\"\ndocker exec <container_name> sh -c 'ls -1 /app/BOOT-INF/lib/spring-ai-typesense-store*.jar 2>/dev/null || find / -name \"spring-ai-typesense-store*.jar\" 2>/dev/null'\n```\n\nFind where the application calls `delete` or builds filter expressions on a `VectorStore` or `TypesenseVectorStore`:\n\n```\ngrep -rnE \"TypesenseVectorStore|VectorStore\" src/main/\ngrep -rnE \"\\.(delete|doDelete|filterExpression)\\(\" src/main/\n```\n\nIf the resolved version is earlier than `2.0.3` (or is a `2.1.0` milestone or release candidate) and any call site passes user-controlled identifiers or filter values, the deployment is affected.\n\n## How do I fix it?\n\nUpgrade Spring AI to `2.0.3` or `2.1.0` to pick up all three Typesense fixes from Maven Central. The [CVE-2026-59415 advisory](https://spring.io/security/cve-2026-59415) is fixed by commit [c27dac074d](https://github.com/spring-projects/spring-ai/commit/c27dac074dca878fab424a2828f0c398374d8331). [CVE-2026-59369](https://spring.io/security/cve-2026-59369) is fixed by commit [5937bd2580](https://github.com/spring-projects/spring-ai/commit/5937bd2580cf4b26006aa574512b57652a7f85ad) and [CVE-2026-59442](https://spring.io/security/cve-2026-59442) is fixed by commit [4d13734413](https://github.com/spring-projects/spring-ai/commit/4d1373441388862addabcdf830f9e93994e8e735).\n\n1. Update the `spring-ai-bom` version in Maven`pom.xml` to`2.0.3` or`2.1.0` :\n\n```\n<dependencyManagement>\n  <dependencies>\n    <dependency>\n      <groupId>org.springframework.ai</groupId>\n      <artifactId>spring-ai-bom</artifactId>\n      <version>2.0.3</version>\n      <type>pom</type>\n      <scope>import</scope>\n    </dependency>\n  </dependencies>\n</dependencyManagement>\n```\n\n1. If the project declares `spring-ai-typesense-store` or`spring-ai-starter-vector-store-typesense` without the Bill of Materials (BOM), set the version explicitly in Maven or Gradle:\n\n```\ndependencies {\n    implementation platform(\"org.springframework.ai:spring-ai-bom:2.0.3\")\n    implementation \"org.springframework.ai:spring-ai-starter-vector-store-typesense\"\n}\n```\n\n1. \nFor applications on `1.0.x` or`1.1.x` , migrate to`2.0.3` or`2.1.0` or pull`1.0.11` or`1.1.10` from the commercial[Spring Enterprise Support](https://enterprise.spring.io/) repository. The Spring Boot starter artifact was renamed from`spring-ai-typesense-store-spring-boot-starter` in early`1.0.0` milestones to`spring-ai-starter-vector-store-typesense` from`1.0.0-M7` onward.\n2. \nRebuild the archive and recreate running containers. Pulling an image does not update a running container's classpath:\n\n```\nmvn clean package -DskipTests\ndocker build -t my-spring-ai-app:2.0.3 .\ndocker stop my-spring-ai-app\ndocker rm my-spring-ai-app\ndocker run -d --name my-spring-ai-app -p 8080:8080 my-spring-ai-app:2.0.3\n```\n\nBefore deploying `2.0.3` or `2.1.0`, check your application for three intentional behavior changes introduced by the fixes:\n\n- Document identifiers passed to `delete(List<String>)` may contain only letters and digits or the symbols`- _ . : / @` . Leading or trailing whitespace and standard Base64`+` or`=` characters now throw`IllegalArgumentException` .\n- Metadata filter values containing a literal backtick (`` ` `` ) now throw` IllegalArgumentException` at conversion time.\n- `java.util.Date` filter values are now emitted as epoch milliseconds rather than quoted ISO-8601 strings to match the numeric timestamp stored by the Typesense client.\n\nIf you cannot upgrade yet, apply these workarounds for the operations your code exposes:\n\n1. To mitigate CVE-2026-59415 before calling `VectorStore.delete(List<String>)` , validate every document ID against the`2.0.3` character allowlist and reject any non-matching ID:\n\n``` python\nimport java.util.List;\nimport java.util.regex.Pattern;\n\npublic final class TypesenseIdGuard {\n    private static final Pattern SAFE_TYPESENSE_ID =\n            Pattern.compile(\"^[\\\\p{L}\\\\p{Nd}\\\\-_.:/@]+$\");\n\n    public static List<String> requireSafeIds(List<String> ids) {\n        if (ids == null) {\n            throw new IllegalArgumentException(\"Document id list must not be null\");\n        }\n        for (String id : ids) {\n            if (id == null || !SAFE_TYPESENSE_ID.matcher(id).matches()) {\n                throw new IllegalArgumentException(\"Disallowed Typesense document ID: \" + id);\n            }\n        }\n        return ids;\n    }\n}\n```\n\n1. \nTo mitigate CVE-2026-59369 on unpatched releases, do not pass untrusted strings into `SearchRequest.filterExpression(...)` or`VectorStore.delete(Filter.Expression)` . Restrict caller-selected filter values to an allowlist of alphanumeric tokens with no spaces or punctuation.\n2. \nTo mitigate CVE-2026-59442 on unpatched releases, do not use `Filter.Group` or parenthesized`||` expressions inside a`Filter.Expression` that enforces tenant boundaries. Keep each tenant in a dedicated Typesense collection or issue a Typesense Scoped Search API key with an embedded`filter_by` constraint.\n\nThe check in step 1 closes only CVE-2026-59415 and does not protect metadata filter conversion. Upgrading to `2.0.3` or `2.1.0` is the only fix that repairs `TypesenseFilterExpressionConverter`.\n\n## What is the root cause?\n\n**`TypesenseVectorStore.doDelete(List<String>)` builds a Typesense `filter_by` query by joining caller-supplied document identifiers with commas inside `id: [...]` without character validation.** In the same module, `TypesenseFilterExpressionConverter` quotes filter values with JSON double quotes instead of backticks and drops parentheses around logical groups.\n\n`TypesenseVectorStore` implements Spring AI's `VectorStore` interface against Typesense. Because Typesense deletes multiple documents through a filter query (`DeleteDocumentsParameters.filterBy(...)`), `TypesenseVectorStore` translates both ID-list deletions and `Filter.Expression` trees into Typesense's `filter_by` string grammar.\n\nIn Spring AI `1.0.0` the `doDelete(List<String>)` method built the filter as `id:=[id1,id2]`. On 2026-04-30 commit [0146f25c5ccb](https://github.com/spring-projects/spring-ai/commit/0146f25c5ccbcb927c664b8886bc100be6f0de25) escaped user-supplied IDs in `MilvusVectorStore.doDelete(List<String>)`. That commit changed `TypesenseVectorStore.doDelete(List<String>)` to `id: [...]` and noted that raw string joining was safe because Typesense document IDs use URL-safe characters.\n\nHere is the vulnerable `doDelete(List<String>)` in `vector-stores/spring-ai-typesense-store/src/main/java/org/springframework/ai/vectorstore/typesense/TypesenseVectorStore.java` at tag `v2.0.2`, lines 174 to 197:\n\n```\n    @Override\n    public void doDelete(List<String> idList) {\n        DeleteDocumentsParameters deleteDocumentsParameters = new DeleteDocumentsParameters();\n        // Typesense filter_by for the id field expects bare string values, not quoted\n        // literals — e.g. id: [id1,id2]. Typesense document IDs are restricted to\n        // URL-safe characters (no commas, brackets, or quotes), so raw string joining\n        // is safe here. The operator is `: ` (not `:=`) per the Typesense recommendation\n        // for multi-value id filters.\n        deleteDocumentsParameters.filterBy(DOC_ID_FIELD_NAME + \": [\" + String.join(\",\", idList) + \"]\");\n\n        try {\n            int deletedDocs = (Integer) this.client.collections(this.collectionName)\n                .documents()\n                .delete(deleteDocumentsParameters)\n                .getOrDefault(\"num_deleted\", 0);\n\n            if (deletedDocs < idList.size()) {\n                logger.warn(\"Failed to delete all documents\");\n            }\n        }\n        catch (Exception e) {\n            logger.error(\"Failed to delete documents\", e);\n        }\n    }\n```\n\n`DOC_ID_FIELD_NAME` is `\"id\"` (defined at line 85) and `idList` is the `List<String>` passed by the caller to `VectorStore.delete(List<String>)`. The comment's assumption confuses a property of stored documents with a property of untrusted caller input. Typesense's `id: [...]` syntax uses bare unquoted values with no escape character, and `doDelete` never verifies that each element of `idList` is a single bare identifier.\n\nAny comma (`,`) inside an element of `idList` is parsed by Typesense as a list separator and adds another document ID to the delete list. Any closing bracket (`]`) ends the `id: [...]` list literal early. The remainder of the string can then append boolean operators (`||` or `&&`) and a new filter clause such as `|| id:!= [none]`.\n\nThe two companion bugs live in `vector-stores/spring-ai-typesense-store/src/main/java/org/springframework/ai/vectorstore/typesense/TypesenseFilterExpressionConverter.java`. Both `doDelete(Filter.Expression)` (at `TypesenseVectorStore.java` line 204) and `doSimilaritySearch(SearchRequest)` (at line 231) call `this.filterExpressionConverter.convertExpression(...)` to build the `filter_by` string.\n\nHere are `doGroup` and `doSingleValue` in `TypesenseFilterExpressionConverter.java` at tag `v2.0.2`, lines 56 to 88:\n\n```\n    @Override\n    protected void doGroup(Filter.Group group, StringBuilder context) {\n        this.convertOperand(new Filter.Expression(Filter.ExpressionType.AND, group.content(), group.content()),\n                context); // trick\n    }\n\n    @Override\n    protected void doKey(Filter.Key key, StringBuilder context) {\n        var identifier = (hasOuterQuotes(key.key())) ? removeOuterQuotes(key.key()) : key.key();\n        // Typesense field names are bare identifiers in filter_by syntax\n        // (field_name:value) with no escaping mechanism. Validate that the\n        // identifier contains only safe characters to prevent filter injection.\n        for (int i = 0; i < identifier.length(); i++) {\n            char c = identifier.charAt(i);\n            if (!Character.isLetterOrDigit(c) && c != '_' && c != '.' && c != '-') {\n                throw new IllegalArgumentException(\"Not allowed filter identifier name: \" + identifier);\n            }\n        }\n        context.append(\"metadata.\").append(identifier).append(\":\");\n    }\n\n    @Override\n    protected void doSingleValue(Object value, StringBuilder context) {\n        emitJsonValue(value, context);\n    }\n```\n\nIn `doKey` (hardened earlier by commit [029173fba2b1](https://github.com/spring-projects/spring-ai/commit/029173fba2b1dbbaa5d79e3883e90a271c5869b2)) field names were restricted to alphanumeric characters and the symbols `_ . -`. However, `doSingleValue` at line 86 still called `emitJsonValue(value, context)` to serialize strings with Jackson as JSON double-quoted literals (`\"...\"`).\n\nTypesense's `filter_by` grammar is not JSON. Only backticks (`` `...` ``) delimit string literals in Typesense while double quotes are treated as ordinary characters inside an unquoted token. A filter value containing `\" || metadata.tenant: \"victim` closes nothing and injects a new `||` condition (CVE-2026-59369).\n\nMeanwhile, `doGroup` at lines 57 to 60 never emitted `(` and `)`. It duplicated `group.content()` inside an `AND` expression (`// trick`) without parentheses. Any `OR` group placed on the right of an `AND` lost its precedence boundary when Typesense evaluated `&&` and `||` from left to right (CVE-2026-59442).\n\n## How is it exploited?\n\nAn attacker exploits CVE-2026-59415 by passing a crafted document ID with a comma or a closing bracket and boolean operator to an endpoint that calls `VectorStore.delete(List<String>)`. No standalone exploit program is public, and the injection patterns come from the advisory and the regression tests.\n\n1. The application exposes an endpoint (such as `DELETE /api/documents/{id}` ) that passes a caller-supplied string in a`List<String>` to`vectorStore.delete(idList)` , calling`TypesenseVectorStore.doDelete(List<String>)` .\n2. To delete a document belonging to another user or tenant whose ID is known or guessable, the attacker submits a comma-separated string as one ID:\n\n```\nown-doc-1,victim-doc-2\n```\n\n1. `TypesenseVectorStore.doDelete` builds`id: [own-doc-1,victim-doc-2]` and sends it in`filter_by` to Typesense, deleting both`own-doc-1` and`victim-doc-2` .\n2. To wipe every document in the collection in one request, the attacker closes the bracketed list and appends an `||` clause that matches all remaining records:\n\n```\nown-doc-1] || id:!= [own-doc-1\n```\n\n1. `doDelete` produces`id: [own-doc-1] || id:!= [own-doc-1]` and deletes every document in`this.collectionName` regardless of owner or tenant metadata.\n2. Where an application interpolates user input into a metadata filter value for search or delete (CVE-2026-59369), the integration test in commit [5937bd2580](https://github.com/spring-projects/spring-ai/commit/5937bd2580cf4b26006aa574512b57652a7f85ad) shows the breakout value:\n\n```\n// Adapted from TypesenseVectorStoreIT.java in commit 5937bd2580cf\nFilter.Expression injected = new Filter.Expression(\n    Filter.ExpressionType.AND,\n    new Filter.Expression(Filter.ExpressionType.EQ, new Filter.Key(\"tenant\"), new Filter.Value(\"attacker\")),\n    new Filter.Expression(Filter.ExpressionType.EQ, new Filter.Key(\"country\"),\n        new Filter.Value(\"x\\\" || metadata.tenant: \\\"victim\"))\n);\n```\n\nOn `2.0.2` and earlier `TypesenseFilterExpressionConverter` emits `metadata.tenant: \"attacker\" && metadata.country: \"x\\\" || metadata.tenant: \\\"victim\"`. Typesense does not treat `\"` as a string delimiter, so its parser tokenizes `|| metadata.tenant: \\\"victim\"` as a top-level `OR` clause and returns or deletes the victim tenant's documents.\n\n## How does the attack flow?\n\nCaller-supplied document identifiers reach `TypesenseVectorStore.doDelete(List<String>)` and are joined into an unquoted `id: [...]` filter string without character validation, letting injected `] ||` clauses delete arbitrary documents.\n\ndoc1] || id:!= [doc1\"] --> B[\"Application calls\n\nVectorStore.delete(idList)\"] B --> C[\"TypesenseVectorStore.doDelete\n\nreceives List of String\"] C --> D[\"No character check on idList\n\nString.join with comma\"] D --> E[\"Builds filter_by string\n\nid: [doc1] || id:!= [doc1]\"] E --> F[\"Typesense documents().delete()\n\nevaluates injected OR clause\"] F --> G[\"Unintended documents or entire\n\ncollection deleted\"]\n\n## What can an attacker do?\n\nAn attacker who controls a document identifier or filter value passed to an affected `TypesenseVectorStore` can delete documents across the collection or read documents belonging to other tenants. None of the three vulnerabilities executes code on the application host or the Typesense server.\n\n- **Delete specific documents or wipe the entire vector collection (CVE-2026-59415).** Injecting commas or closing the`id: [...]` list and appending an`||` clause in`doDelete(List<String>)` deletes arbitrary documents or empties the Retrieval-Augmented Generation (RAG) knowledge base. The CVE-2026-59415 record scores this at 10.0 Critical (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H` ) while Spring's advisory scores CVE-2026-59415 at 8.1 High (`CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H` ).\n- **Read or delete cross-tenant documents through metadata filter values (CVE-2026-59369).** Passing an untrusted string as a`Filter.Value` in`SearchRequest.filterExpression(...)` or`VectorStore.delete(Filter.Expression)` lets an injected`||` clause bypass tenant filters. That exposes or deletes records from other tenants (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N` at 7.5 High).\n- **Access or delete records across tenants when a filter uses logical groups (CVE-2026-59442).** Combining a tenant constraint with an`OR` group such as`tenant == 'A' && (category == 'a' || category == 'b')` causes the converter to omit parentheses. Typesense then returns or deletes every document matching the right branch of the`OR` across all tenants (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N` at 7.5 High).\n\nEvery condition required for these impacts is explicit. The application must run `spring-ai-typesense-store` `1.0.0` through `1.0.10` or `1.1.0` through `1.1.9`, or run `2.0.0` through `2.0.2` or `2.1.0-M1` through `2.1.0-RC2`.\n\nFor CVE-2026-59415 the attacker must reach an endpoint that passes an unvalidated caller-supplied string into `VectorStore.delete(List<String>)`. For CVE-2026-59369 the attacker must control a metadata filter value passed to `TypesenseFilterExpressionConverter`. For CVE-2026-59442 the application must evaluate a `Filter.Expression` containing a `Filter.Group` on the right of an `AND` expression. Whether authentication is required depends on whether the application's delete or search endpoint is public or authenticated.\n\n## Why does the fix work?\n\nThe fix for CVE-2026-59415 validates every document identifier in `idList` against a strict character allowlist before joining the list and throws `IllegalArgumentException` if any character fails. Alongside it, the companion patches in `TypesenseFilterExpressionConverter` wrap string values in backticks while rejecting embedded backticks and emit parentheses around `Filter.Group` nodes.\n\nHere is the CVE-2026-59415 diff in `vector-stores/spring-ai-typesense-store/src/main/java/org/springframework/ai/vectorstore/typesense/TypesenseVectorStore.java` from commit [c27dac074d](https://github.com/spring-projects/spring-ai/commit/c27dac074dca878fab424a2828f0c398374d8331) (shipped in `v2.0.3` and `v2.1.0`):\n\n```\n    @Override\n    public void doDelete(List<String> idList) {\n+       Assert.notNull(idList, \"Document id list must not be null\");\n        DeleteDocumentsParameters deleteDocumentsParameters = new DeleteDocumentsParameters();\n-       deleteDocumentsParameters.filterBy(DOC_ID_FIELD_NAME + \": [\" + String.join(\",\", idList) + \"]\");\n+       String joinedIds = idList.stream()\n+           .map(TypesenseVectorStore::validateIdForFilter)\n+           .collect(Collectors.joining(\",\"));\n+       deleteDocumentsParameters.filterBy(DOC_ID_FIELD_NAME + \": [\" + joinedIds + \"]\");\n@@\n+   static String validateIdForFilter(String id) {\n+       for (int i = 0; i < id.length(); i++) {\n+           char c = id.charAt(i);\n+           if (!Character.isLetterOrDigit(c) && c != '-' && c != '_' && c != '.' && c != ':' && c != '/' && c != '@') {\n+               throw new IllegalArgumentException(\n+                       \"Document ID contains a character that is not allowed in a Typesense filter expression: '\" + c\n+                               + \"' in id: \" + id);\n+           }\n+       }\n+       return id;\n+   }\n```\n\nWhy did the maintainers choose a character allowlist in `validateIdForFilter` instead of wrapping each ID in backticks? The built-in Typesense `id` field uses bare values in `id: [...]` and Typesense's tokenizer has no escape sequence for a backtick. An unbalanced backtick inside an ID would swallow the comma separators and alter the filter.\n\nPermitting only letters and digits plus `- _ . : / @` supports UUID and Uniform Resource Name (URN) identifiers alongside path-like and email-style or base64url strings. It blocks ``, ] [ | & ` ! = < > +`` and whitespace. Because the stream validates every element before calling `this.client.collections(...)`, one invalid ID aborts the batch with no partial delete.\n\nHere is the companion diff in `vector-stores/spring-ai-typesense-store/src/main/java/org/springframework/ai/vectorstore/typesense/TypesenseFilterExpressionConverter.java` combining commits [5937bd2580](https://github.com/spring-projects/spring-ai/commit/5937bd2580cf4b26006aa574512b57652a7f85ad) (CVE-2026-59369) and [4d13734413](https://github.com/spring-projects/spring-ai/commit/4d1373441388862addabcdf830f9e93994e8e735) (CVE-2026-59442):\n\n```\n    @Override\n-   protected void doGroup(Filter.Group group, StringBuilder context) {\n-       this.convertOperand(new Filter.Expression(Filter.ExpressionType.AND, group.content(), group.content()),\n-               context); // trick\n+   protected void doStartGroup(Filter.Group group, StringBuilder context) {\n+       context.append(\"(\");\n+   }\n+\n+   @Override\n+   protected void doEndGroup(Filter.Group group, StringBuilder context) {\n+       context.append(\")\");\n    }\n@@\n    @Override\n    protected void doSingleValue(Object value, StringBuilder context) {\n-       emitJsonValue(value, context);\n+       if (value instanceof Number || value instanceof Boolean) {\n+           context.append(value);\n+       }\n+       else if (value instanceof Date date) {\n+           context.append(date.getTime());\n+       }\n+       else {\n+           String stringValue = String.valueOf(value);\n+           if (stringValue.indexOf('`') >= 0) {\n+               throw new IllegalArgumentException(\"Illegal character '`' in filter value: \" + stringValue);\n+           }\n+           context.append('`').append(stringValue).append('`');\n+       }\n    }\n```\n\nTogether, the three commits close every `filter_by` construction path in `TypesenseVectorStore` and `TypesenseFilterExpressionConverter`. Keys are validated in `doKey` and values are backtick-delimited in `doSingleValue` while groups are parenthesized in `doStartGroup` and `doEndGroup` and document IDs are checked in `validateIdForFilter`.\n\n## How do I check if I was compromised?\n\nStart by searching Typesense and reverse-proxy request logs and Spring AI application logs for injected filter syntax or unexpected deletions. No indicators of compromise are published for CVE-2026-59415 or for companions CVE-2026-59369 and CVE-2026-59442.\n\nWhen `TypesenseVectorStore.doDelete` calls the Typesense client, the client sends an HTTP `DELETE` request to `/collections/<collection>/documents?filter_by=...`. Search reverse-proxy or Typesense access logs for `DELETE` requests whose `filter_by` query string contains `||` or `&&` or `!=` in raw or URL-encoded form:\n\n```\ngrep -Ei 'DELETE .*/collections/[^/]+/documents\\?filter_by=.*(\\|\\||%7C%7C|&&|%26%26|!=|%21=)' /var/log/nginx/access.log /var/log/typesense/typesense.log 2>/dev/null\n```\n\nIn the Spring application log, `TypesenseVectorStore.doSimilaritySearch` logs the converted filter string at `INFO` level (`Filter expression: ...` at line 234 of `v2.0.2`). Meanwhile `doDelete(List<String>)` logs `Failed to delete all documents` at `WARN` level when `deletedDocs < idList.size()`. Search the application log for injected operators inside logged filter expressions:\n\n```\ngrep -Ei 'Filter expression:.*(\".*(\\|\\||&&).*\")' /var/log/spring-ai-app.log 2>/dev/null\n```\n\nCheck your Typesense collection document counts (`num_documents` via `GET /collections/<collection>`) against expected application records to detect an unexplained bulk delete. A log match is a lead to investigate rather than proof of compromise because legitimate application filters also use `&&` and `||`.\n\nConversely, a bulk delete through `doDelete(List<String>)` does not log the `filter_by` string in the Spring log when `deletedDocs >= idList.size()`. An attack where Typesense sits on an internal network with no HTTP access log may leave only missing documents as its trace.\n\n## Timeline\n\n- 2026-04-30: Commit `0146f25c5ccb` was authored, switching`TypesenseVectorStore.doDelete(List<String>)` to`id: [...]` with raw`String.join(\",\", idList)` .\n- 2026-08-20: Fix commit `5937bd2580cf` for companion CVE-2026-59369 (backtick filter-value escaping) was authored in the Spring AI repository.\n- 2026-10-05: Fix commit `c27dac074dca` for CVE-2026-59415 (`validateIdForFilter` in`doDelete` ) was authored in the Spring AI repository.\n- 2026-10-13: Fix commit `4d1373441388` for companion CVE-2026-59442 (parenthesized groups in`TypesenseFilterExpressionConverter` ) was authored.\n- 2026-11-19: Spring published the advisories for CVE-2026-59415 and companions CVE-2026-59369 and CVE-2026-59442, and released Spring AI `2.0.3` and`2.1.0` to Maven Central.\n- 2026-11-20: The `v2.0.3` and`v2.1.0` release tags were published on GitHub.\n- 2026-11-23: The CVE record for companion CVE-2026-59442 and GitHub advisory `GHSA-34gj-fj65-637x` were published.\n- 2026-11-24: The CVE record for CVE-2026-59415 and GitHub advisory `GHSA-hr93-6g2r-m7rp` were published, 50 days after the fix commit was authored.\n\n## FAQ\n\n### Why does the CVE record score CVE-2026-59415 at 10.0 Critical while the Spring advisory page says High?\n\nBoth records come from VMware/Spring and publish different CVSS v3.1 vectors. The CVE List and NVD carry `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H` (10.0 Critical) while the Spring page links `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H` (8.1 High). The 8.1 vector reflects document deletion impact while scanners reading NVD or `GHSA-hr93-6g2r-m7rp` flag 10.0 Critical.\n\n### Are Spring AI 2.1.0 milestone and release-candidate builds fixed?\n\nNo. Tagged source inspection shows that `2.1.0-M1` and release candidates `2.1.0-RC1` (2026-10-23) and `2.1.0-RC2` (2026-11-05) still contain the unvalidated `String.join(\",\", idList)` in `TypesenseVectorStore.doDelete`. Upgrade any `2.1.0` pre-release to the final `2.1.0` release or `2.0.3`.\n\n### Does CVE-2026-59415 allow remote code execution on the Spring application or Typesense server?\n\nNo. The injection targets Typesense's `filter_by` query language inside `documents().delete(...)` and controls which documents in the collection are deleted. It does not evaluate Java code or SpEL expressions or run operating system commands.\n\n### Are there open-source fixes for the Spring AI 1.0.x and 1.1.x branches?\n\nNo. Fixed versions `1.0.11` and `1.1.10` (alongside `2.0.2.1`) ship only through commercial VMware Tanzu Spring Enterprise Support. Public Maven Central artifacts on those branches stop at `1.0.9` and `1.1.8`, so open-source deployments must upgrade to `2.0.3` or `2.1.0` or apply the workarounds.\n\n### Will upgrading to 2.0.3 or 2.1.0 break existing document IDs or metadata filters?\n\nIt can if your application uses document IDs outside the allowlist (such as spaces or Base64 `+` and `=`) or filter values with literal backticks. Switch Base64 IDs to URL-safe Base64 (`base64url` without `=` padding) before calling `delete(List<String>)`. Also note that `java.util.Date` filter values now serialize as epoch milliseconds to match stored Typesense timestamps.\n\n## How do I find vulnerable Spring AI dependencies with Ostorlab?\n\nUse [Ostorlab SCA and SBOM analysis](https://www.ostorlab.co/product/sca_sbom) to inventory your repositories and build artifacts for `org.springframework.ai:spring-ai-typesense-store` and `org.springframework.ai:spring-ai-starter-vector-store-typesense` across the `1.0.x` and `1.1.x` lines as well as `2.0.x` and `2.1.0` pre-releases. After upgrading to `2.0.3` or `2.1.0`, re-run the dependency tree check from \"Am I affected?\" in CI to confirm that no transitive module pins an older `spring-ai-bom`.\n\n## References\n\n- Spring Security Advisory for CVE-2026-59415, published 2026-11-19 (checked November 24, 2026): https://spring.io/security/cve-2026-59415\n- CVE-2026-59415 record in the CVE List, published 2026-11-24 (checked November 24, 2026): https://www.cve.org/CVERecord?id=CVE-2026-59415\n- GitHub Advisory Database entry GHSA-hr93-6g2r-m7rp for CVE-2026-59415, published 2026-11-24 (checked November 24, 2026): https://github.com/advisories/GHSA-hr93-6g2r-m7rp\n- Spring Security Advisory for companion CVE-2026-59369, published 2026-11-19 (checked November 24, 2026): https://spring.io/security/cve-2026-59369\n- Spring Security Advisory for companion CVE-2026-59442, published 2026-11-19 (checked November 24, 2026): https://spring.io/security/cve-2026-59442\n- CVE-2026-59442 record in the CVE List, published 2026-11-23 (checked November 24, 2026): https://www.cve.org/CVERecord?id=CVE-2026-59442\n- GitHub Advisory Database entry GHSA-34gj-fj65-637x for CVE-2026-59442, published 2026-11-23 (checked November 24, 2026): https://github.com/advisories/GHSA-34gj-fj65-637x\n- Fix commit `c27dac074dca` for CVE-2026-59415, \"Validate IDs in`TypesenseVectorStore` doDelete\", authored 2026-10-05 (checked November 24, 2026): https://github.com/spring-projects/spring-ai/commit/c27dac074dca878fab424a2828f0c398374d8331\n- Fix commit `5937bd2580cf` for CVE-2026-59369, \"Sanitize Typesense filter expression values\", authored 2026-08-20 (checked November 24, 2026): https://github.com/spring-projects/spring-ai/commit/5937bd2580cf4b26006aa574512b57652a7f85ad\n- Fix commit `4d1373441388` for CVE-2026-59442, \"Fix grouping in Typesense filter expression converter\", authored 2026-10-13 (checked November 24, 2026): https://github.com/spring-projects/spring-ai/commit/4d1373441388862addabcdf830f9e93994e8e735\n- Earlier commit `0146f25c5ccb` , \"Fix MilvusVectorStore doDelete idList string esacping\", authored 2026-04-30 (checked November 24, 2026): https://github.com/spring-projects/spring-ai/commit/0146f25c5ccbcb927c664b8886bc100be6f0de25\n- Earlier commit `029173fba2b1` , \"fix: vector store filter expression converter key handling\", authored 2026-03-20 (checked November 24, 2026): https://github.com/spring-projects/spring-ai/commit/029173fba2b1dbbaa5d79e3883e90a271c5869b2\n- Vulnerable `TypesenseVectorStore.java` at tag`v2.0.2` (checked November 24, 2026): https://github.com/spring-projects/spring-ai/blob/v2.0.2/vector-stores/spring-ai-typesense-store/src/main/java/org/springframework/ai/vectorstore/typesense/TypesenseVectorStore.java\n- Vulnerable `TypesenseFilterExpressionConverter.java` at tag`v2.0.2` (checked November 24, 2026): https://github.com/spring-projects/spring-ai/blob/v2.0.2/vector-stores/spring-ai-typesense-store/src/main/java/org/springframework/ai/vectorstore/typesense/TypesenseFilterExpressionConverter.java\n- Fixed `TypesenseVectorStore.java` at tag`v2.0.3` (checked November 24, 2026): https://github.com/spring-projects/spring-ai/blob/v2.0.3/vector-stores/spring-ai-typesense-store/src/main/java/org/springframework/ai/vectorstore/typesense/TypesenseVectorStore.java\n- Fixed `TypesenseFilterExpressionConverter.java` at tag`v2.0.3` (checked November 24, 2026): https://github.com/spring-projects/spring-ai/blob/v2.0.3/vector-stores/spring-ai-typesense-store/src/main/java/org/springframework/ai/vectorstore/typesense/TypesenseFilterExpressionConverter.java\n- Spring AI 2.0.3 release on GitHub, published 2026-11-20 (checked November 24, 2026): https://github.com/spring-projects/spring-ai/releases/tag/v2.0.3\n- Spring AI 2.1.0 release on GitHub, published 2026-11-20 (checked November 24, 2026): https://github.com/spring-projects/spring-ai/releases/tag/v2.1.0\n- Maven Central repository metadata for `spring-ai-typesense-store` , updated 2026-11-19 (checked November 24, 2026): https://repo1.maven.org/maven2/org/springframework/ai/spring-ai-typesense-store/maven-metadata.xml\n- Spring AI GitHub repository, 9,682 stars and 3,089 forks (checked November 24, 2026): https://github.com/spring-projects/spring-ai\n- Typesense GitHub repository, 27,168 stars (checked November 24, 2026): https://github.com/typesense/typesense\n- Typesense official Docker Hub repository, 35,097,946 pulls (checked November 24, 2026): https://hub.docker.com/r/typesense/typesense\n- CWE-917, Improper Neutralization of Special Elements used in an Expression Language Statement (checked November 24, 2026): https://cwe.mitre.org/data/definitions/917.html\n- CWE-943, Improper Neutralization of Special Elements in Data Query Logic (checked November 24, 2026): https://cwe.mitre.org/data/definitions/943.html\n- CWE-783, Operator Precedence Logic Error (checked November 24, 2026): https://cwe.mitre.org/data/definitions/783.html\n- CISA Known Exploited Vulnerabilities catalog, catalog version 2026.11.23 (checked November 24, 2026): https://www.cisa.gov/known-exploited-vulnerabilities-catalog\n\nKeep reading\n\n## Related articles\n\n[Browse the blog](https://blog.ostorlab.co/)", "url": "https://wpnews.pro/news/spring-ai-typesense-filter-injection-fixed-in-2-0-3-cve-2026-59415", "canonical_source": "https://blog.ostorlab.co/spring-ai-typesense-filter-injection-cve-2026-59415.html", "published_at": "2026-11-24 11:30:00+00:00", "updated_at": "2026-11-24 16:43:53.460057+00:00", "lang": "en", "topics": ["ai-safety", "ai-tools", "ai-agents"], "entities": ["Spring", "Spring AI", "Typesense", "TypesenseVectorStore", "CVE-2026-59415", "CVE-2026-59369", "CVE-2026-59442", "CISA"], "also_reported_by": [], "takeaway": "Applications passing user-controlled document IDs to TypesenseVectorStore.doDelete(List<String>) on Spring AI 1.0.0–1.0.10, 1.1.0–1.1.9, 2.0.0–2.0.2 or 2.1.0 pre-releases can have arbitrary records deleted or the collection wiped, so upgrade to 2.0.3 or 2.1.0 (commit c27dac074d) and restrict identif", "recommendation": {"advice": "Upgrade spring-ai-typesense-store to 2.0.3 or 2.1.0 and validate every document identifier against safe characters before calling VectorStore.delete, since unvalidated IDs reach the Typesense filter_by clause.", "playbook": "agent-security", "playbook_url": "https://wpnews.pro/playbooks/agent-security"}, "alternates": {"html": "https://wpnews.pro/news/spring-ai-typesense-filter-injection-fixed-in-2-0-3-cve-2026-59415", "markdown": "https://wpnews.pro/news/spring-ai-typesense-filter-injection-fixed-in-2-0-3-cve-2026-59415.md", "text": "https://wpnews.pro/news/spring-ai-typesense-filter-injection-fixed-in-2-0-3-cve-2026-59415.txt", "jsonld": "https://wpnews.pro/news/spring-ai-typesense-filter-injection-fixed-in-2-0-3-cve-2026-59415.jsonld"}}