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

django-debug-toolbar Updated 02 Oct 2025

Summary

14/04/2021
Yes i
High
9.8

CVE-2021-30459: 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 expl... Affects django-debug-toolbar across 3 version ranges.

>= 0.10.0, < 1.11.1 >= 2.0, < 2.2.1 >= 3.0, < 3.2.1

Fixed in 1.11.1, 2.2.1 or 3.2.1, depending on the release line you run. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

django-debug-toolbar is a Django application that provides a set of panels displaying various debug information about the current request/response. It helps developers debug their Django applications by showing detailed information about queries, cache, signals, and more. This package is widely used in Django projects to aid in development and debugging processes. However, versions before 1.11.1, 2.x before 2.2.1, and 3.x before 3.2.1 are vulnerable to a SQL Injection issue in the SQL Panel.

Vulnerability Detail

The SQL Injection vulnerability in django-debug-toolbar allows attackers to execute SQL statements by manipulating the raw_sql input field of the SQL explain, analyze, or select form. This can lead to unauthorized access, data leakage, or even complete compromise of the underlying database. The vulnerability arises due to insufficient input validation and sanitization, allowing malicious SQL code to be executed within the application's database context.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • >= 0.10.0, < 1.11.1 1.11.1
    pip install --upgrade "django-debug-toolbar==1.11.1"
  • >= 2.0, < 2.2.1 2.2.1
    pip install --upgrade "django-debug-toolbar==2.2.1"
  • >= 3.0, < 3.2.1 3.2.1
    pip install --upgrade "django-debug-toolbar==3.2.1"

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

As a temporary workaround, users can disable or remove the SQL Panel from the django-debug-toolbar configuration. This can be achieved by modifying the toolbar configuration in the Django settings file. By removing the SQL Panel, the vulnerable functionality is no longer accessible, reducing the risk of exploitation. However, this workaround may impact the ability to debug and analyze SQL queries during development.

Conclusion

The SQL Injection vulnerability in django-debug-toolbar poses a significant risk to applications using vulnerable versions. It is highly recommended to upgrade to the fixed versions (1.11.1, 2.2.1, or 3.2.1) or apply the provided workaround to mitigate the issue. Regularly updating dependencies and staying informed about security vulnerabilities is crucial for maintaining the security of Django applications. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for django-debug-toolbar →

Share this vulnerability

FAQ

The vulnerability allows attackers to execute arbitrary SQL statements, potentially leading to unauthorized access, data leakage, or complete compromise of the database.

No, only versions before 1.11.1, 2.x before 2.2.1, and 3.x before 3.2.1 are vulnerable. It is recommended to upgrade to the fixed versions to mitigate the issue.

At the time of this advisory, there is no known public exploit available. However, it is important to apply the recommended fixes to prevent any potential exploitation.

Yes, this vulnerability can be exploited remotely if the affected application is accessible over the network. Attackers can send crafted requests to exploit the SQL Injection issue.

There is no evidence of active exploitation at the time of this advisory. However, it is crucial to apply the necessary patches to prevent any potential exploitation in the future.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • >= 0.10.0, < 1.11.1 1.11.1
    pip install --upgrade "django-debug-toolbar==1.11.1"
  • >= 2.0, < 2.2.1 2.2.1
    pip install --upgrade "django-debug-toolbar==2.2.1"
  • >= 3.0, < 3.2.1 3.2.1
    pip install --upgrade "django-debug-toolbar==3.2.1"

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback