Skip to content
OpenAdvisories
Critical · 9.8 Public exploit CVE-2019-14234 EUVD-2019-0037GHSA-6r97-cj55-9hrqPYSEC-2019-13

SQL Injection in Django

Published Aug 9, 2019 · Updated Aug 5, 2024 · Assigned by mitre

Description

An issue was discovered in Django 1.11.x before 1.11.23, 2.1.x before 2.1.11, and 2.2.x before 2.2.4. Due to an error in shallow key transformation, key and index lookups for django.contrib.postgres.fields.JSONField, and key lookups for django.contrib.postgres.fields.HStoreField, were subject to SQL injection. This could, for example, be exploited via crafted use of "OR 1=1" in a key or index name to return all records, using a suitably crafted dictionary, with dictionary expansion, as the **kwargs passed to the QuerySet.filter() function.

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 python-django 2:2.2.4-1 —
Debian 13 python-django 2:2.2.4-1 —
Debian 12 python-django 2:2.2.4-1 —
Debian 10 python-django 1:1.11.23-1~deb10u1 DSA-4498-1
Debian 9 python-django 1:1.10.7-2+deb9u6 DSA-4498-1
ReleasePackageFixed inAdvisory
Ubuntu 20.04 LTS python-django 1:1.11.22-1ubuntu1 —
Ubuntu 18.04 LTS python-django 1:1.11.11-1ubuntu1.5 USN-4084-1
Ubuntu 16.04 LTS python-django 1.8.7-1ubuntu5.10 USN-4084-1
Show 1 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu Pro 14.04 LTS python-django No fix yet —
ReleasePackageFixed inAdvisory
Red Hat OpenStack 15 python-django +2 2.1.11-1.el8ost RHSA-2020:1324
Red Hat OpenStack 13 python-django +2 1.11.27-1.el7ost RHSA-2020:4390
ReleasePackageFixed inAdvisory
SUSE Package Hub 15 SP1 python-Django 2.2.4-bp151.3.3.1 openSUSE-SU-2019:1872-1
SUSE OpenStack Cloud Crowbar 9 python-Django1 1.11.23-3.9.1 SUSE-SU-2019:2335-1
SUSE OpenStack Cloud Crowbar 8 python-Django 1.11.23-3.12.1 SUSE-SU-2019:2257-1
Show 4 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
SUSE OpenStack Cloud 9 python-Django1 1.11.23-3.9.1 SUSE-SU-2019:2335-1
SUSE OpenStack Cloud 8 python-Django 1.11.23-3.12.1 SUSE-SU-2019:2257-1
SUSE OpenStack Cloud 7 python-Django 1.8.19-3.15.1 SUSE-SU-2019:2180-1
SUSE HPE Helion OpenStack 8 python-Django 1.11.23-3.12.1 SUSE-SU-2019:2257-1
ReleasePackageFixed inAdvisory
openSUSE Leap 15.1 python-Django 2.2.4-lp151.2.3.1 openSUSE-SU-2019:1839-1
ReleasePackageFixed inAdvisory
Alpine v3.24 py3-django 1.11.23-r0 —
Alpine v3.23 py3-django 1.11.23-r0 —
Alpine v3.22 py3-django 1.11.23-r0 —
Alpine v3.21 py3-django 1.11.23-r0 —
Alpine v3.20 py3-django 1.11.23-r0 —
Show 13 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Alpine v3.19 py3-django 1.11.23-r0 —
Alpine v3.18 py3-django 1.11.23-r0 —
Alpine v3.17 py3-django 1.11.23-r0 —
Alpine v3.16 py3-django 1.11.23-r0 —
Alpine v3.15 py3-django 1.11.23-r0 —
Alpine v3.14 py3-django 1.11.23-r0 —
Alpine v3.13 py3-django 1.11.23-r0 —
Alpine v3.12 py3-django 1.11.23-r0 —
Alpine v3.11 py3-django 1.11.23-r0 —
Alpine v3.10 py-django 1.11.23-r0 —
Alpine v3.9 py-django 1.11.23-r0 —
Alpine v3.8 py-django 1.11.23-r0 —
Alpine v3.7 py-django 1.11.23-r0 —

Public exploits

Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.

Third-party code, not reviewed by us. Public PoCs are sometimes fake or contain malware. Read the code first and run it only in an isolated lab, against systems you are authorised to test.

GitHub 1 repository

Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.

Affected packages

EcosystemPackageAffectedFixedRecord
PyPI django >= 1.11a1, < 1.11.23 1.11.23 GHSA-6r97-cj55-9hrq
PyPI django >= 2.1a1, < 2.1.11 2.1.11 GHSA-6r97-cj55-9hrq
PyPI django >= 2.2a1, < 2.2.4 2.2.4 GHSA-6r97-cj55-9hrq
PyPI django >= 2.1, < 2.1.11 · >= 1.11, < 1.11.23 · >= 2.2, < 2.2.4 2.1.11, 1.11.23, 2.2.4 PYSEC-2019-13

Advisories 10

References