CVE-2022-28346

An issue was discovered 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
19%
Percentile
97.3
In the wild
Unconfirmed
What it is

⚠️ This sneaky SQL injection vulnerability lurks in Django's QuerySet methods like a thief in the night, waiting for the right crafted dictionary to strike! 🔍 Imagine a restaurant where the chef takes orders without verifying what’s written on the ticket. If someone slips in a wildcard ingredient, the dish could end up being completely different than intended — that’s what this vulnerability allows for with column aliases! An attacker could exploit this flaw to manipulate SQL queries, potentially leading to unauthorized data access or corruption. It’s like handing someone the menu but forgetting to check their identity before they start cooking up some chaos!

Put simply

Imagine a restaurant where the chef takes orders without verifying what’s written on the ticket. If someone slips in a wildcard ingredient, the dish could end up being completely different than intended — that’s what this vulnerability allows for with column aliases! This vulnerability in Django allows SQL injection through unsafe handling of column aliases in the QuerySet.annotate(), aggregate(), and extra() methods when a crafted dictionary is passed as **kwargs. It opens the door for malicious SQL commands to sneak in under the radar.

What to do

An attacker could exploit this flaw to manipulate SQL queries, potentially leading to unauthorized data access or corruption. It’s like handing someone the menu but forgetting to check their identity before they start cooking up some chaos! Upgrade Django to version 2.2.28, 3.2.13, or 4.0.4 to patch this vulnerability. Additionally, review your code for any usage of QuerySet methods where untrusted input might be included in the dictionary expansion. You’ve got this! Stay vigilant and secure your Django app with these updates! 🛡️

The record
Technical detail
CVSS
Not scored
CVSS v4.0
Not supplied
EPSS
0.18661 · 97.3th percentile
Published
2022-04-12T00:00Z
EPSS history
Timeline
  • 12 APR 00:00Z
    An issue was discovered in Django 2.2 before 2.2.28, 3.2 before 3.2.13, and 4.0 before 4.0.4
    cvelistv5