From c87bfaacf8fb84984243b5055dc70f97996cb115 Mon Sep 17 00:00:00 2001 From: Simon Charette Date: Thu, 25 Jul 2024 12:19:13 -0400 Subject: 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 09916277bc..c1e2fc1d4f 100644 --- a/django/db/models/sql/query.py +++ b/django/db/models/sql/query.py @@ -2461,6 +2461,8 @@ class Query(BaseExpression): selected = {} if fields: + for field in fields: + self.check_alias(field) field_names = [] extra_names = [] annotation_names = [] -- cgit v1.3