The short version
- AffectedDjango 6.1.0 to 6.1.3, 6.0.0 to 6.0.10 and 5.2.0 to 5.2.19 (Django advisory). Django says 5.1, 5.0 and 4.2 were not evaluated and may also be affected (CVE record).
- Fixed in2 December 20266.1.4, 6.0.11 and 5.2.20, released 2 December 2026 and on PyPI the same day.
- Severity"high" under the Django security policy. The Django Software Foundation, as CVE numbering authority, also set CVSS 3.1 9.8 and CVSS 4.0 9.3 (CVE record).
- ExploitedNot known. Not in CISA KEV, no EPSS score, no report of attacks (OffSeq).
1. What CVE-2026-132092 is
Django builds SQL for a filter such as field__range=(a, b) or field__in=[...] as a template with %s placeholders plus a list of parameters, and the database driver fills the placeholders so values never become SQL. That only holds while placeholders and parameters stay equal in number through compilation.
Two code paths broke that assumption when a column alias or a JSONField key transform contained a literal percent sign. Such names are still legal, although Django 6.0 deprecated them and plans to remove them in Django 2028 (Django 6.0 release notes, 6.1.4 release notes). The range lookup formatted BETWEEN %s AND %s from the first two right-hand values without checking that exactly two were given, so a query that wrongly passed three or more left spare parameters that could shift into the SQL text. In the in lookup, a bilateral transform, a custom transform written with bilateral = True so it applies to both sides of the comparison, can compile None into a parameter-less IS NULL, which again unbalances placeholders and parameters (fix commit, custom lookups).
The fix is small: the range lookup now requires exactly two values and raises ValueError otherwise, and batch parameter processing uses a strict zip that raises instead of shifting items (6.1.4 release notes, fix commit). Cristian Panaro reported it on 11 November 2026, Django confirmed it on 18 November 2026, and the fix shipped on 2 December 2026 (CVE record).
2. Impact: who is exposed and how badly
The CVSS vector says network, no privileges, no user interaction. That is the worst case: an application where request input decides which JSONField key is selected or filtered, and where one of the two flawed code paths is in use. Django's own test for the in case takes the key name from a variable called "user_query_field", which is the realistic shape: an API that lets callers pick JSON keys (fix commit). There the attacker reaches the database with the application's own credentials and can read or change whatever that account can.
The preconditions narrow it a lot. If your project never passes user input into values(), annotate() or filter key names, never feeds __range more than two values, and defines no bilateral transforms, the bug is in your copy of Django but no known path reaches it. Django's advisory does not say how common the preconditions are.
| Series | Affected | Fixed in | Support status |
|---|---|---|---|
| 6.1 | 6.1.0 to 6.1.3 | 6.1.4 | Supported until December 2027 |
| 6.0 | 6.0.0 to 6.0.10 | 6.0.11 | Supported until April 2027 |
| 5.2 LTS | 5.2.0 to 5.2.19 | 5.2.20 | Extended support until April 2028 |
| 5.1, 5.0, 4.2 and older | not evaluated, may be affected | none | End of life (download page) |
Distribution packages lag. Debian marks python-django vulnerable and unfixed in every release: bookworm security has 3:3.2.25-0+deb12u7, trixie security has 3:4.2.30-0+deb13u1, unstable has 3:5.2.19-1 (Debian tracker). Debian bookworm and trixie ship 3.2 and 4.2, which Django did not evaluate. The Ubuntu tracker timed out on every attempt while this page was written, Alpine has no entry, and Red Hat has no page. Not affected: anything on 5.2.20, 6.0.11, 6.1.4 or later.
3. How to check if you are affected
- Ask the running Django for its version. Django documents
django-admin version, andpython -m djangois interchangeable with it (django-admin reference). Run it where traffic is served, not on a laptop. Anything below 5.2.20, 6.0.11 or 6.1.4 for its series is affected.
python -m django version
pip show django
- Check the lockfile you deploy from (pip show).
grep -i '^django==' requirements*.txt
grep -i -A1 '^name = "django"' uv.lock poetry.lock
grep -i '"django"' Pipfile.lock
pip freeze | grep -i '^django=='
- Container images. There is no official Django image to swap; Docker Hub's
djangoimage has been deprecated since 31 December 2016 in favour ofpythonpluspip install(Docker Hub). Check the built image, not theFROMline.
docker run --rm --entrypoint python <your-image> -m django version
docker exec <container> python -m django version
- Kubernetes. List the images in use, then run the version command inside one pod per image (kubectl jsonpath).
kubectl get pods -A -o jsonpath='{range .items[*]}{.metadata.namespace}{" "}{.metadata.name}{" "}{.spec.containers[*].image}{"\n"}{end}'
kubectl exec -n <namespace> <pod> -- python -m django version
- AWS ECS and Lambda. Read the image from each task definition and check it as in step 3. For Lambda, Django arrives in the deployment package or a layer; download it and read the
djangodistribution's metadata (describe-task-definition, get-layer-version).
aws ecs describe-task-definition --task-definition <family> --query 'taskDefinition.containerDefinitions[*].image'
aws lambda get-layer-version --layer-name <name> --version-number <n> --query 'Content.Location'
- Check whether your code has the preconditions. Search for custom bilateral transforms and for
__rangefilters built from lists of unknown length. Running the test suite with warnings on surfaces the 6.0 deprecation message "Using percent signs in a column alias is deprecated." (fix commit tests).
grep -rn 'bilateral = True' --include='*.py' .
grep -rn '__range' --include='*.py' .
python -W always manage.py test 2>&1 | grep -i 'percent signs'
4. How to fix it
- Pick the target. Stay in your series: 5.2.x goes to 5.2.20, 6.0.x to 6.0.11, 6.1.x to 6.1.4. Projects on 5.1, 5.0 or 4.2 have no fix and should move to 5.2.20, the LTS release.
- Change the pin and regenerate the lock. Each command changes files (pip install, uv lock, poetry update).
pip install --upgrade "Django>=5.2.20,<5.3" # changes the environment; then pip freeze into requirements.txt
uv lock --upgrade-package django # changes uv.lock
poetry update django # changes poetry.lock and installs into the environment
- Rebuild and redeploy. A pip upgrade on a host needs the application server restarted, for example a gunicorn or uwsgi reload. A container needs the image rebuilt and the Deployment, ECS service or Lambda function rolled to it.
- Confirm the running process. Repeat check step 1 against the live host, pod or task. The answer must be 5.2.20, 6.0.11 or 6.1.4.
- Mind the other fixes in the same release. The three releases also fix CVE-2026-124827, a "high" file-write bug in GeoDjango
RasterField, and five lower-rated issues, one of which asks you to clear caches after upgrading (6.1.4 release notes).
5. If you cannot patch today
Django documents no workaround; the advisory's only resolution is the upgrade. What follows is derived from the preconditions the advisory describes, not from a vendor-published mitigation.
- Remove percent signs from column aliases,
values()andannotate()names, and JSONField key transforms. Django 6.0 already deprecates them. - Never let request input choose which JSONField keys are selected or filtered. Map user choices to an allow-list of key names.
- Fix any
__rangefilter that can receive more than two items. After the upgrade such a query raisesValueError, so this also prevents a regression. - Review any custom transform with
bilateral = True; with none, theinpath is not reachable.
These close the known paths but leave the vulnerable code in place. Generic exposure cuts still apply: keep internal APIs off the public internet and give the application's database account only the rights it needs.
6. How to tell if you were already hit
Nothing has been published. Django's advisory has no indicators. As of 2 December 2026, OffSeq reports no known exploitation, no public exploit code and no CISA KEV listing, and ZeroHour shows no EPSS score and no workaround (OffSeq, ZeroHour).
If you have the preconditions, search application and database logs for requests whose JSON key or alias parameters contain percent signs. A successful SQL injection usually ends in a bulk read of user tables and of credentials stored in the database, which are then used from elsewhere. If you find such requests, rotate those secrets and check for rows changed in the same window.
7. How autonomous DevOps handles a bug like this
Check steps 2, 3 and 5 above are inventory questions: what each requirements.txt, uv.lock or poetry.lock pins for django, which image each ECS task definition runs, and whether that workload faces the internet. Compass, Beamreach's open-source operations agent for AWS, keeps that map current, so the answer is a lookup rather than a search across repositories (Compass). Python is on its default product list, packages are also matched through OSV by package URL, and CVSS 9.8 clears its 7.0 threshold, so it opens the fix without a click.
The fix is the kind of change its patch pull requests make: a direct dependency pin moved from Django==5.2.19 to Django==5.2.20, inside the same series, with the repository's CI and image build run against it and an optional canary on a staging copy. Compass never merges; a person does (patching docs).
The limits here are real. If Django arrives as a transitive dependency of another package, Compass does not move it; that finding waits in an inbox. Check step 6 and the mitigation section are code changes, which Compass does not write. It covers AWS only, not Kubernetes clusters as such or on-premises hosts. It is not a WAF and does not block the injected request.
A honeytoken helps less here than with a code execution bug. SQL injection runs through the application's own database connection, so an attacker never touches the decoy AWS key or database login in the task's environment unless they escalate further. If they do, the policy-gated restart or key deactivation applies, with snapshot and rollback, as in our PHP2Shell incident in October 2026 (write-up).
8. Sources
- Django security releases issued: 6.1.4, 6.0.11, and 5.2.20 (2 December 2026): https://www.djangoproject.com/weblog/2026/dec/02/security-releases/
- Django 6.1.4 release notes: https://docs.djangoproject.com/en/dev/releases/6.1.4/
- Django 6.0.11 release notes: https://docs.djangoproject.com/en/dev/releases/6.0.11/
- Django 5.2.20 release notes: https://docs.djangoproject.com/en/dev/releases/5.2.20/
- Django security archive: https://docs.djangoproject.com/en/dev/releases/security/
- Django security policy and severity levels: https://docs.djangoproject.com/en/dev/internals/security/
- Django fix commit on main, 18 November 2026: https://github.com/django/django/commit/1eb6104c5805d55fca4cd6cf9c715521934d45fc
- Django 6.0 release notes (percent sign deprecation): https://docs.djangoproject.com/en/6.0/releases/6.0/
- Django, custom lookups and bilateral transforms: https://docs.djangoproject.com/en/6.1/howto/custom-lookups/
- Django, querying JSONField key transforms: https://docs.djangoproject.com/en/6.1/topics/db/queries/
- Django, django-admin version command: https://docs.djangoproject.com/en/6.1/ref/django-admin/
- Django download and supported versions page: https://www.djangoproject.com/download/
- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-132092
- CVE record JSON: https://raw.githubusercontent.com/CVEProject/cvelistV5/main/cves/2026/132xxx/CVE-2026-132092.json
- NVD entry (mirrors the CNA scores, no NVD analysis yet): https://nvd.nist.gov/vuln/detail/CVE-2026-132092
- GitHub advisory GHSA-c7wh-8726-4mmj: https://github.com/advisories/GHSA-c7wh-8726-4mmj
- OSV entry: https://osv.dev/vulnerability/CVE-2026-132092
- Debian security tracker: https://security-tracker.debian.org/tracker/CVE-2026-132092
- PyPI, Django 6.1.4: https://pypi.org/project/Django/6.1.4/
- PyPI, Django 6.0.11: https://pypi.org/project/Django/6.0.11/
- PyPI, Django 5.2.20: https://pypi.org/project/Django/5.2.20/
- Docker Hub, deprecated django image: https://hub.docker.com/_/django
- pip show: https://pip.pypa.io/en/stable/cli/pip_show/
- pip install: https://pip.pypa.io/en/stable/cli/pip_install/
- uv command reference: https://docs.astral.sh/uv/reference/cli/
- Poetry command reference: https://python-poetry.org/docs/cli/
- kubectl JSONPath: https://kubernetes.io/docs/reference/kubectl/jsonpath/
- AWS CLI, ecs describe-task-definition: https://docs.aws.amazon.com/cli/latest/reference/ecs/describe-task-definition.html
- AWS CLI, lambda get-layer-version: https://docs.aws.amazon.com/cli/latest/reference/lambda/get-layer-version.html
- OffSeq Radar, 2 December 2026: https://radar.offseq.com/threat/cve-2026-132092-cwe-89-sql-injection-in-djangoproject-django-917c4350e59383f5
- ZeroHour, 2 December 2026: https://zerohour.day/cves/CVE-2026-132092
- Compass patching docs: https://github.com/beamreach-ai/compass/blob/main/docs/patching.md
- PHP2Shell contained in two minutes: https://beamreach.ai/docs/php2shell-contained-in-two-minutes.html
9. FAQ
Is my Django project affected by CVE-2026-132092?
If it runs Django 6.1.0 to 6.1.3, 6.0.0 to 6.0.10 or 5.2.0 to 5.2.19, the vulnerable code is present and you should upgrade. The known attack paths also need a percent sign in a column alias or JSONField key transform, plus either a __range filter given more than two values or a custom bilateral transform used with __in. Django did not evaluate 5.1, 5.0 or 4.2, so treat those as affected.
Which Django version fixes CVE-2026-132092?
Django 6.1.4, 6.0.11 and 5.2.20, all released on 2 December 2026 and on PyPI the same day. End-of-life series get no fix; 5.2.20 is the long-term support release to move to.
Is CVE-2026-132092 being exploited?
Not as far as anyone has reported by 3 December 2026. Django's advisory says nothing about attacks, the CVE is not in CISA's Known Exploited Vulnerabilities catalogue, and no EPSS score is published yet.
Is there a workaround for the Django range and in lookup SQL injection?
Django documents none. Removing percent signs from aliases and key transforms, keeping user input out of JSON key selection, and fixing any __range call that can receive more than two values close the known paths, but they do not remove the vulnerable code. Upgrade.
Related
Last checked: 3 December 2026. Written from the vendor advisory and the CVE record, linked below. Confirm against the vendor advisory before acting.
Related: CVE Watch: all pages · How to protect against *2Shell vulnerabilities · Automated patching compared · AWS canary credentials
Beamreach