CVE-2022-28346: SQL Injection

Published Apr 6, 2022
·
Updated

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.

This issue has High severity, according to the Django security policy [1].

Other sources

A flaw was found in the Django package, which leads to a SQL injection. This flaw allows an attacker using a crafted dictionary containing malicious SQL queries to compromise the database completely.

An issue was discovered in Django 2.2 before 2.2.28, 3.2 before 3.2.13, and 4.0 before 4.0.4. QuerySet.annotate(), aggregate(), and extra() methods are subject to SQL injection in column aliases via a crafted dictionary (with dictionary expansion) as the passed kwargs.

— GitHub

An issue was discovered in Django 2.2 before 2.2.28, 3.2 before 3.2.13, and 4.0 before 4.0.4. QuerySet.annotate(), aggregate(), and extra() methods are subject to SQL injection in column aliases via a crafted dictionary (with dictionary expansion) as the passed kwargs.

Affected Software

35 affected componentsFixes available
redhat/automation-controller<0:4.1.2-2.el8a
0:4.1.2-2.el8a
redhat/python-django<0:3.2.13-1.el8
0:3.2.13-1.el8
redhat/python3-django<0:2.2.28-1.el7
0:2.2.28-1.el7
redhat/python3-django<0:2.2.28-1.el8
0:2.2.28-1.el8
redhat/python-django20<0:2.0.13-18.el8
0:2.0.13-18.el8
redhat/python-django20<0:2.0.13-17.el8
0:2.0.13-17.el8
redhat/python-django<0:3.2.13-2.el8
0:3.2.13-2.el8
redhat/python-pulpcore<0:3.17.6-3.el8
0:3.17.6-3.el8
debian/2:3.2.12-2<=undefined
debian/1:1.10.7-2+deb9u15<=undefined
debian/2:2.2.26-1~deb11u1<=undefined
pip/django>=4.0<4.0.4
4.0.4
pip/django>=3.2<3.2.13
3.2.13
pip/django>=2.2<2.2.28
2.2.28
djangoproject Django>=2.2<2.2.28
djangoproject Django>=3.2<3.2.13
djangoproject Django>=4.0<4.0.4
Debian Debian Linux=9.0
Debian Debian Linux=11.0
redhat/django<4.0.4
4.0.4
redhat/django<3.2.13
3.2.13
redhat/django<2.2.28
2.2.28
alpine/py3-django<3.2.13-r0
3.2.13-r0
alpine/py3-django<3.2.13-r0
3.2.13-r0
alpine/py3-django<3.2.13-r0
3.2.13-r0
alpine/py3-django<3.2.13-r0
3.2.13-r0
alpine/py3-django<3.2.13-r0
3.2.13-r0
alpine/py3-django<3.2.13-r0
3.2.13-r0
alpine/py3-django<3.2.13-r0
3.2.13-r0
alpine/py3-django<3.2.13-r0
3.2.13-r0
alpine/py3-django<3.2.13-r0
3.2.13-r0
debian/python-django<2:3.2.13-1
2:3.2.13-1
debian/python-django<2:3.2.13-1
2:3.2.13-1
debian/python-django<2:3.2.13-1
2:3.2.13-1
debian/python-django
3:3.2.25-0+deb12u33:3.2.25-0+deb12u63:4.2.28-0+deb13u23:4.2.28-0+deb13u13:5.2.17-23:5.2.19-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade redhat/automation-controller to a version that resolves this vulnerability.

    Fixed in 0:4.1.2-2.el8a
  2. Upgrade

    Upgrade redhat/python-django to a version that resolves this vulnerability.

    Fixed in 0:3.2.13-1.el8
  3. Upgrade

    Upgrade redhat/python3-django to a version that resolves this vulnerability.

    Fixed in 0:2.2.28-1.el7
  4. Upgrade

    Upgrade redhat/python3-django to a version that resolves this vulnerability.

    Fixed in 0:2.2.28-1.el8
  5. Upgrade

    Upgrade redhat/python-django20 to a version that resolves this vulnerability.

    Fixed in 0:2.0.13-18.el8
  6. Upgrade

    Upgrade redhat/python-django20 to a version that resolves this vulnerability.

    Fixed in 0:2.0.13-17.el8
  7. Upgrade

    Upgrade redhat/python-django to a version that resolves this vulnerability.

    Fixed in 0:3.2.13-2.el8
  8. Upgrade

    Upgrade redhat/python-pulpcore to a version that resolves this vulnerability.

    Fixed in 0:3.17.6-3.el8
  9. Upgrade

    Upgrade pip/Django to a version that resolves this vulnerability.

    Fixed in 4.0.4
  10. Upgrade

    Upgrade pip/Django to a version that resolves this vulnerability.

    Fixed in 3.2.13
  11. Upgrade

    Upgrade pip/Django to a version that resolves this vulnerability.

    Fixed in 2.2.28
  12. Upgrade

    Upgrade redhat/Django to a version that resolves this vulnerability.

    Fixed in 4.0.4
  13. Upgrade

    Upgrade redhat/Django to a version that resolves this vulnerability.

    Fixed in 3.2.13
  14. Upgrade

    Upgrade redhat/Django to a version that resolves this vulnerability.

    Fixed in 2.2.28
  15. Upgrade

    Upgrade alpine/py3-django to a version that resolves this vulnerability.

    Fixed in 3.2.13-r0
  16. Upgrade

    Upgrade debian/python-django to a version that resolves this vulnerability.

    Fixed in 2:3.2.13-1
  17. Upgrade

    Upgrade debian/python-django to a version that resolves this vulnerability.

    Fixed in 3:3.2.25-0+deb12u3Fixed in 3:3.2.25-0+deb12u6Fixed in 3:4.2.28-0+deb13u2Fixed in 3:4.2.28-0+deb13u1Fixed in 3:5.2.17-2Fixed in 3:5.2.19-1

Event History

Apr 6, 2022
Data Sourced
via Red Hat·10:47 AM
DescriptionSeverityAffected Software
Apr 11, 2022
CVE Published
08:00 AM
Apr 12, 2022
CVE Published
via MITRE·12:00 AM
Data Sourced
via MITRE·12:00 AM
Description
Data Sourced
via NVD·05:15 AM
RemedyDescriptionSeverityWeaknessAffected Software
Data Sourced
via OSV·05:15 AM
DescriptionSeverityAffected Software
Apr 13, 2022
Advisory Published
via GitHub·12:00 AM
Apr 25, 2022
Exploit Published
via GitHub·08:27 AM

Parent advisories

This vulnerability appears in the following advisories.

Peer vulnerabilities

Found alongside the following vulnerabilities.

Frequently Asked Questions

1

What is CVE-2022-28346?

CVE-2022-28346 refers to a SQL injection vulnerability in the Django package.

2

How severe is CVE-2022-28346?

CVE-2022-28346 is considered critical with a severity score of 9.8.

3

Which versions of Django are affected by CVE-2022-28346?

Django versions 2.2 before 2.2.28, 3.2 before 3.2.13, and 4.0 before 4.0.4 are affected by CVE-2022-28346.

4

How can I fix CVE-2022-28346?

To fix CVE-2022-28346, update Django to versions 2.2.28, 3.2.13, or 4.0.4 or later.

5

Where can I find more information about CVE-2022-28346?

You can find more information about CVE-2022-28346 in the official CVE record, NVD database, Django website, Bugzilla, and Red Hat Security Advisories.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203