Django CVE-2026-132092: SQL injection, upgrade to 5.2.20, 6.0.11 or 6.1.4

Django releases older than 6.1.4, 6.0.11 and 5.2.20 allow SQL injection in range and in lookups. Who is affected, how to check and how to fix it.

CVE-2026-132092: SQL injection in Django range and in lookups

TL;DR

  • What: Django's range and in lookups can be used for SQL injection when a query uses aliases or key transforms with percent signs in them (CVE-2026-132092, weakness CWE-89).
  • Impact: an attacker who can influence the values reaching those lookups can run their own SQL against your database, which means reading, changing or deleting data.
  • Severity: NVD lists a CVSS v3.1 score of 9.8, critical, and a CVSS v4.0 score of 9.3.
  • Exploited: we have no record that it is listed as exploited, but the fix was published on December 2, 2026 and the details are public.
  • Fix: upgrade to 6.1.4, 6.0.11 or 5.2.20, depending on your series, then rebuild and redeploy every image that carries Django.

What the vulnerability is

Django is a widely used Python web framework, and its database layer turns Python expressions into SQL. The range and in lookups are the filters you use when you ask for rows whose value lies between two bounds or inside a list. The flaw is that, when a query uses aliases or key transforms that include percent signs, those lookups build their SQL in a way that allows injection.

SQL injection (CWE-89) is the old, well understood failure in which data is treated as part of the query. When it works, the attacker is no longer limited to what your application meant to ask the database. NVD records the flaw as CVE-2026-132092, published on December 2, 2026, and reports the vector as network reachable with low complexity, no privileges and no user interaction.

Three series are affected, each with its own fix: 6.1 is fixed in 6.1.4, 6.0 in 6.0.11 and 5.2 in 5.2.20. It adds that earlier, unsupported series were not assessed, so they could be vulnerable too: 5.1.x, 5.0.x, then 4.2.x. That sentence matters if you are one of the many teams that stayed on an older release.

Why it matters now

A critical injection flaw in a framework is different from one in a single application. The same weakness sits underneath every project that uses the framework, and each of those projects chooses its own queries. Nobody can tell you from the outside which of your views are reachable, so the practical answer is to fix the dependency everywhere it appears.

The second reason is the gap between the release and your running systems. A Django version is pinned in a requirements file, baked into a container image and sometimes installed from a distribution package on a server. Each of those is updated by a different person at a different time. When you track libraries by what is actually deployed, Stackurity's remediation view turns that into one list of upgrades, and the comparison with Snyk for deployed apps explains how that differs from scanning source repositories alone.

The third reason is the state of the record. The NVD entry is still marked Deferred and lists no machine-readable affected versions, so tools that rely only on that field may not flag it yet. The affected and fixed versions above come from the entry's description, and the authoritative text is the Django project's own security release announcement, which NVD links. For another recent library flaw where the fix reaches you only after a rebuild, see our post on Pion DTLS.

Am I affected?

You are affected if any application you run uses a release older than the fix for its series (6.1.4, 6.0.11 or 5.2.20), and you should assume the same for older series until you have upgraded. To check one machine or project by hand:

  • Run python -m django --version inside the application's virtual environment to print the Django version it uses.
  • Run pip show django to see the installed version and where it lives.
  • Search requirements.txt, poetry.lock or Pipfile.lock in the repository for the pinned version.
  • For a container, run the same command inside it, for example with docker exec on a running container.

Two caveats. First, a container image keeps the version it was built with until you rebuild it, so checking the repository is not enough. Second, if Django came from a Linux distribution package (for example python3-django), the distribution may fix the flaw with a backported patch and leave the version number unchanged. In that case compare against the distribution's own security tracker rather than the version string alone.

How to fix CVE-2026-132092

  1. Find every use. List the repositories, servers and images that include Django, using the checks above, and note the series, the current version and the owner of each.
  2. Upgrade to the fixed release for your series. Move to 6.1.4 on 6.1, 6.0.11 on 6.0 or 5.2.20 on 5.2. A patch release inside a series is the smallest change, so prefer it over a jump to a new series today. Change the pin in your requirements or lock file and install it, for example with pip install --upgrade django if you do not pin a version.
  3. Plan a move off unsupported series. If you run 5.1.x, 5.0.x or 4.2.x, the Django project did not evaluate them, so no fixed version is named for them. Move to 5.2.20 or later, and read the project's upgrade notes before you do.
  4. Rebuild and redeploy. Rebuild every image that carries Django and roll out the new image, then restart long-running workers so no process keeps the old code in memory. Run your test suite and your most important queries before you ship.
  5. Confirm the fix. Run python -m django --version again in the new environment and check that it reports the fixed version or a later one in your series.

If you cannot upgrade today, NVD describes no workaround. Reduce exposure by keeping the application off untrusted networks where you can, and by watching your database logs for unusual queries. The full details are in the NVD entry, which links the Django project's announcement.

How to check with Stackurity

Stackurity keeps one live inventory of what runs on your servers, in deployed applications, repositories and container images. A read-only agent on Linux servers reads installed packages and the libraries deployed applications actually load, and repository scans read PyPI dependencies from the files in a repository. New advisories are matched against that inventory every hour, and each team gets a short list of upgrades, most urgent first. A Django release before the fixed one in its series therefore shows up as a vulnerable component in every repository, server and image that carries it, with the version to move to. After you upgrade, Stackurity checks again and records whether the issue is really gone.

Be clear about the limits. Libraries copied into an application outside a package manager or lockfile are not covered, so a vendored copy of Django needs a manual check. Because the NVD entry carries no affected-version data yet, a match depends on advisory data that names the package, so keep the Django announcement open next to your results. Start a free trial to see which of your repositories, servers and images carry an affected release.

FAQ

Which Django versions are affected by CVE-2026-132092?

the 6.1 series before 6.1.4, the 6.0 series before 6.0.11 and the 5.2 series before 5.2.20. The description also says that earlier, unsupported series were not assessed and could be affected, including 5.1.x, 5.0.x, then 4.2.x.

What are the fixed versions?

Upgrade to 6.1.4 on the 6.1 series, 6.0.11 on the 6.0 series or 5.2.20 on the 5.2 series. If you run an unsupported series, plan a move to a supported one, because the Django project did not evaluate those series.

Is CVE-2026-132092 exploited in the wild?

We have no record that it is listed as exploited, so we do not claim it is. The flaw is rated critical and the vector needs no credentials, so treat internet-facing Django applications as urgent.

Does the flaw affect every Django application?

Only code that passes certain values into the range and in lookups is exposed: the trigger is a query that uses aliases or key transforms with percent signs in them. You may not be able to rule that out by reading your code quickly, so upgrading is safer than trying to prove you are unaffected.

How do I find which of my projects use Django?

Search requirements files, lockfiles and installed packages for django, and remember that images keep old code until they are rebuilt. Stackurity does this across repositories, servers and images and lists each place with the upgrade that clears it.

Sources: NIST National Vulnerability Database, CVE-2026-132092 and Stackurity product facts.