Django security releases issued: 4.0.4, 3.2.13, and 2.2.28

Posted by Mariusz Felisiak on April 11, 2022

In accordance with our security release policy, the Django team is issuing Django 4.0.4, Django 3.2.13, and Django 2.2.28. These release addresses the security issues detailed below. We encourage all users of Django to upgrade as soon as possible.

Django 2.2 has reached the end of extended support. The final security release (2.2.28) was issued today. All Django 2.2 users are encouraged to upgrade to Django 3.2 or later.

CVE-2022-28346: Potential SQL injection in QuerySet.annotate(), aggregate(), and extra()

QuerySet.annotate(), aggregate(), and extra() methods were subject to SQL injection in column aliases, using a suitably crafted dictionary, with dictionary expansion, as the **kwargs passed to these methods.

Thanks Splunk team: Preston Elder, Jacob Davis, Jacob Moore, Matt Hanson, David Briggs, and a security researcher: Danylo Dmytriiev (DDV_UA) for the report.

This issue has severity "high" according to the Django security policy.

CVE-2022-28347: Potential SQL injection via QuerySet.explain(**options) on PostgreSQL

QuerySet.explain() method was subject to SQL injection in option names, using a suitably crafted dictionary, with dictionary expansion, as the **options argument.

Thanks Mariusz Felisiak for the report.

This issue has severity "high" according to the Django security policy.

Affected supported versions

  • Django main branch
  • Django 4.0
  • Django 3.2
  • Django 2.2

Resolution

Patches to resolve the issue have been applied to Django's main branch and to the 4.0, 3.2, and 2.2 release branches. The patches may be obtained from the following changesets.

CVE-2022-28346:

CVE-2022-28347:

The following releases have been issued:

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 security@djangoproject.com, and not via Django's Trac instance or the django-developers list. Please see our security policies for further information.

Back to Top