From 32ebcbf2e1fe3e5ba79a6554a167efce81f7422d Mon Sep 17 00:00:00 2001 From: Simon Charette Date: Thu, 25 Jul 2024 18:19:13 +0200 Subject: [5.0.x] Fixed CVE-2024-42005 -- Mitigated QuerySet.values() SQL injection attacks against JSON fields. Thanks Eyal (eyalgabay) for the report. --- django/db/models/sql/query.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'django/db/models/sql/query.py') diff --git a/django/db/models/sql/query.py b/django/db/models/sql/query.py index 277e8a18ca..fe6baca607 100644 --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -2446,6 +2446,8 @@ class Query(BaseExpression): self.has_select_fields = True if fields: + for field in fields: + self.check_alias(field) field_names = [] extra_names = [] annotation_names = [] -- cgit v1.3