CVE-2026-130082: django-tenants 3.4.8 before 4.0.1 SQL Injection via Unescaped Schema Name
django-tenants 3.4.8 before 4.0.1 contains an SQL injection vulnerability in its PostgreSQL backend that allows attackers to inject SQL through unescaped tenant schema names. Attackers who can choose or influence a schema name can supply quote characters that are interpolated into SET searchpath and CREATE, DROP or ALTER SCHEMA statements, letting them read other tenants' data or run SQL as the application's database user.
Affected Software
Event History
Frequently Asked Questions
Who can exploit this issue?
An attacker must be able to choose or influence a tenant schema name. The vulnerable code path is in the PostgreSQL backend, where that name is used in SQL statements without escaping.
Are deployments using the default PostgreSQL schema naming behavior affected?
The data does not identify any safe default configuration. Exposure depends on whether an untrusted party can influence the schema name used by django-tenants.
What impact can successful exploitation have?
Injected SQL can be executed with the application's database-user privileges. This can allow reading data belonging to other tenants or executing SQL through the application's database account.
What versions should be remediated?
Versions from 3.4.8 before 4.0.1 are affected. Upgrade to 4.0.1 or later.