Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessRegister tenant via sign-up with crafted schema_name
-
DeliveryEmbed quote/semicolon characters in name
-
ExploitName interpolated into SET search_path on each request
-
ExecutionAppend foreign schema or run stacked SQL
-
ImpactRead other tenants' data or execute SQL as DB user
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Parameterized queries, prepared statements
MITRE ATT&CK
2 techniques across 2 tactics: Initial Access, Persistence The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | The application must allow an untrusted user to set or influence a tenant's schema_name without applying its own sanitisation - typically a self-service sign-up flow that derives the schema name from a user-supplied subdomain or organisation name and relies solely on django-tenants to validate it. The affected component is the PostgreSQL backend in versions >= 3.4.8 through <= 4.0.0, where the loosened validator (^(?!pg_).{1,63}$) accepts quote characters that reach SET search_path (fired on nearly every tenant request and during first migration with automatic schema creation) and CREATE/DROP/ALTER SCHEMA statements. LIMITING factors: deployments where only trusted administrators create tenants, or where the application generates/slugifies the name (e.g. slugify() or an ^[a-z0-9_-]+$ check), are NOT affected; exploitation requires the PR:L ability to register or influence a tenant and does not require the tenant schema to exist first for the search_path path. Impact scales with the database role's privileges - from cross-tenant read/write up to full database control, and command execution on the host if the role is a superuser. |
| Impact | This is a genuine high-severity SQL injection (CWE-89) with strong severity signals but a meaningful exploitability gate. Both the input CVSS 4.0 vector (8.7: AV:N/AC:L/AT:N/PR:L/UI:N, VC/VI/VA:H) and the GHSA's CVSS 3.1 score (8.8: AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H) agree: network-reachable, low complexity, low privileges, no user interaction, full confidentiality/integrity/availability impact on the database. No CISA KEV listing and no EPSS score are provided, and no public exploit is referenced, so there is no evidence of active or at-scale exploitation; the vuln.today Decision label is 'this_week' (not act_now/emergency), consistent with a serious but not actively-exploited flaw. The key tempering factor is PR:L plus a configuration precondition: exploitation only applies where the application lets an untrusted user set or influence a tenant's schema_name without its own sanitisation. Where that condition holds (self-service tenant sign-up deriving the schema from a subdomain or org name), the real-world severity matches the score, because the SET search_path path fires on essentially every request and psycopg permits stacked statements; where tenants are created only by trusted admins or the app slugifies names, the flaw is not reachable. Conclusion: treat as a real priority (prompt patching) for multi-tenant SaaS using django-tenants with user-influenced schema names, rather than a high-CVSS-but-low-real-risk item - but note the auth and configuration dependency when prioritising. |
| Exploit ScenarioDerived | An attacker registers a tenant through a self-service sign-up flow that derives the PostgreSQL schema_name from user-supplied input (e.g. a subdomain or organisation name) and relies on django-tenants to validate it. They supply a schema_name containing a single quote or other quote/semicolon characters, which django-tenants (3.4.8-4.0.0) interpolates unescaped into SET search_path (and CREATE/DROP/ALTER SCHEMA) statements, appending another tenant's schema to the search path or running stacked SQL as the application's database role. No public exploit is identified at time of analysis, though the patch commit's test cases demonstrate working injection payloads such as "tenant1', 'public" and 'tenant1"; CREATE SCHEMA "injected'. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Nov 16, 2026
SQL injection in django-tenants 3.4.8 through 4.0.0 lets a low-privileged, authenticated actor (CVSS PR:L) who can register or otherwise influence a tenant's schema_name inject arbitrary SQL into the PostgreSQL statements the library builds. Because a tenant's schema name is string-interpolated into SET search_path - issued on essentially every request served for that tenant - as well as CREATE, DROP and ALTER SCHEMA, a quote character in the name can expose other tenants' tables to unqualified ORM queries or append arbitrary SQL executed as the application's database user, with impact scaling from cross-tenant read/write to full database control (and host command execution if that role is a superuser). Exploitation is gated on the application accepting an untrusted schema name without its own sanitisation; deployments where administrators alone create tenants, or where names are generated or slugified (for example slugify() or an ^[a-z0-9_-]+$ check), are not affected. No public exploit code was identified at time of analysis, and the vendor has released a patch in 4.0.1.
RemediationAI
Vendor-released patch: upgrade to django-tenants 4.0.1 (release tag https://github.com/django-tenants/django-tenants/releases/tag/v4.0.1, fixing commit 46d89c0fccc820f88657e6ec152ba855072571ff), which introduces quote_schema_name() at every SQL sink and tightens the schema-name validator. Before or during the upgrade, audit existing tenant names, because any tenant whose schema_name contains " ' \ ; newline or NUL will now raise a ValidationError when used - the advisory provides a check such as SELECT schema_name FROM <tenant table> WHERE schema_name ~ '[\"''\\;]' OR schema_name ~ '[\r\n]' and notes such names are extremely unusual. If upgrading immediately is not possible, the vendor's stated mitigation is for the application to generate or sanitise schema_name itself, for example restricting it to ^[a-z0-9_-]+, and to audit existing tenant names for quote and semicolon characters; note this only closes the application-side entry point and does not fix the library's interpolated SQL. The vendor's advisory (GHSA-693j-7v9f-x7pw) frames the upgrade as the complete fix.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
django-tenants implements schema-based multi-tenancy for Django on PostgreSQL, switching each connection's search_path to route ORM queries into the tenant's schema; the vulnerable component is the PostgreSQL backend (django_tenants/postgresql_backend/base.py) plus the tenant model's schema lifecycle methods. Root cause is CWE-89: schema names were placed into SQL by Python string interpolation rather than identifier quoting/parameterisation. The weakness was introduced in 3.4.8 (commit 02af6fa, 'Allow schema names with special chars'), which replaced the strict validator ^[_a-zA-Z0-9]{1,63}$ with ^(?!pg_).{1,63}$ - the surrounding SQL was already interpolated, and only the old validator kept quote characters away from it. Reachable sinks include _handle_search_path (formatted_search_paths built as '{}' strings, lines 208-213 of v4.0.0) fired on tenant connection switching and during first migration when automatic schema creation is enabled, the CREATE SCHEMA and DROP SCHEMA statements in models.py, and ALTER SCHEMA ... RENAME via schema_rename(). Since psycopg allows multiple statements in a single parameterless execute(), an injected payload can both extend the search path and terminate the statement to run additional SQL as the application's database user. The 4.0.1 fix adds a quote_schema_name() helper that escapes embedded double quotes and quotes the name as a PostgreSQL identifier (Django's connection.ops.quote_name() was insufficient because it does not escape inner double quotes), tightens the validator to reject " ' \ ; line breaks and NUL because the bundled clone_schema() PL/pgSQL function still interpolates the name, and restores the introspection search path verbatim from SHOW search_path instead of rebuilding it from unescaped parts.
Know when PostgreSQL gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Remote, low-complexity injection; attacker must register or influence a tenant schema name so PR:L; stacked SQL as the DB user yields full C/I/A; scope unchanged as impact stays within the database authorization context.
Primary rating from Vendor (VulnCheck).
CVSS VectorVendor: VulnCheck
DescriptionCVE.org
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 search_path and CREATE, DROP or ALTER SCHEMA statements, letting them read other tenants' data or run SQL as the application's database user.
Articles & Coverage 1
Technical POC Analysis
CWE-89.
Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.
Executive ViewAI
CVE-2026-130082 is a high-severity SQL injection in the django-tenants library (versions 3.4.8 through 4.0.0) used by our multi-tenant applications, allowing a low-privileged authenticated user to potentially read or alter other tenants' data and, in the worst case, gain control of the underlying database. Any business unit whose application lets end users influence or register tenant schema names is exposed to cross-tenant data leakage and integrity risk, which carries regulatory, customer-trust, and contractual implications that warrant leadership attention.
Vendor-released patch: apply the fixed django-tenants version per the vendor advisory. Interim mitigations: enforce slugify() or an ^[a-z0-9_-]+$ validation on schema_name, restrict tenant creation to administrators, and ensure the application database user is not a superuser.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
SQL injection exploits the way applications construct database queries by mixing user input directly into SQL statements.
More in PostgreSQL
View allPostgreSQL libpq functions PQescapeLiteral(), PQescapeIdentifier(), PQescapeString(), and PQescapeStringConn() improperl
An issue was discovered in Appsmith before 1.52. Rated critical severity (CVSS 9.8), this vulnerability is remotely expl
Argument injection vulnerability in PostgreSQL 9.2.x before 9.2.4, 9.1.x before 9.1.9, and 9.0.x before 9.0.13 allows re
Unauthenticated arbitrary file write in Splunk Enterprise (below 10.2.4 and 10.0.7) and Splunk Cloud Platform (below 10.
Unauthenticated SQL injection in Sangoma Switchvox SMB Edition 8.3 (build 104997) lets remote attackers execute arbitrar
PostgreSQL versions before 9.2.22, 9.3.18, 9.4.13, 9.5.8 and 9.6.4 are vulnerable to incorrect authentication flaw allow
The build_tablename function in pgsql.c in the PostgreSQL (aka pgsql) extension in PHP through 5.6.7 does not validate t
A vulnerability in the h2oai/h2o-3 REST API versions 3.46.0.4 allows unauthenticated remote attackers to execute arbitra
In PostgreSQL 9.3 through 11.2, the "COPY TO/FROM PROGRAM" function allows superusers and users in the 'pg_execute_serve
Unauthenticated SQL injection in Vendure Shop API allows remote attackers to execute arbitrary SQL commands against the
Parse Server is an open source http web server backend. Rated critical severity (CVSS 10.0), this vulnerability is remot
Hard-coded default PostgreSQL credentials shipped in the docker-compose.yaml of langgenius Dify through version 1.5.1 al
EUVD-2026-126711
GHSA-pg64-4qv2-75g5
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB