CVE-2026-55405 — Vulnerability in langchain4j-mariadb — CVE Details
LangChain4j: SQL injection via metadata filters in langchain4j-mariadb and langchain4j-pgvector
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (0.47%). Schedule for your next planned update.
Does your project use an affected dev.langchain4j:langchain4j-mariadb version?
Paste your pom.xml to check it for CVE-2026-55405 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
Summary
The MariaDB and pgvector embedding stores build metadata-filter SQL by string-concatenating
filter keys (and, in MariaDB, string values) directly into the query without adequate
escaping. A crafted metadata key in EmbeddingSearchRequest.filter() can break out of its SQL
context and inject arbitrary SQL into the statements executed by the stores' search and
removeAll(Filter) operations.
Details
pgvector — JSON mode (default, COMBINED_JSON / COMBINED_JSONB). JSONFilterMapper
places the key inside a single-quoted SQL literal (the JSON key of the ->> operator) with no
escaping:
(metadata->>'<key>')::text
A key containing a single quote breaks out, e.g.
metadataKey("')::text IS NOT NULL OR pg_sleep(1) IS NOT NULL --") injects a live pg_sleep(1)
(observable as a delay; exploitable for blind data extraction).
pgvector — column mode (COLUMN_PER_KEY). ColumnFilterMapper used the key as a bare,
unquoted, unvalidated SQL identifier (<key>::<type>), so a key such as 1=1 OR true --
injects directly.
MariaDB — JSON mode (default). JSONFilterMapper placed the key inside the JSON path literal
'$.<key>' unescaped (same break-out mechanism). Additionally, MariaDbFilterMapper.formatValue()
escaped ' but not \; because MariaDB treats backslash as an escape character by default, a
string value ending in a backslash could also break out of its literal.
MariaDB — column mode (COLUMN_PER_KEY). ColumnFilterMapper fell back to the raw,
unescaped key when the driver could not quote it as an identifier (e.g. a
character).
The filter key is the runtime injection surface; both stores' search() (including pgvector's
HYBRID mode) and removeAll(Filter) are affected. Add/upsert operations a
parameterized and not affected.
Impact
Applications that allow attacker-influenced metadata filter keys (e.g. use LLM-generated filters) to reach these stores are exposed to SQL injection: blind data exfiltration, denial of service via sleep functions, and — through `remove deletion of arbitrary rows. Applications using only hard-coded, developer-defined filter keys are not reachable.
Patches
Fixed in langchain4j-mariadb and langchain4j-pgvector 1.16.3-beta26:
- JSON filter keys are escaped before being embedded in the SQL string lit
quotes doubled, correct for PostgreSQL
standard_conforming_strings = on; MariaDB: backslash and single quote). - MariaDB string values escape both
\and'. - Column-mode keys are validated/quoted as identifiers and rejected when u concatenated as raw SQL.
Workarounds
- Do not pass untrusted input as metadata filter keys.
- Restrict filter keys to a known allow-list at the application layer.
References
- pgvector:
JSONFilterMapper,ColumnFilterMapper - MariaDB:
JSONFilterMapper,MariaDbFilterMapper,ColumnFilterMapper
Advisory Timeline
- First published June 17, 2026 (162 days ago).
- Last revised June 17, 2026 — 0 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
<!-- Update pom.xml dependency version to 1.2.1-beta8 for dev.langchain4j:langchain4j-mariadb -->
<!-- Update pom.xml dependency version to 1.5.1-beta11 for dev.langchain4j:langchain4j-mariadb -->
<!-- Update pom.xml dependency version to 1.16.3-beta26 for dev.langchain4j:langchain4j-mariadb -->
<!-- Update pom.xml dependency version to 1.11.8-beta19 for dev.langchain4j:langchain4j-mariadb -->
<!-- Update pom.xml dependency version to 1.16.3-beta26 for dev.langchain4j:langchain4j-pgvector -->
<!-- Update pom.xml dependency version to 1.5.1-beta11 for dev.langchain4j:langchain4j-pgvector -->
<!-- Update pom.xml dependency version to 1.2.1-beta8 for dev.langchain4j:langchain4j-pgvector -->
<!-- Update pom.xml dependency version to 1.11.8-beta19 for dev.langchain4j:langchain4j-pgvector -->
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (8)
Affects 1 ecosystem: Maven (2).
| Package | Fixed In |
|---|---|
| dev.langchain4j:langchain4j-mariadb Maven · Affected: 0.0.002-test-beta2, 0.0.11-test-beta11, 0.0.6-test-beta6, 0.0.7-test-beta7 (+9 more) | 1.2.1-beta8 |
| dev.langchain4j:langchain4j-mariadb Maven · Affected: 1.3.0-beta9, 1.4.0-beta10, 1.5.0-beta11 | 1.5.1-beta11 |
| dev.langchain4j:langchain4j-mariadb Maven · Affected: 1.12.1-beta21, 1.12.2-beta22, 1.13.0-beta23, 1.13.1-beta23 (+7 more) | 1.16.3-beta26 |
| dev.langchain4j:langchain4j-mariadb Maven · Affected: 1.10.0-beta18, 1.11.0-beta19, 1.11.4-beta19, 1.11.5-beta19 (+8 more) | 1.11.8-beta19 |
| dev.langchain4j:langchain4j-pgvector Maven · Affected: 1.12.1-beta21, 1.12.2-beta22, 1.13.0-beta23, 1.13.1-beta23 (+7 more) | 1.16.3-beta26 |
| dev.langchain4j:langchain4j-pgvector Maven · Affected: 1.3.0-beta9, 1.4.0-beta10, 1.5.0-beta11 | 1.5.1-beta11 |
| dev.langchain4j:langchain4j-pgvector Maven · Affected: 0.0.002-test-beta2, 0.0.11-test-beta11, 0.0.6-test-beta6, 0.0.7-test-beta7 (+28 more) | 1.2.1-beta8 |
| dev.langchain4j:langchain4j-pgvector Maven · Affected: 1.10.0-beta18, 1.11.0-beta19, 1.11.4-beta19, 1.11.5-beta19 (+8 more) | 1.11.8-beta19 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-89SQL InjectionMITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 7.6 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:L
References
Frequently Asked Questions
- What is CVE-2026-55405?
- LangChain4j: SQL injection via metadata filters in langchain4j-mariadb and langchain4j-pgvector. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 7.6/10).
- How do I check if my project is affected by CVE-2026-55405?
- CVE-2026-55405 affects dev.langchain4j:langchain4j-mariadb and dev.langchain4j:langchain4j-pgvector. It has a 0.5% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-55405 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Significant impact if exploited, or exploitable with modest effort.
This is a below-median EPSS score — only 33.3% of tracked vulnerabilities score at or below it, so most tracked vulnerabilities are considered more likely to be exploited than this one.
Also Known As
Related CVEs
- CVE-2026-61689HIGH
XWiki Platform: HQL injection in search allows unauthenticated database extraction including password hashes
- CVE-2026-107725HIGH
Hazelcast has an authorization bypass in IMap Predicates API