Vulnerabilities in pkg:maven/dev.langchain4j/langchain4j-pgvector
PACKAGECVE-2026-55405 is a HIGH (CVSS 7.6) sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting LangChain4j libraries in the Maven ecosystem. The issue involves sql injection via metadata filters in langchain4j-mariadb and langchain4j-pgvector. Remediation is available by upgrading affected packages to version 1.2.1-beta8, 1.5.1-beta11, 1.11.8-beta19, 1.16.3-beta26.
pkg:maven/dev.langchain4j/langchain4j-pgvector
Vulnerability advisories affecting package pkg:maven/dev.langchain4j/langchain4j-pgvector. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-2mfg-cc43-9pcj | CVE-2026-55405 | HIGH | LangChain4j: SQL injection via metadata filters in langchain4j-mariadb and langchain4j-pgvector |
CVE-2026-55405 at a Glance
Security Impact
CVSS: 7.6
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:L).
How to Fix CVE-2026-55405
To remediate this vulnerability, upgrade all affected LangChain4j dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-mariadb</artifactId>
<version>1.2.1-beta8</version>
</dependency>
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-mariadb</artifactId>
<version>1.5.1-beta11</version>
</dependency>
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-mariadb</artifactId>
<version>1.11.8-beta19</version>
</dependency>
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-mariadb</artifactId>
<version>1.16.3-beta26</version>
</dependency>
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-pgvector</artifactId>
<version>1.2.1-beta8</version>
</dependency>
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-pgvector</artifactId>
<version>1.5.1-beta11</version>
</dependency>
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-pgvector</artifactId>
<version>1.11.8-beta19</version>
</dependency>
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-pgvector</artifactId>
<version>1.16.3-beta26</version>
</dependency>
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
mvn dependency:tree -Dincludes=dev.langchain4j
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2026-55405, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=dev.langchain4j
Analyze the terminal output to locate any version of LangChain4j in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.2.1-beta8), your application is affected.
Note: The mvn dependency:tree -Dincludes=dev.langchain4j command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product constructs all or part of an sql command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended sql command when it is sent to a downstream component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. In LangChain4j, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-55405 Affected LangChain4j Versions
8 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
dev.langchain4j:langchain4j-mariadb
|
Maven |
< 1.2.1-beta8
|
1.2.1-beta8
|
|
dev.langchain4j:langchain4j-mariadb
|
Maven |
≥ 1.3.0-beta9
< 1.5.1-beta11
|
1.5.1-beta11
|
|
dev.langchain4j:langchain4j-mariadb
|
Maven |
≥ 1.6.0-beta12
< 1.11.8-beta19
|
1.11.8-beta19
|
|
dev.langchain4j:langchain4j-mariadb
|
Maven |
≥ 1.12.1-beta21
< 1.16.3-beta26
|
1.16.3-beta26
|
|
dev.langchain4j:langchain4j-pgvector
|
Maven |
< 1.2.1-beta8
|
1.2.1-beta8
|
|
dev.langchain4j:langchain4j-pgvector
|
Maven |
≥ 1.3.0-beta9
< 1.5.1-beta11
|
1.5.1-beta11
|
|
dev.langchain4j:langchain4j-pgvector
|
Maven |
≥ 1.6.0-beta12
< 1.11.8-beta19
|
1.11.8-beta19
|
|
dev.langchain4j:langchain4j-pgvector
|
Maven |
≥ 1.12.1-beta21
< 1.16.3-beta26
|
1.16.3-beta26
|
References
Frequently Asked Questions
What is CVE-2026-55405?
Which LangChain4j versions are affected?
What version fixes CVE-2026-55405?
Is langchain4j-mariadb affected?
Is langchain4j-pgvector affected?
What is the CVSS score of CVE-2026-55405?
What CWE is associated with CVE-2026-55405?
How can I check Maven dependencies for CVE-2026-55405?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-2mfg-cc43-9pcj",
"modified" : "2026-06-17T18:39:56Z",
"published" : "2026-06-17T18:39:56Z",
"aliases" : [ "CVE-2026-55405" ],
"summary" : "LangChain4j: SQL injection via metadata filters in langchain4j-mariadb and langchain4j-pgvector",
"details" : "### Summary\nThe MariaDB and pgvector embedding stores build metadata-filter SQL by string-concatenating\nfilter **keys** (and, in MariaDB, string **values**) directly into the query without adequate\nescaping. A crafted metadata key in `EmbeddingSearchRequest.filter()` can break out of its SQL\ncontext and inject arbitrary SQL into the statements executed by the stores' search and\n`removeAll(Filter)` operations.\n\n### Details\n**pgvector — JSON mode (default, `COMBINED_JSON` / `COMBINED_JSONB`).** `JSONFilterMapper`\nplaces the key inside a single-quoted SQL literal (the JSON key of the `->>` operator) with no\nescaping:\n\n (metadata->>'<key>')::text\n\nA key containing a single quote breaks out, e.g.\n`metadataKey(\"')::text IS NOT NULL OR pg_sleep(1) IS NOT NULL --\")` injects a live `pg_sleep(1)`\n(observable as a delay; exploitable for blind data extraction).\n\n**pgvector — column mode (`COLUMN_PER_KEY`).** `ColumnFilterMapper` used the key as a bare,\nunquoted, unvalidated SQL identifier (`<key>::<type>`), so a key such as `1=1 OR true --`\ninjects directly.\n\n**MariaDB — JSON mode (default).** `JSONFilterMapper` placed the key inside the JSON path literal\n`'$.<key>'` unescaped (same break-out mechanism). Additionally, `MariaDbFilterMapper.formatValue()`\nescaped `'` but not `\\`; because MariaDB treats backslash as an escape character by default, a\nstring value ending in a backslash could also break out of its literal.\n\n**MariaDB — column mode (`COLUMN_PER_KEY`).** `ColumnFilterMapper` fell back to the raw,\nunescaped key when the driver could not quote it as an identifier (e.g. a\ncharacter).\n\nThe filter key is the runtime injection surface; both stores' `search()` (including pgvector's\nHYBRID mode) and `removeAll(Filter)` are affected. Add/upsert operations a\nparameterized and not affected.\n\n### Impact\nApplications that allow attacker-influenced metadata filter keys (e.g. use\nLLM-generated filters) to reach these stores are exposed to SQL injection: blind data\nexfiltration, denial of service via sleep functions, and — through `remove\ndeletion of arbitrary rows. Applications using only hard-coded, developer-defined filter keys\nare not reachable.\n\n### Patches\nFixed in `langchain4j-mariadb` and `langchain4j-pgvector` 1.16.3-beta26:\n- JSON filter keys are escaped before being embedded in the SQL string lit\n quotes doubled, correct for PostgreSQL `standard_conforming_strings = on`; MariaDB: backslash\n and single quote).\n- MariaDB string values escape both `\\` and `'`.\n- Column-mode keys are validated/quoted as identifiers and rejected when u\n concatenated as raw SQL.\n\n### Workarounds\n- Do not pass untrusted input as metadata filter keys.\n- Restrict filter keys to a known allow-list at the application layer.\n\n### References\n- pgvector: `JSONFilterMapper`, `ColumnFilterMapper`\n- MariaDB: `JSONFilterMapper`, `MariaDbFilterMapper`, `ColumnFilterMapper`",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:L"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "dev.langchain4j:langchain4j-mariadb"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.2.1-beta8"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 1.2.0-beta8"
}
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "dev.langchain4j:langchain4j-mariadb"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.3.0-beta9"
}, {
"fixed" : "1.5.1-beta11"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 1.5.0-beta11"
}
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "dev.langchain4j:langchain4j-mariadb"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.6.0-beta12"
}, {
"fixed" : "1.11.8-beta19"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 1.11.7-beta19"
}
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "dev.langchain4j:langchain4j-mariadb"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.12.1-beta21"
}, {
"fixed" : "1.16.3-beta26"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 1.16.2-beta26"
}
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "dev.langchain4j:langchain4j-pgvector"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.2.1-beta8"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 1.2.0-beta8"
}
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "dev.langchain4j:langchain4j-pgvector"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.3.0-beta9"
}, {
"fixed" : "1.5.1-beta11"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 1.5.0-beta11"
}
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "dev.langchain4j:langchain4j-pgvector"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.6.0-beta12"
}, {
"fixed" : "1.11.8-beta19"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 1.11.7-beta19"
}
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "dev.langchain4j:langchain4j-pgvector"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.12.1-beta21"
}, {
"fixed" : "1.16.3-beta26"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 1.16.2-beta26"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/langchain4j/langchain4j/security/advisories/GHSA-2mfg-cc43-9pcj"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/langchain4j/langchain4j"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-89" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-06-17T18:39:56Z",
"nvd_published_at" : null
}
}