CVE-2023-31047
Django bypasses validation when using one form field to upload multiple files
Reported by mitre · Published May 7, 2023
Django is fixed in 4.2.1, 4.1.9 and 3.2.19 (PyPI)
In Django 3.2 before 3.2.19, 4.x before 4.1.9, and 4.2 before 4.2.1, it was possible to bypass validation when using one form field to upload multiple files. This multiple upload has never been supported by forms.FileField or forms.ImageField (only the last uploaded file was validated). However, Django's "Uploading multiple files" documentation suggested otherwise.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| Django | PyPI | 4.2.1, 4.1.9, 3.2.19 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| n/a | n/a | n/a |
| PyPI | Django | 3.2a1, 4.0a1, 4.2a1 |
| n/a | n/a | * |
Timeline
- May 3, 2023 CVE Published
- May 7, 2023 EPSS Score (30 in total, the first dated here)
- May 7, 2023 PoC Published (2 in total, the first dated here)
- Mar 10, 2026 Security Advisory (8 in total, the first dated here)
- Jun 17, 2026 CVE Updated
- Oct 13, 2026 Distribution Patch (3 in total, the first dated here)
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2023-31047
vulnetix vdb fixes CVE-2023-31047
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2023-31047/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- FEDORA-2023-0d20d09f2d vendor-advisory
- FEDORA-2023-8f9d949dbc vendor-advisory
- https://nvd.nist.gov/vuln/detail/CVE-2023-31047 advisory
- https://github.com/advisories/GHSA-r3xc-prgr-mg9p advisory
- https://github.com/django/django/commit/21b1b1fc03e5f9e9f8c977ee6e35618dd3b353dd patch
- https://github.com/django/django/commit/e7c3a2ccc3a562328600be05068ed9149e12ce64 patch
- https://github.com/django/django/commit/eed53d0011622e70b936e203005f0e6f4ac48965 patch
- https://docs.djangoproject.com/en/4.2/releases/security url
- https://github.com/django/django url
- https://github.com/pypa/advisory-database/tree/main/vulns/django/PYSEC-2023-61.yaml advisory
- https://groups.google.com/forum/#!forum/django-announce url
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/A45VKTUVQ2BN6D5ZLZGCM774R6QGFOHW url
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/DNEHD6N435OE2XUFGDAAVAXSYWLCUBFD url
- https://security.netapp.com/advisory/ntap-20230609-0008 advisory
- https://www.djangoproject.com/weblog/2023/may/03/security-releases url