{"id":"CVE-2025-59681","aliases":["CVE-2025-59681","GHSA-hpr9-3m2g-3j9p","BIT-DJANGO-2025-59681","PYSEC-2025-106"],"related":[],"kind":"vulnerability","state":"published","title":"Django vulnerable to SQL injection in column aliases","summary":"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).","summarySource":"cvelist","descriptions":[{"lang":"en","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).","source":"cvelist"},{"lang":"es","text":"Se descubrió un problema en Django 4.2 anterior a 4.2.25, 5.1 anterior a 5.1.13 y 5.2 anterior a 5.2.7. QuerySet.annotate(), QuerySet.alias(), QuerySet.aggregate() y QuerySet.extra() están sujetos a inyección SQL en los alias de columna, al usar un diccionario adecuadamente diseñado, con expansión de diccionario, como los kwargs pasados a estos métodos (en MySQL y MariaDB).","source":"nvd"}],"published":"2025-10-01T00:00:00.000Z","modified":"2026-10-12T15:10:00.207Z","severity":{"scorer":"mitre","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:L/A:N","score":7.1,"rating":"HIGH"},"severities":[{"scorer":"mitre","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:L/A:N","score":7.1,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:L/A:N","score":7.1,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"Bitnami Vulnerability Database","scheme":"rating","rating":"CRITICAL"}],"cwes":["CWE-89"],"affected":[{"ranges":[{"type":"custom","introduced":"4.2","fixed":"4.2.25","status":"affected"},{"type":"custom","introduced":"5.1","fixed":"5.1.13","status":"affected"},{"type":"custom","introduced":"5.2","fixed":"5.2.7","status":"affected"}],"vendor":"djangoproject","product":"Django","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"4.2","status":"affected","fixed":"4.2.25"}],"ecosystem":"PyPI","package":"django","purl":"pkg:pypi/django","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"5.1","status":"affected","fixed":"5.1.13"}],"ecosystem":"PyPI","package":"django","purl":"pkg:pypi/django","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"5.2","status":"affected","fixed":"5.2.7"}],"ecosystem":"PyPI","package":"django","purl":"pkg:pypi/django","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"4.2","fixed":"4.2.25"},{"status":"affected","introduced":"5.1","fixed":"5.1.13"},{"status":"affected","introduced":"5.2","fixed":"5.2.7"}],"vendor":"djangoproject","product":"django","cpe":"cpe:2.3:a:djangoproject:django:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"4.2","status":"affected","fixed":"4.2.25"},{"type":"ecosystem","introduced":"5.1","status":"affected","fixed":"5.1.13"},{"type":"ecosystem","introduced":"5.2","status":"affected","fixed":"5.2.7"}],"ecosystem":"PyPI","package":"django","purl":"pkg:pypi/django","source":"pysec"},{"ranges":[{"type":"semver","introduced":"4.2.0","status":"affected","fixed":"4.2.25"},{"type":"semver","introduced":"5.1.0","status":"affected","fixed":"5.1.13"},{"type":"semver","introduced":"5.2.0","status":"affected","fixed":"5.2.7"}],"ecosystem":"Bitnami","package":"django","purl":"pkg:bitnami/django","source":"bitnami"}],"references":[{"url":"https://docs.djangoproject.com/en/dev/releases/security/","tags":["advisory","vendor-advisory"],"sources":["cvelist","nvd","pysec","bitnami"]},{"url":"https://groups.google.com/g/django-announce","tags":["advisory","release-notes","vendor-advisory","web"],"sources":["cvelist","ghsa","nvd","pysec","bitnami"]},{"url":"https://www.djangoproject.com/weblog/2025/oct/01/security-releases/","tags":["advisory","release-notes","vendor-advisory"],"sources":["cvelist","nvd","pysec","bitnami"]},{"url":"http://www.openwall.com/lists/oss-security/2025/10/01/3","tags":["web"],"sources":["cvelist","ghsa","nvd","pysec","bitnami"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-59681","tags":["advisory","web"],"sources":["ghsa","bitnami"]},{"url":"https://github.com/django/django/commit/41b43c74bda19753c757036673ea9db74acf494a","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/django/django/commit/43d84aef04a9e71164c21a74885996981857e66e","tags":["web"],"sources":["ghsa"]},{"url":"https://docs.djangoproject.com/en/dev/releases/security","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/django/django","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/django/PYSEC-2025-106.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://www.djangoproject.com/weblog/2025/oct/01/security-releases","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/advisories/GHSA-hpr9-3m2g-3j9p","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"mitre","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2025-10-01T19:12:04.911Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-59681","url":"https://www.cve.org/CVERecord?id=CVE-2025-59681","licence":"CVE Terms of Use","modified":"2025-11-04T21:13:55.046Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-hpr9-3m2g-3j9p","url":"https://github.com/advisories/GHSA-hpr9-3m2g-3j9p","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:29.812Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-59681","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-59681","licence":"Public domain","modified":"2026-10-12T15:10:00.207Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2025-106","url":"https://osv.dev/vulnerability/PYSEC-2025-106","licence":"CC-BY-4.0","modified":"2026-06-10T17:01:10.861Z"},{"source":"bitnami","name":"Bitnami Vulnerability Database","id":"BIT-DJANGO-2025-59681","url":"https://osv.dev/vulnerability/BIT-DJANGO-2025-59681","licence":"Apache-2.0","modified":"2026-09-08T08:46:37.069Z"}],"updatedAt":"2026-11-25T22:59:05.412Z","epss":{"score":0.00662,"percentile":0.52952,"date":"2026-12-01T12:00:22.000Z"}}