Skip to main content

LangChain4j EUVDEUVD-2026-43027

| CVE-2026-55405 HIGH
SQL Injection (CWE-89)
2026-06-17 https://github.com/langchain4j/langchain4j GHSA-2mfg-cc43-9pcj
7.6
CVSS 3.1 · Vendor: https://github.com/langchain4j/langchain4j
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Identify app exposing LLM-driven vector search
  2. Delivery
    Craft prompt yielding malicious filter key
  3. Exploit
    Submit via EmbeddingSearchRequest.filter()
  4. Execution
    Break out of JSON key literal in generated SQL
  5. Persist
    Trigger pg_sleep or boolean payload in search()
  6. Impact
    Iteratively exfiltrate data or delete rows via removeAll

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Parameterized queries, prepared statements
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Persistence

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

The application must call EmbeddingSearchRequest.filter() (or removeAll(Filter)) using either langchain4j-pgvector or langchain4j-mariadb at a vulnerable version, AND the filter key string must be derived from attacker-influenced input - most commonly LLM-generated filters from a tool/agent pipeline, but also any user-supplied metadata key passed through without an allow-list. Add and upsert paths are parameterized and not exploitable. The MariaDB string-value variant additionally requires the default MariaDB configuration in which backslash acts as a string escape. Exploitation does not require user interaction and is reachable over the network through whatever application endpoint surfaces filter keys, but PR:L reflects that the attacker needs an authenticated or otherwise legitimate path to submit a query - applications that only ever use hard-coded developer-defined filter keys are not reachable per the vendor advisory.

Impact

The CVSS 3.1 vector AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:L (7.6 High) reflects network reachability through whatever application surface forwards user input into a metadata filter, low complexity, and a requirement that the attacker has some way to influence filter keys (PR:L). No EPSS, KEV, or SSVC data was provided, so probability and government-mandated urgency cannot be quantified from the input. Realistic risk is highly deployment-dependent: applications that pass LLM-generated or otherwise untrusted strings into EmbeddingSearchRequest.filter() are directly exposed and should treat this as a priority patch, while applications using only hard-coded developer-defined filter keys are not reachable per the vendor advisory. The Confidentiality:High rating is justified by blind data exfiltration via boolean/time-based payloads, while Integrity:Low and Availability:Low correctly reflect that arbitrary-row deletion through removeAll and DoS via pg_sleep are bounded by the database role's privileges rather than full table or system control.

Exploit ScenarioDerived

An application exposes a chat or agent endpoint that translates user requests into vector-store metadata filters via an LLM and forwards the generated key into LangChain4j's pgvector embedding store. The attacker submits a prompt that induces the LLM (or directly supplies, via a tool-call argument) a metadata key such as ')::text IS NOT NULL OR pg_sleep(5) IS NOT NULL --, which breaks out of the JSON key literal and is executed by search(); the attacker then iteratively uses boolean/time-based payloads to exfiltrate row data, or injects a payload through removeAll(Filter) to delete arbitrary embeddings. The vendor advisory documents a working pg_sleep proof-of-concept, but no weaponized public exploit was identified at time of analysis.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jun 18, 2026

SQL injection in LangChain4j's langchain4j-mariadb and langchain4j-pgvector embedding stores allows authenticated attackers who can influence metadata filter keys to execute arbitrary SQL via EmbeddingSearchRequest.filter(), enabling blind data exfiltration, denial of service through sleep functions, and deletion of arbitrary rows via removeAll(Filter). The flaw stems from string-concatenated filter keys (and MariaDB string values) being placed into SQL without escaping, and is particularly relevant where filter keys originate from LLM-generated output or untrusted user input. No public exploit identified at time of analysis, though the vendor advisory documents working proof-of-concept payloads such as pg_sleep(1) injection.

RemediationAI

Vendor-released patch: upgrade langchain4j-mariadb and langchain4j-pgvector to 1.16.3-beta26 (or the matching branch fix: 1.2.1-beta8, 1.5.1-beta11, or 1.11.8-beta19 if pinned to an older line) per https://github.com/langchain4j/langchain4j/security/advisories/GHSA-2mfg-cc43-9pcj, which escapes JSON filter keys (doubled single quotes for PostgreSQL with standard_conforming_strings=on; backslash and single quote for MariaDB), escapes both backslash and single quote in MariaDB string values, and validates or quotes column-mode keys as identifiers rather than concatenating them as raw SQL. If immediate upgrade is not possible, the documented workarounds are to never pass untrusted input as metadata filter keys and to enforce a strict server-side allow-list of permitted filter keys at the application layer before invoking EmbeddingSearchRequest.filter() - the trade-off is that LLM-driven or user-driven dynamic filter schemas must be locked down, which may reduce query flexibility for agent workflows. As a defense-in-depth measure, restrict the database role used by the embedding store so that pg_sleep, sensitive table reads, and DELETE on unrelated tables are constrained, limiting the impact of any residual injection paths.

Affected VersionsENISA

langchain4j < 1.2.1-beta8
langchain4j 1.12.1-beta21, < 1.16.3-beta26
langchain4j 1.3.0-beta9, < 1.5.1-beta11
langchain4j 1.6.0-beta12, < 1.11.8-beta19

Affected Packages

maven dev.langchain4j:langchain4j-mariadb fix: 1.2.1-beta8, 1.5.1-beta11, 1.11.8-beta19, 1.16.3-beta26
maven dev.langchain4j:langchain4j-pgvector fix: 1.2.1-beta8, 1.5.1-beta11, 1.11.8-beta19, 1.16.3-beta26
euvd langchain4j fix: 1.2.1-beta8
euvd langchain4j_1_12_1_beta21 fix: 1.16.3-beta26
euvd langchain4j_1_3_0_beta9 fix: 1.5.1-beta11
euvd langchain4j_1_6_0_beta12 fix: 1.11.8-beta19

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 6 packages in maven, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

LangChain4j is a Java framework for building LLM-powered applications, with optional embedding-store integrations for vector similarity search. The affected components are the Maven artifacts dev.langchain4j:langchain4j-mariadb and dev.langchain4j:langchain4j-pgvector, which provide MariaDB and PostgreSQL/pgvector backends. The root cause maps to CWE-89 (SQL Injection): JSONFilterMapper embeds filter keys into single-quoted JSON path literals such as (metadata->>'<key>') in pgvector and '$.<key>' in MariaDB without escaping single quotes, and ColumnFilterMapper in COLUMN_PER_KEY mode uses the key as a raw, unvalidated SQL identifier (<key>::<type>). Additionally, MariaDbFilterMapper.formatValue() escapes single quotes but not backslashes, and because MariaDB treats backslash as an escape character by default, string values ending in a backslash can also escape their literal. Both search() (including pgvector HYBRID mode) and removeAll(Filter) execute these unsafe statements, while add/upsert operations remain parameterized and safe.

Know when PostgreSQL gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/langchain4j/langchain4j) PRIMARY 7.6 HIGH
AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:L
vuln.today AI 7.6 HIGH

Network-reachable through the application; low complexity; PR:L because the attacker must reach a filter-accepting endpoint; C:H for blind exfiltration, I:L/A:L for bounded row deletion and pg_sleep DoS.

3.1 AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:L
4.0 AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:L/VA:L/SC:N/SI:N/SA:N

Primary rating from Vendor (https://github.com/langchain4j/langchain4j).

CVSS VectorVendor: https://github.com/langchain4j/langchain4j

Attack Vector
Network
Attack Complexity
Low
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
Low
Availability
Low

DescriptionCVE.org

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

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 1 maven packages depend on dev.langchain4j:langchain4j-pgvector (1 direct, 0 indirect)

Ecosystem-wide dependent count for version 1.3.0-beta9.

Executive ViewAI

Why It Matters

LangChain4j's MariaDB and PostgreSQL vector embedding stores contain a SQL injection vulnerability (CVE-2026-55405, CVSS 7.6) that allows authenticated attackers to execute arbitrary SQL queries through metadata filter parameters. This impacts organizations using LangChain4j for LLM-powered applications that process dynamic or untrusted filter inputs, potentially leading to unauthorized data access, data deletion, or service disruption. Organizations should immediately assess their deployment scope and implement compensating controls while awaiting a vendor patch.

Business Impact: High
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations: (1) restrict database user privileges to read-only for non-administrative operations; (2) disable or limit database functions used in timing attacks (pg_sleep, SLEEP); (3) validate and sanitize all filter key inputs before passing to EmbeddingSearchRequest.filter(), rejecting those containing SQL syntax; (4) implement database query logging and alerting for anomalous sleep() calls or multi-statement payloads; (5) disable removeAll() API in production until patched if feasible.

Threat Intelligence Overview

EPSS Score
0.3%
Top 73% exploitable
Threat Intel
1
1 source
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact
High

Priority Score

38
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +38
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

SQL injection exploits the way applications construct database queries by mixing user input directly into SQL statements.

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

CVE-2025-1094 HIGH POC
8.1 Feb 13

PostgreSQL libpq functions PQescapeLiteral(), PQescapeIdentifier(), PQescapeString(), and PQescapeStringConn() improperl

CVE-2024-55964 CRITICAL POC
9.8 Mar 26

An issue was discovered in Appsmith before 1.52. Rated critical severity (CVSS 9.8), this vulnerability is remotely expl

CVE-2013-1899 MEDIUM POC
6.5 Apr 04

Argument injection vulnerability in PostgreSQL 9.2.x before 9.2.4, 9.1.x before 9.1.9, and 9.0.x before 9.0.13 allows re

CVE-2026-20253 CRITICAL POC
9.8 Jun 10

Unauthenticated arbitrary file write in Splunk Enterprise (below 10.2.4 and 10.0.7) and Splunk Cloud Platform (below 10.

CVE-2026-9586 CRITICAL POC
9.3 Jul 17

Unauthenticated SQL injection in Sangoma Switchvox SMB Edition 8.3 (build 104997) lets remote attackers execute arbitrar

CVE-2017-7546 CRITICAL
9.8 Aug 16

PostgreSQL versions before 9.2.22, 9.3.18, 9.4.13, 9.5.8 and 9.6.4 are vulnerable to incorrect authentication flaw allow

CVE-2015-1352 MEDIUM POC
5.0 Mar 30

The build_tablename function in pgsql.c in the PostgreSQL (aka pgsql) extension in PHP through 5.6.7 does not validate t

CVE-2024-10553 CRITICAL POC
9.8 Mar 20

A vulnerability in the h2oai/h2o-3 REST API versions 3.46.0.4 allows unauthenticated remote attackers to execute arbitra

CVE-2019-9193 HIGH POC
7.2 Apr 01

In PostgreSQL 9.3 through 11.2, the "COPY TO/FROM PROGRAM" function allows superusers and users in the 'pg_execute_serve

CVE-2026-40887 CRITICAL POC
9.1 Apr 14

Unauthenticated SQL injection in Vendure Shop API allows remote attackers to execute arbitrary SQL commands against the

CVE-2022-24760 CRITICAL POC
10.0 Mar 12

Parse Server is an open source http web server backend. Rated critical severity (CVSS 10.0), this vulnerability is remot

CVE-2025-56157 CRITICAL POC
9.8 Dec 18

Hard-coded default PostgreSQL credentials shipped in the docker-compose.yaml of langgenius Dify through version 1.5.1 al

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy