CVE-2021-30459 SQL Injection via in django-debug-toolbar

Critical 9.8 Published Updated

Attackers can execute arbitrary SQL statements via the SQL Panel in Django Debug Toolbar, requiring the toolbar to be enabled.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2021-30459?

CVE-2021-30459 is a critical SQL injection vulnerability in n/a, published on 14 Apr 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

A SQL Injection issue in the SQL Panel in Jazzband Django Debug Toolbar before 1.11.1, 2.x before 2.2.1, and 3.x before 3.2.1 allows attackers to execute SQL statements by changing the raw_sql input field of the SQL explain, analyze, or select form.

Weakness: CWE-89

Which versions are affected by CVE-2021-30459?

7 open source packages ship an affected version, including django-debug-toolbar. It affects 1 product.

PackageAffectedFixed in
django-debug-toolbar PyPIFrom 0.10.01.11.1, 2.2.1, 3.2.1
django-debug-toolbar PyPIFrom 0.10.01.11.1
django-debug-toolbar PyPIFrom 0.10.01.11.1
django-debug-toolbar PyPIFrom 2.0a12.2.1
django-debug-toolbar PyPIFrom 2.0a12.2.1
django-debug-toolbar PyPIFrom 3.0a13.2.1
1 more packages
django-debug-toolbar PyPIFrom 3.0a13.2.1
Linux distribution packages (2)
python-django-debug-toolbar openSUSE:TumbleweedAll versions4.3-1.2
python-django-debug-toolbar openSUSE:TumbleweedAll versions7.0.0-1.1

Products include Jazzband Django Debug Toolbar.

How do I fix CVE-2021-30459?

Upgrade django-debug-toolbar to a fixed version for your release line: 1.11.1, 2.2.1 or 3.2.1.

Use parameterised queries everywhere and never build SQL by joining strings. Upgrade affected software first; a web application firewall only buys time. More about SQL injection.

Is CVE-2021-30459 being exploited?

There is no known exploitation of CVE-2021-30459 in the wild and no public exploit code.

Sources

Also known as GHSA-pghf-347x-c2gj, PYSEC-2021-10, openSUSE-SU-2024:11225-1, openSUSE-SU-2024:14137-1, openSUSE-SU-2026:11271-1.

Is CVE-2021-30459 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free