{"id":"CVE-2025-59681","published":"2025-10-01T00:00:00Z","modified":"2025-11-04T21:13:55Z","title":"An issue was discovered in Django 4.2 before 4.2.25, 5.1 before 5.1.13, and 5.2 before 5.2.7","vendor":"djangoproject","product":"Django","tier":"tail","description":{"text":"An issue was discovered in Django 4.2 before 4.2.25, 5.1 before 5.1.13, and 5.2 before 5.2.7. QuerySet.annotate(), QuerySet.alias(), QuerySet.aggregate(), and QuerySet.extra() are subject to SQL injection in column aliases, when using a suitably crafted dictionary, with dictionary expansion, as the **kwargs passed to these methods (on MySQL and MariaDB).","provenance":"source","from":"CVE.org"},"cvss":{"score":7.1,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:L/A:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00757,"percentile":0.51418,"provenance":"source"},"cwes":[{"id":"CWE-89","name":"Improper Neutralization of Special Elements used in an SQL Command"}],"references":[{"url":"https://docs.djangoproject.com/en/dev/releases/security/","tags":[]},{"url":"https://groups.google.com/g/django-announce","tags":[]},{"url":"https://www.djangoproject.com/weblog/2025/oct/01/security-releases/","tags":[]},{"url":"http://www.openwall.com/lists/oss-security/2025/10/01/3","tags":[]}],"priority":{"score":15.3,"factors":[{"name":"EPSS percentile","points":10.28},{"name":"CVSS severity","points":4.97}]},"vendorSlug":"djangoproject","affectedVersions":[{"vendor":"djangoproject","product":"Django","versions":[">= 4.2, < 4.2.25",">= 5.1, < 5.1.13",">= 5.2, < 5.2.7"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial","timestamp":"2025-10-01T19:12:04.911087Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"Django","vulnerableRanges":[">=4.2, <4.2.25",">=5.1, <5.1.13",">=5.2, <5.2.7"],"patched":["4.2.25","5.1.13","5.2.7"],"from":["GHSA-hpr9-3m2g-3j9p","PYSEC-2025-106"],"provenance":"source"}],"summary":{"text":"A SQL injection flaw in Django's QuerySet methods annotate(), alias(), aggregate() and extra() lets attacker-controlled column aliases be injected into SQL when a crafted dictionary is expanded as keyword arguments (kwargs) into these calls, affecting Django 4.2 before 4.2.25, 5.1 before 5.1.13 and 5.2 before 5.2.7 on MySQL and MariaDB. Exploitation requires an application that passes untrusted input into these methods in that way, and the attacker must be able to supply that input over the network with low privileges, with the attack complexity being high.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:30:36Z"},"euvd":{"id":"EUVD-2025-32691","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-djangoproject-django-cve-2025-57833","packageHistory":[{"cve":"CVE-2025-32873","published":"2025-05-08","fixed":"5.2.1","kev":false},{"cve":"CVE-2025-48432","published":"2025-06-05","fixed":"5.2.2","kev":false},{"cve":"CVE-2025-57833","published":"2025-09-03","fixed":"5.2.6","kev":false,"link":{"from":"CVE-2025-57833","to":"CVE-2025-59681","relation":"successor","confidence":"high","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:Django","fromFixed":"4.2.24","toFixed":"4.2.25","daysApart":28},{"kind":"version-step","provenance":"source","package":"PyPI:Django","fromFixed":"5.1.12","toFixed":"5.1.13","daysApart":28},{"kind":"same-code","provenance":"machine","files":["django/db/models/sql/query.py"],"commits":["https://github.com/django/django/commit/102965ea93072fe3c39a30be437c683ec1106ef5","https://github.com/django/django/commit/31334e6965ad136a5e369993b01721499c5d1a92","https://github.com/django/django/commit/41b43c74bda19753c757036673ea9db74acf494a","https://github.com/django/django/commit/43d84aef04a9e71164c21a74885996981857e66e"],"basis":"shared file"},{"kind":"similar","provenance":"machine","score":0.85,"basis":"same product + CWE + description similarity"}]}},{"cve":"CVE-2025-59681","published":"2025-10-01","fixed":"5.2.7","kev":false},{"cve":"CVE-2025-13372","published":"2025-12-02","fixed":"5.2.9","kev":false},{"cve":"CVE-2025-64460","published":"2025-12-02","fixed":"5.2.9","kev":false},{"cve":"CVE-2025-13473","published":"2026-02-03","fixed":"6.0.2","kev":false}],"package":"PyPI:Django"}}