CVE-2026-55405
LangChain4j: SQL injection via metadata filters in langchain4j-mariadb and langchain4j-pgvector
LangChain4j is a Java library for building LLM-powered applications on the JVM. Prior to 1.2.1-beta8, 1.5.1-beta11, 1.11.8-beta19, and 1.16.3-beta26, 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, enabling blind data exfiltration, denial of service via sleep functions, and deletion of arbitrary rows through removeAll(Filter). This issue is fixed in langchain4j-mariadb and langchain4j-pgvector versions 1.2.1-beta8, 1.5.1-beta11, 1.11.8-beta19, and 1.16.3-beta26.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- Low
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- Low
- Availability
- Low
Exploit likelihood
What each source reports
CVE List Score used
7.6
LangChain4j: SQL injection via metadata filters in langchain4j-mariadb and langchain4j-pgvector
LangChain4j is a Java library for building LLM-powered applications on the JVM. Prior to 1.2.1-beta8, 1.5.1-beta11, 1.11.8-beta19, and 1.16.3-beta26, 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, enabling blind data exfiltration, denial of service via sleep functions, and deletion of arbitrary rows through removeAll(Filter). This issue is fixed in langchain4j-mariadb and langchain4j-pgvector versions 1.2.1-beta8, 1.5.1-beta11, 1.11.8-beta19, and 1.16.3-beta26.
- Record
CVE-2026-55405- CVSS 3.1
- 7.6 High
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:L - Weakness
- CWE-89
- Updated
- 2026-11-02
EUVDEUVD-2026-43027
7.6
LangChain4j is a Java library for building LLM-powered applications on the JVM. Prior to 1.2.1-beta8, 1.5.1-beta11, 1.11.8-beta19, and 1.16.3-beta26, 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, enabling blind data exfiltration, denial of service via sleep functions, and deletion of arbitrary rows through removeAll(Filter). This issue is fixed in langchain4j-mariadb and langchain4j-pgvector versions 1.2.1-beta8, 1.5.1-beta11, 1.11.8-beta19, and 1.16.3-beta26.
- Record
EUVD-2026-43027- CVSS 3.1
- 7.6 High
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:L - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-2mfg-cc43-9pcj
7.6
LangChain4j: SQL injection via metadata filters in langchain4j-mariadb and langchain4j-pgvector
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
- Record
GHSA-2mfg-cc43-9pcj- CVSS 3.1
- 7.6 High
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:L - Weakness
- CWE-89
- Updated
- 2026-11-02
NVD
7.6
LangChain4j is a Java library for building LLM-powered applications on the JVM. Prior to 1.2.1-beta8, 1.5.1-beta11, 1.11.8-beta19, and 1.16.3-beta26, 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, enabling blind data exfiltration, denial of service via sleep functions, and deletion of arbitrary rows through removeAll(Filter). This issue is fixed in langchain4j-mariadb and langchain4j-pgvector versions 1.2.1-beta8, 1.5.1-beta11, 1.11.8-beta19, and 1.16.3-beta26.
- Record
CVE-2026-55405- CVSS 3.1
- 7.6 High
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:L - Weakness
- CWE-89
- Updated
- 2026-11-02
OSV
7.6
LangChain4j: SQL injection via metadata filters in langchain4j-mariadb and langchain4j-pgvector
LangChain4j is a Java library for building LLM-powered applications on the JVM. Prior to 1.2.1-beta8, 1.5.1-beta11, 1.11.8-beta19, and 1.16.3-beta26, 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, enabling blind data exfiltration, denial of service via sleep functions, and deletion of arbitrary rows through removeAll(Filter). This issue is fixed in langchain4j-mariadb and langchain4j-pgvector versions 1.2.1-beta8, 1.5.1-beta11, 1.11.8-beta19, and 1.16.3-beta26.
- Record
CVE-2026-55405- CVSS 3.1
- 7.6 High
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:L - Weakness
- CWE-89
- Updated
- 2026-11-02
OSVGHSA-2mfg-cc43-9pcj
7.6
LangChain4j: SQL injection via metadata filters in langchain4j-mariadb and langchain4j-pgvector
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
- Record
GHSA-2mfg-cc43-9pcj- CVSS 3.1
- 7.6 High
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:L - Weakness
- CWE-89
- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
dev.langchain4j:langchain4j-mariadbMaven |
through 1.2.0-beta8 | 1.2.1-beta8 |
dev.langchain4j:langchain4j-mariadbMaven |
1.3.0-beta9 to 1.5.0-beta11 | 1.5.1-beta11 |
dev.langchain4j:langchain4j-mariadbMaven |
1.6.0-beta12 to 1.11.7-beta19 | 1.11.8-beta19 |
dev.langchain4j:langchain4j-mariadbMaven |
1.12.1-beta21 to 1.16.2-beta26 | 1.16.3-beta26 |
dev.langchain4j:langchain4j-pgvectorMaven |
through 1.2.0-beta8 | 1.2.1-beta8 |
dev.langchain4j:langchain4j-pgvectorMaven |
1.3.0-beta9 to 1.5.0-beta11 | 1.5.1-beta11 |
dev.langchain4j:langchain4j-pgvectorMaven |
1.6.0-beta12 to 1.11.7-beta19 | 1.11.8-beta19 |
dev.langchain4j:langchain4j-pgvectorMaven |
1.12.1-beta21 to 1.16.2-beta26 | 1.16.3-beta26 |
dev.langchain4j:langchain4j-mariadbMaven |
before 1.2.1-beta8, plus listed versions 0.0.002-test-beta20.0.11-test-beta110.0.6-test-beta60.0.7-test-beta70.0.9-test-beta9 Show 8 moreShow less1.0.0-beta11.0.0-beta21.0.0-beta31.0.0-beta41.0.0-beta51.0.1-beta61.1.0-beta71.2.0-beta8 |
1.2.1-beta8 |
dev.langchain4j:langchain4j-mariadbMaven |
1.3.0-beta9 up to 1.5.1-beta11, plus listed versions 1.4.0-beta101.5.0-beta11 |
1.5.1-beta11 |
Show 6 moreShow less
| Package | Affected | Fixed |
|---|---|---|
dev.langchain4j:langchain4j-mariadbMaven |
1.6.0-beta12 up to 1.11.8-beta19, plus listed versions 1.10.0-beta181.11.0-beta191.11.4-beta191.11.5-beta191.11.6-beta19 Show 6 moreShow less1.11.7-beta191.7.0-beta131.7.1-beta141.8.0-beta151.9.0-beta161.9.1-beta17 |
1.11.8-beta19 |
dev.langchain4j:langchain4j-mariadbMaven |
1.12.1-beta21 up to 1.16.3-beta26, plus listed versions 1.12.2-beta221.13.0-beta231.13.1-beta231.14.0-beta241.14.1-beta24 Show 5 moreShow less1.15.0-beta251.15.1-beta251.16.0-beta261.16.1-beta261.16.2-beta26 |
1.16.3-beta26 |
dev.langchain4j:langchain4j-pgvectorMaven |
before 1.2.1-beta8, plus listed versions 0.0.002-test-beta20.0.11-test-beta110.0.6-test-beta60.0.7-test-beta70.0.9-test-beta9 Show 27 moreShow less0.24.00.25.00.26.00.26.10.27.00.27.10.28.00.29.00.29.10.30.00.31.00.32.00.33.00.34.00.35.00.36.00.36.10.36.21.0.0-alpha11.0.0-beta11.0.0-beta21.0.0-beta31.0.0-beta41.0.0-beta51.0.1-beta61.1.0-beta71.2.0-beta8 |
1.2.1-beta8 |
dev.langchain4j:langchain4j-pgvectorMaven |
1.3.0-beta9 up to 1.5.1-beta11, plus listed versions 1.4.0-beta101.5.0-beta11 |
1.5.1-beta11 |
dev.langchain4j:langchain4j-pgvectorMaven |
1.6.0-beta12 up to 1.11.8-beta19, plus listed versions 1.10.0-beta181.11.0-beta191.11.4-beta191.11.5-beta191.11.6-beta19 Show 6 moreShow less1.11.7-beta191.7.0-beta131.7.1-beta141.8.0-beta151.9.0-beta161.9.1-beta17 |
1.11.8-beta19 |
dev.langchain4j:langchain4j-pgvectorMaven |
1.12.1-beta21 up to 1.16.3-beta26, plus listed versions 1.12.2-beta221.13.0-beta231.13.1-beta231.14.0-beta241.14.1-beta24 Show 5 moreShow less1.15.0-beta251.15.1-beta251.16.0-beta261.16.1-beta261.16.2-beta26 |
1.16.3-beta26 |
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-55405 is a high vulnerability (CVSS 7.6) in Langchain4j, published June 17, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.47%, the 41st percentile. Fixed in dev.langchain4j:langchain4j-mariadb 1.2.1-beta8.
References
github.com/langchain4j/langchain4j/security/advisories/GHSA-2mfg-cc43-9pcj
github.com/langchain4j/langchain4j/commit/13a0698bdfaf105d8aaf0367881df51358596219
github.com/langchain4j/langchain4j/commit/1bc1f60aa58ef5c3c1703caf73362482480351cf
github.com/langchain4j/langchain4j/commit/8805d5d128694302f1b0a2650174186862f669e7
github.com/langchain4j/langchain4j/commit/ce96291dfb243c7f6753b5d65c7a77914642314f
github.com/langchain4j/langchain4j/commit/f14a10ce77e4ea1b8277f67d6a81f46abd7a5bc2