CVE-2019-14234 SQL Injection in Django

Critical 9.8 Published Updated

Attackers can execute arbitrary SQL commands via crafted key lookups in Django's JSONField and HStoreField, potentially reading or modifying database records.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2019-14234?

CVE-2019-14234 is a critical SQL injection vulnerability in Debian Debian Linux, published on 9 Aug 2019. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official 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.

Weakness: CWE-89

Which versions are affected by CVE-2019-14234?

7 open source packages ship an affected version, including django and Django. It affects 3 products.

PackageAffectedFixed in
django PyPIFrom 1.11a11.11.23
django PyPIFrom 2.12.1.11, 1.11.23, 2.2.4
django PyPIFrom 2.1a12.1.11
django PyPIFrom 2.2a12.2.4
Django PyPIFrom 1.11a11.11.23
Django PyPIFrom 2.1a12.1.11
1 more packages
Django PyPIFrom 2.2a12.2.4

Products include Debian Debian Linux, Djangoproject Django, Fedoraproject Fedora.

How do I fix CVE-2019-14234?

Upgrade django to a fixed version for your release line: 1.11.23, 2.1.11 or 2.2.4.

Use parameterised queries everywhere and never build SQL by joining strings. Upgrade affected software first; a web application firewall only buys time. More about SQL injection.

Is CVE-2019-14234 being exploited?

There is no known exploitation of CVE-2019-14234 in the wild and no public exploit code.

Public exploit code: 1 proofs of concept on GitHub.

All Debian Debian Linux vulnerabilities

Sources

Also known as ALPINE-CVE-2019-14234, DEBIAN-CVE-2019-14234, GHSA-6r97-cj55-9hrq, PYSEC-2019-13, UBUNTU-CVE-2019-14234.

Is CVE-2019-14234 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free