Langroid has Prompt to SQL Injection, Leading to RCE (CVE-2026-25879)
Langroid versions prior to 0.63.0 contain a vulnerability in the SQLChatAgent component where SQL queries generated by a large language model (LLM) are executed without sufficient validation. This allows an attacker who can influence the LLM's input to inject SQL commands that leverage database-specific features (e.g., PostgreSQL's COPY FROM PROGRAM) to execute arbitrary system commands, resulting in remote code execution (RCE) on the database host. The vulnerability arises when the database role has elevated privileges that permit such operations. The issue is fixed in version 0.63.0 by restricting SQLChatAgent to a safe subset of SQL commands and blocking dangerous patterns by default. The vulnerability is critical due to its potential for full system compromise via the database server.
AI Analysis
Technical Summary
The vulnerability in Langroid <0.63.0 involves the SQLChatAgent executing SQL statements generated by an LLM without adequate filtering or validation. Attackers can exploit prompt injection to craft SQL commands that invoke dialect-specific primitives capable of executing arbitrary code on the database host, such as PostgreSQL's COPY FROM PROGRAM. This leads to remote code execution when the database user has privileges allowing such operations. The vulnerability is mitigated in version 0.63.0 by implementing a whitelist of allowed SQL operations (e.g., SELECT-only) and blocking dangerous commands by default. The previous unrestricted behavior can be restored only in trusted environments by explicitly enabling allow_dangerous_operations. The vulnerability is tracked as CVE-2026-25879 and is rated critical with a CVSS 3.1 vector indicating network attack vector, low attack complexity, no privileges required, no user interaction, and high impact on confidentiality, integrity, and availability.
Potential Impact
Successful exploitation allows attackers to execute arbitrary system commands on the database server, potentially leading to full remote code execution. This can result in exfiltration of sensitive data, unauthorized modification or deletion of database contents, and further compromise of the underlying infrastructure. The impact is critical as it affects confidentiality, integrity, and availability of the system.
Mitigation Recommendations
A fix is available in Langroid version 0.63.0, which defaults SQLChatAgent to a SELECT-only SQL statement allowlist with a dialect-aware blocklist for dangerous patterns. Users should upgrade to version 0.63.0 or later. For deployments requiring unrestricted SQL operations, the allow_dangerous_operations flag must be explicitly enabled only in trusted environments. Until upgraded, users should restrict database roles to minimize privileges that allow execution of system commands and avoid exposing the SQLChatAgent to untrusted input.
Langroid has Prompt to SQL Injection, Leading to RCE (CVE-2026-25879)
Description
Langroid versions prior to 0.63.0 contain a vulnerability in the SQLChatAgent component where SQL queries generated by a large language model (LLM) are executed without sufficient validation. This allows an attacker who can influence the LLM's input to inject SQL commands that leverage database-specific features (e.g., PostgreSQL's COPY FROM PROGRAM) to execute arbitrary system commands, resulting in remote code execution (RCE) on the database host. The vulnerability arises when the database role has elevated privileges that permit such operations. The issue is fixed in version 0.63.0 by restricting SQLChatAgent to a safe subset of SQL commands and blocking dangerous patterns by default. The vulnerability is critical due to its potential for full system compromise via the database server.
CVSS v3.1
Score 9.8critical
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in Langroid <0.63.0 involves the SQLChatAgent executing SQL statements generated by an LLM without adequate filtering or validation. Attackers can exploit prompt injection to craft SQL commands that invoke dialect-specific primitives capable of executing arbitrary code on the database host, such as PostgreSQL's COPY FROM PROGRAM. This leads to remote code execution when the database user has privileges allowing such operations. The vulnerability is mitigated in version 0.63.0 by implementing a whitelist of allowed SQL operations (e.g., SELECT-only) and blocking dangerous commands by default. The previous unrestricted behavior can be restored only in trusted environments by explicitly enabling allow_dangerous_operations. The vulnerability is tracked as CVE-2026-25879 and is rated critical with a CVSS 3.1 vector indicating network attack vector, low attack complexity, no privileges required, no user interaction, and high impact on confidentiality, integrity, and availability.
Potential Impact
Successful exploitation allows attackers to execute arbitrary system commands on the database server, potentially leading to full remote code execution. This can result in exfiltration of sensitive data, unauthorized modification or deletion of database contents, and further compromise of the underlying infrastructure. The impact is critical as it affects confidentiality, integrity, and availability of the system.
Mitigation Recommendations
A fix is available in Langroid version 0.63.0, which defaults SQLChatAgent to a SELECT-only SQL statement allowlist with a dialect-aware blocklist for dangerous patterns. Users should upgrade to version 0.63.0 or later. For deployments requiring unrestricted SQL operations, the allow_dangerous_operations flag must be explicitly enabled only in trusted environments. Until upgraded, users should restrict database roles to minimize privileges that allow execution of system commands and avoid exposing the SQLChatAgent to untrusted input.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-mxfr-6hcw-j9rq
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2026-25879"]
- Ecosystems
- ["PyPI"]
- Database Specific Severity
- CRITICAL
- Cvss Version
- 3.1
Threat ID: 6a46ed1527e9c7971944709f
Added to database: 07/02/2026, 22:58:29 UTC
Last enriched: 07/02/2026, 23:35:28 UTC
Last updated: 07/31/2026, 19:22:58 UTC
Views: 58
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.