SQL Injection Affecting django package, versions [4.2,4.2.25)[5.1,5.1.13)[5.2,5.2.7)


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.01% (1st percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about SQL Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PYTHON-DJANGO-13179650
  • published2 Oct 2025
  • disclosed1 Oct 2025
  • creditsw0rd1ight

Introduced: 1 Oct 2025

NewCVE-2025-59681  (opens in a new tab)
CWE-89  (opens in a new tab)

How to fix?

Upgrade django to version 4.2.25, 5.1.13, 5.2.7 or higher.

Overview

Affected versions of this package are vulnerable to SQL Injection in the QuerySet.annotate(), QuerySet.alias(), QuerySet.aggregate(), and QuerySet.extra() methods when a specially crafted dictionary is passed using dictionary expansion as **kwargs, leading to unsafe column aliases on MySQL and MariaDB. An attacker can access sensitive information or manipulate query results by injecting malicious SQL through these parameters.

CVSS Base Scores

version 4.0
version 3.1