Django security releases issued: 3.2.5 and 3.1.13
In accordance with our security release policy, the Django team is issuing Django 3.2.5 and Django 3.1.13. These releases address the security issue with severity "high" detailed below. We encourage all users of Django to upgrade as soon as possible.
CVE-2021-35042: Potential SQL injection via unsanitized QuerySet.order_by() input
Unsanitized user input passed to QuerySet.order_by() could bypass intended column reference validation in path marked for deprecation resulting in a potential SQL injection even if a deprecation warning is emitted.
As a mitigation the strict column reference validation was restored for the duration of the deprecation period. This regression appeared in 3.1 as a side effect of fixing #31426.
The issue is not present in the main branch as the deprecated path has been removed.
Thanks to Joel Saunders for the report.
Affected supported versions
- Django 3.2
- Django 3.1
Patches to resolve the issue have been applied to Django's 3.2 and 3.1 release branches. The patches may be obtained from the following changesets:
- On the 3.2 release branch
- On the 3.1 release branch
The following releases have been issued:
- Django 3.2.5 (download Django 3.2.5 | 3.2.5 checksums)
- Django 3.1.13 (download Django 3.1.13 | 3.1.13 checksums)
The PGP key ID used for this release is Mariusz Felisiak: 2EF56372BA48CD1B.
General notes regarding security reporting
As always, we ask that potential security issues be reported via private email to firstname.lastname@example.org, and not via Django's Trac instance or the django-developers list. Please see our security policies for further information.