{"id":"CVE-2022-34265","aliases":["CVE-2022-34265","GHSA-p64x-8rxx-wf6q","BIT-DJANGO-2022-34265","PYSEC-2022-213"],"related":[],"kind":"vulnerability","state":"published","title":"Django `Trunc()` and `Extract()` database functions vulnerable to SQL Injection","summary":"An issue was discovered in Django 3.2 before 3.2.14 and 4.0 before 4.0.6. The Trunc() and Extract() database functions are subject to SQL injection if untrusted data is used as a kind/lookup_name value. Applications that constrain the lookup name and kind choice to a known safe list are unaffected.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"An issue was discovered in Django 3.2 before 3.2.14 and 4.0 before 4.0.6. The Trunc() and Extract() database functions are subject to SQL injection if untrusted data is used as a kind/lookup_name value. Applications that constrain the lookup name and kind choice to a known safe list are unaffected.","source":"cvelist"},{"lang":"en","text":"An issue was discovered in Django 3.2 before 3.2.14 and 4.0 before 4.0.6. The `Trunc()` and `Extract()` database functions are subject to SQL injection if untrusted data is used as a kind/lookup_name value. Applications that constrain the lookup name and kind choice to a known safe list are unaffected.","format":"markdown","source":"ghsa"},{"lang":"es","text":"Se ha detectado un problema en Django versiones 3.2 anteriores a 3.2.14 y 4.0 anteriores a 4.0.6. Las funciones de base de datos Trunc() y Extract() están sujetas a inyección SQL si son usados datos no confiables como valor de kind/lookup_name. Las aplicaciones que restringen el nombre de búsqueda y la elección del tipo a una lista segura conocida no están afectadas","source":"nvd"}],"published":"2022-07-04T00:00:00.000Z","modified":"2026-09-08T08:46:36.455Z","severity":{"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"},"severities":[{"scorer":"GitHub","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":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","rating":"CRITICAL"},{"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":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:N/C:P/I:P/A:P","score":7.5,"rating":"HIGH"},{"scorer":"Bitnami Vulnerability Database","scheme":"rating","rating":"CRITICAL"}],"cwes":["CWE-89"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"3.2a1","status":"affected","fixed":"3.2.14"}],"ecosystem":"PyPI","package":"django","purl":"pkg:pypi/django","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"4.0a1","status":"affected","fixed":"4.0.6"}],"ecosystem":"PyPI","package":"django","purl":"pkg:pypi/django","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"3.2","fixed":"3.2.14"},{"status":"affected","introduced":"4.0","fixed":"4.0.6"}],"vendor":"djangoproject","product":"django","cpe":"cpe:2.3:a:djangoproject:django:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"ecosystem","introduced":"3.2","status":"affected","fixed":"3.2.14"},{"type":"ecosystem","introduced":"4.0","status":"affected","fixed":"4.0.6"}],"ecosystem":"PyPI","package":"django","purl":"pkg:pypi/django","source":"pysec"},{"ranges":[{"type":"semver","introduced":"3.2.0","status":"affected","fixed":"3.2.14"},{"type":"semver","introduced":"4.0.0","status":"affected","fixed":"4.0.6"}],"ecosystem":"Bitnami","package":"django","purl":"pkg:bitnami/django","source":"bitnami"}],"references":[{"url":"https://groups.google.com/forum/#%21forum/django-announce","tags":["web","x-transferred"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://docs.djangoproject.com/en/4.0/releases/security/","tags":["advisory","patch","vendor-advisory","web","x-transferred"],"sources":["cvelist","nvd","pysec","bitnami"]},{"url":"https://www.djangoproject.com/weblog/2022/jul/04/security-releases/","tags":["advisory","article","patch","vendor-advisory","x-transferred"],"sources":["cvelist","nvd","pysec","bitnami"]},{"url":"https://security.netapp.com/advisory/ntap-20220818-0006/","tags":["advisory","third-party-advisory","x-transferred"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://www.debian.org/security/2022/dsa-5254","tags":["advisory","third-party-advisory","vendor-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd","bitnami"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/HWY6DQWRVBALV73BPUVBXC3QIYUM24IK/","tags":["vendor-advisory","web","x-transferred"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/LTZVAKU5ALQWOKFTPISE257VCVIYGFQI/","tags":["vendor-advisory","web","x-transferred"],"sources":["cvelist","nvd","bitnami"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-34265","tags":["advisory","web"],"sources":["ghsa","bitnami"]},{"url":"https://github.com/django/django/commit/0dc9c016fadb71a067e5a42be30164e3f96c0492","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/django/django/commit/5e2f4ddf2940704a26a4ac782b851989668d74db","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/django/django/commit/877c800f255ccaa7abde1fb944de45d1616f5cc9","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/django/django/commit/a9010fe5555e6086a9d9ae50069579400ef0685e","tags":["web"],"sources":["ghsa"]},{"url":"https://docs.djangoproject.com/en/4.0/releases/security","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/advisories/GHSA-p64x-8rxx-wf6q","tags":["advisory"],"sources":["ghsa","pysec"]},{"url":"https://github.com/django/django","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/django/PYSEC-2022-213.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://groups.google.com/forum/#!forum/django-announce","tags":["web"],"sources":["ghsa","pysec"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/HWY6DQWRVBALV73BPUVBXC3QIYUM24IK","tags":["web"],"sources":["ghsa"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/LTZVAKU5ALQWOKFTPISE257VCVIYGFQI","tags":["web"],"sources":["ghsa"]},{"url":"https://security.netapp.com/advisory/ntap-20220818-0006","tags":["web"],"sources":["ghsa"]},{"url":"https://www.djangoproject.com/weblog/2022/jul/04/security-releases","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"mitre","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-34265","url":"https://www.cve.org/CVERecord?id=CVE-2022-34265","licence":"CVE Terms of Use","modified":"2025-02-13T16:32:45.198Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-p64x-8rxx-wf6q","url":"https://github.com/advisories/GHSA-p64x-8rxx-wf6q","licence":"CC-BY-4.0","modified":"2025-02-21T05:27:38.084Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-34265","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-34265","licence":"Public domain","modified":"2026-06-17T04:50:00.523Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2022-213","url":"https://osv.dev/vulnerability/PYSEC-2022-213","licence":"CC-BY-4.0","modified":"2023-12-06T01:02:23.703Z"},{"source":"bitnami","name":"Bitnami Vulnerability Database","id":"BIT-DJANGO-2022-34265","url":"https://osv.dev/vulnerability/BIT-DJANGO-2022-34265","licence":"Apache-2.0","modified":"2026-09-08T08:46:36.455Z"}],"updatedAt":"2026-11-25T22:58:12.703Z","epss":{"score":0.73607,"percentile":0.99474,"date":"2026-12-01T12:00:22.000Z"}}