{"id":"CVE-2022-34265","details":"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.","aliases":["BIT-django-2022-34265","GHSA-p64x-8rxx-wf6q","PYSEC-2022-213"],"modified":"2026-04-16T00:07:41.214398935Z","published":"2022-07-04T16:15:09.260Z","related":["SUSE-SU-2022:3338-1","SUSE-SU-2022:3339-1","openSUSE-SU-2024:12172-1","openSUSE-SU-2024:14208-1","openSUSE-SU-2025:14662-1","openSUSE-SU-2026:10005-1"],"references":[{"type":"WEB","url":"https://groups.google.com/forum/#%21forum/django-announce"},{"type":"WEB","url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/HWY6DQWRVBALV73BPUVBXC3QIYUM24IK/"},{"type":"WEB","url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/LTZVAKU5ALQWOKFTPISE257VCVIYGFQI/"},{"type":"ADVISORY","url":"https://security.netapp.com/advisory/ntap-20220818-0006/"},{"type":"ADVISORY","url":"https://www.debian.org/security/2022/dsa-5254"},{"type":"FIX","url":"https://docs.djangoproject.com/en/4.0/releases/security/"},{"type":"FIX","url":"https://www.djangoproject.com/weblog/2022/jul/04/security-releases/"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/django/django","events":[{"introduced":"3591e1c1acbd7c13174275367c3fdf012cb0413b"},{"fixed":"746e88cc634469112b823225c19d75c7362f8ecf"},{"introduced":"ef62a3a68c9d558486145a42c0d71ea9a76add9e"},{"fixed":"caad462feaa84ba78ed658a9595a4a4363dad2db"}],"database_specific":{"extracted_events":[{"introduced":"3.2"},{"fixed":"3.2.14"},{"introduced":"4.0"},{"fixed":"4.0.6"}],"cpe":"cpe:2.3:a:djangoproject:django:*:*:*:*:*:*:*:*","source":"CPE_FIELD"}}],"database_specific":{"source":"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-34265.json"}}],"schema_version":"1.7.5","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"}]}