CVE-2022-28347

A SQL injection issue was discovered in QuerySet.explain() in Django 2.2 before 2.2.28, 3.2 before 3.2.13, and 4.0 before 4.0.4

published April 12, 2022

CVSS
β€”
EPSS
3%
Percentile
87.0
In the wild
Unconfirmed
What it is

⚠️ A sneaky SQL injection resides in Django's QuerySet.explain()! By crafting a specific dictionary, an attacker could potentially slip in malicious payloads where they shouldn't be. πŸ”₯ Think of it like a restaurant where a customer can secretly add ingredients to a dish without the chef's knowledge β€” instead of a delicious meal, it could lead to a disastrous outcome! An attacker could exploit this SQL injection vulnerability to manipulate database queries. Depending on the crafted payload, they might gain unauthorized access to sensitive data or even alter database records β€” a recipe for chaos!

Put simply

Think of it like a restaurant where a customer can secretly add ingredients to a dish without the chef's knowledge β€” instead of a delicious meal, it could lead to a disastrous outcome! This vulnerability occurs in Django when passing a crafted dictionary with injection payloads in the **options argument of QuerySet.explain(). It allows attackers to execute arbitrary SQL commands by exploiting how options are handled.

What to do

An attacker could exploit this SQL injection vulnerability to manipulate database queries. Depending on the crafted payload, they might gain unauthorized access to sensitive data or even alter database records β€” a recipe for chaos! To mitigate this issue, upgrade Django to version 2.2.28, 3.2.13, or 4.0.4. It's important to review any custom code that uses QuerySet.explain() to ensure it’s not vulnerable to injection attacks. You've got this! Just follow these steps and keep your Django application safe and sound! πŸ›‘οΈ

The record
Technical detail
CVSS
Not scored
CVSS v4.0
Not supplied
EPSS
0.02943 Β· 87.0th percentile
Published
2022-04-12T00:00Z
EPSS history
Timeline
  • 12 APR 00:00Z
    A SQL injection issue was discovered in QuerySet.explain() in Django 2.2 before 2.2.28, 3.2 before 3.2.13, and 4.0 before 4.0.4
    cvelistv5