Django is subject to SQL injection through its column aliases
High severity
GitHub Reviewed
Published
Sep 8, 2025
to the GitHub Advisory Database
•
Updated Sep 9, 2025
Package
Affected versions
< 4.2.24
>= 5.0a1, < 5.1.12
>= 5.2a1, < 5.2.6
Patched versions
4.2.24
5.1.12
5.2.6
Description
Published by the National Vulnerability Database
Sep 3, 2025
Published to the GitHub Advisory Database
Sep 8, 2025
Reviewed
Sep 9, 2025
Last updated
Sep 9, 2025
An issue was discovered in Django 4.2 before 4.2.24, 5.1 before 5.1.12, and 5.2 before 5.2.6. FilteredRelation is subject to SQL injection in column aliases, using a suitably crafted dictionary, with dictionary expansion, as the **kwargs passed QuerySet.annotate() or QuerySet.alias().
References