{"id":"CVE-2026-130082","kind":"vulnerability","aliases":["CVE-2026-130082"],"related":[],"title":"django-tenants: unescaped schema names let attackers inject SQL","description":"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.","summary":"django-tenants does not escape tenant schema names in its PostgreSQL backend, so the names are pasted straight into SQL statements. An attacker who can choose or influence a schema name can read other tenants' data or run SQL as the application's database user.","severity":"high","cvss":8.8,"epss":null,"exploited":false,"exploited_at":null,"products":[],"ecosystems":[],"tags":["django","django-tenants","multi-tenant","package","postgresql"],"not_affected_if":["fixed-schema-names","non-postgresql-backend"],"how_to_check":"- Check the installed version with `pip show django-tenants` and see whether it is at least `4.0.1`.\n- Look for places where a tenant schema name comes from user input, such as a subdomain, header or form field, passed to tenant lookup or schema creation code.","fix":"- django-tenants: move to `4.0.1` or later (the range runs from `3.4.8` before `4.0.1`).","status":"open","published_at":"2026-11-16T22:18:24+00:00","first_seen_at":"2026-11-16T22:39:15+00:00","triaged_at":"2026-11-16T22:40:31+00:00","updated_at":"2026-11-16T22:40:31+00:00","category":"package","confidence":0.7,"triage":{"at":"2026-11-16T22:40:31Z","model":"claude-haiku-5-5","output":{"fix":"- django-tenants: move to `4.0.1` or later (the range runs from `3.4.8` before `4.0.1`).","reach":"unknown","title":"django-tenants: unescaped schema names let attackers inject SQL","impact":"high","summary":"django-tenants does not escape tenant schema names in its PostgreSQL backend, so the names are pasted straight into SQL statements. An attacker who can choose or influence a schema name can read other tenants' data or run SQL as the application's database user.","audience":"developers","category":"package","nicknames":[],"who_cares":["django","django-tenants","postgresql","multi-tenant"],"confidence":0.7,"fix_status":"available","needs_auth":"unknown","worst_case":"Attacker reads other tenants' data or runs SQL as database user","analyst_note":"Attack path needs an attacker to influence schema names; sources do not say which entry points qualify.\n\nproduct_name","how_to_check":"- Check the installed version with `pip show django-tenants` and see whether it is at least `4.0.1`.\n- Look for places where a tenant schema name comes from user input, such as a subdomain, header or form field, passed to tenant lookup or schema creation code.","plain_action":"","product_name":"","needs_analyst":false,"not_affected_if":["fixed-schema-names","non-postgresql-backend"],"who_is_affected":"Applications built on django-tenants 3.4.8 up to but not including 4.0.1 that use the PostgreSQL backend and let users influence tenant schema names are exposed. Apps with fixed tenant names, or that do not take schema names from requests, are much less exposed. unknown whether other backends are affected.","user_interaction":"no","product_ecosystem":"","needs_special_setup":"unknown","severity_if_unknown":"high"},"cost_usd":0.00077,"input_tokens":4676,"output_tokens":605,"severity_before":"high"},"analyst_status":null,"analyst_note":null,"search":"'-130082':13A,16A '-2026':12A,15A '3.4.8':75C '4.0.1':77C 'allow':88C 'alter':122C 'applic':68B,136C 'attack':8A,49B,89C,98C 'backend':38B,86C 'charact':110C 'choos':52B,101C 'contain':78C 'creat':119C 'cve':11A,14A 'data':62B,130C 'databas':70B,138C 'django':2A,17B,19B,27B,73C 'django-ten':1A,18B,26B,72C 'drop':120C 'escap':31B 'influenc':54B,103C 'inject':9A,81C,91C 'interpol':113C 'let':7A,125C 'multi':22B 'multi-ten':21B 'name':6A,34B,41B,57B,97C,106C 'packag':24B 'past':43B 'path':117C 'postgresql':25B,37B,85C 'quot':109C 'read':59B,127C 'run':64B,132C 'schema':5A,33B,56B,96C,105C,123C 'search':116C 'set':115C 'sql':10A,46B,65B,80C,92C,133C 'statement':47B,124C 'straight':44B 'suppli':108C 'tenant':3A,20B,23B,28B,32B,61B,74C,95C,129C 'unescap':4A,94C 'user':71B,139C 'vulner':82C","nicknames":[],"mitigations":[],"who_affected":"Applications built on django-tenants 3.4.8 up to but not including 4.0.1 that use the PostgreSQL backend and let users influence tenant schema names are exposed. Apps with fixed tenant names, or that do not take schema names from requests, are much less exposed. unknown whether other backends are affected.","tier":"B","verified":{},"analyst_revisit_at":null,"fix_status":"available","audience":"developers","plain_action":null,"pkeys":[],"ptokens":[],"labels":["django","djangotenants","high","multitenant","package","postgresql"],"campaign_type":null,"search_a":"'-130082':13A,16A '-2026':12A,15A 'attack':8A 'cve':11A,14A 'django':2A 'django-ten':1A 'inject':9A 'let':7A 'name':6A 'schema':5A 'sql':10A 'tenant':3A 'unescap':4A","search_b":"'applic':68B 'attack':49B 'backend':38B 'choos':52B 'data':62B 'databas':70B 'django':17B,19B,27B 'django-ten':18B,26B 'escap':31B 'influenc':54B 'multi':22B 'multi-ten':21B 'name':34B,41B,57B 'packag':24B 'past':43B 'postgresql':25B,37B 'read':59B 'run':64B 'schema':33B,56B 'sql':46B,65B 'statement':47B 'straight':44B 'tenant':20B,23B,28B,32B,61B 'user':71B","search_c":"'3.4.8':75C '4.0.1':77C 'allow':88C 'alter':122C 'applic':136C 'attack':89C,98C 'backend':86C 'charact':110C 'choos':101C 'contain':78C 'creat':119C 'data':130C 'databas':138C 'django':73C 'django-ten':72C 'drop':120C 'influenc':103C 'inject':81C,91C 'interpol':113C 'let':125C 'name':97C,106C 'path':117C 'postgresql':85C 'quot':109C 'read':127C 'run':132C 'schema':96C,105C,123C 'search':116C 'set':115C 'sql':80C,92C,133C 'statement':124C 'suppli':108C 'tenant':74C,95C,129C 'unescap':94C 'user':139C 'vulner':82C","cause_entry":null,"cause_path":null,"disclosures_checked_at":null,"first_public_at":"2026-10-24T10:06:00+00:00","kev":null,"cvss_vector":"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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","cvss_by":"disclosure@vulncheck.com","poc_count":0,"sources":[{"source":"nvd","external_id":"CVE-2026-130082","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-130082","severity":null,"published_at":"2026-11-16T22:18:24+00:00","modified_at":"2026-11-16T22:18:24+00:00","first_seen_at":"2026-11-16T22:39:15+00:00","fetched_at":"2026-11-16T22:39:15+00:00","note":null}],"documents":[{"id":172937,"url":"https://github.com/django-tenants/django-tenants/commit/46d89c0fccc820f88657e6ec152ba855072571ff","title":"Patch: github.com","kind":"other","source":"nvd","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Patch: github.com"},{"id":172938,"url":"https://github.com/django-tenants/django-tenants/releases/tag/v4.0.1","title":"Release notes: github.com","kind":"release","source":"nvd","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Release notes: github.com"},{"id":172939,"url":"https://github.com/django-tenants/django-tenants/security/advisories/GHSA-693j-7v9f-x7pw","title":"Vendor advisory: github.com","kind":"vendor","source":"nvd","publisher":"vendor","text":null,"published_at":"2026-10-24T10:06:00+00:00","relation":"advisory","confidence":null,"note":"Vendor advisory: github.com"},{"id":172940,"url":"https://www.vulncheck.com/advisories/django-tenants-3.4.8-before-4.0.1-sql-injection-via-unescaped-schema-name","title":"Third-party advisory: www.vulncheck.com","kind":"advisory","source":"nvd","publisher":"research","text":null,"published_at":null,"relation":"advisory","confidence":null,"note":"Third-party advisory: www.vulncheck.com"}],"disclosures":[],"exploit_sources":[],"notice":"Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai"}