Advisory

GHSA-p64x-8rxx-wf6q

Also known as: BIT-django-2022-34265, CVE-2022-34265, PYSEC-2022-213

Summary

Django Trunc() and Extract() database functions vulnerable to SQL Injection

Details

An issue was discovered in Django 3.2 before 3.2.14 and 4.0 before 4.0.6. The Trunc() and Extract() database functions are subject to SQL injection if untrusted data is used as a kind/lookup_name value. Applications that constrain the lookup name and kind choice to a known safe list are unaffected.

Severity

Critical Basis: The source's own band: CRITICAL

Dates

Published
2022-07-05 00:00 UTC
Modified
2025-02-21 05:27 UTC

Affected packages and fixes

django

PyPI · All systems

Affected

  • introduced 3.2a1, fixed 3.2.14 (ecosystem)

Fixed versions

3.2.14

Fix

  • Fixed version 3.2.14
    pip install --upgrade django==3.2.14

django

PyPI · All systems

Affected

  • introduced 4.0a1, fixed 4.0.6 (ecosystem)

Fixed versions

4.0.6

Fix

  • Fixed version 4.0.6
    pip install --upgrade django==4.0.6

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences