Cloudanix VulnDB

CVE-2024-39330

None

CVSS

—

EPSS

1.0%

Published

Jul 10, 2024

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

Some custom file-handling code in web applications could let attackers reach files outside the normal storage area, though the issue only affects certain custom setups and has not been seen in attacks.

Exploitation
Remote Authenticated
Attacker needs
Low Privilege
Complexity
Moderate
Impact
Data Tampering
Component
Web Framework
Class
Path Traversal
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

Custom subclasses of django.core.files.storage.Storage that override generate_filename() without replicating the parent class file-path validations allow directory traversal via crafted inputs during save() calls; built-in subclasses are unaffected.

Why it matters to the business

Applications with custom storage backends risk unauthorized file reads or writes outside intended directories, potentially exposing sensitive data or enabling tampering. Urgency remains low given stable low EPSS, no KEV listing, and no known threat actor exploitation after 825 days.

How an attack unfolds

An attacker supplies a malicious filename containing traversal sequences to an application endpoint that triggers save() on a vulnerable custom Storage subclass; missing validations in the overridden generate_filename() permit the path to escape the intended directory.

How to fix it

Upgrade Django to 5.0.7 or 4.2.14 or later. On Debian 12 apply package version 6.1.94-1 or newer; on Debian 13 apply 6.8.11-1 or newer. Ensure any custom Storage subclasses replicate the parent's generate_filename() validations.

How to confirm the fix worked

Audit custom Storage classes to confirm generate_filename() includes the base-class path checks; attempt traversal payloads in test environments and verify files remain confined to the intended directory.

Typical attack path

  1. Locate a Django application exposing file upload or save functionality that uses a custom Storage subclass overriding generate_filename()
  2. Craft an input filename containing directory traversal sequences such as '../'
  3. Submit the input to trigger a save() operation
  4. Access or modify files outside the designated storage root

How to detect it

Search application and web-server logs for save() operations or file paths containing sequences such as '../' originating from user-controlled filename fields; no public exploitation artifacts are known.

What your security team should do

  • Apply the listed Debian package updates immediately on affected systems
  • Review and correct all custom Storage subclass implementations
  • Add unit tests that exercise generate_filename() with traversal inputs
  • Monitor file-system access logs for unexpected paths until patches are deployed

The record

An issue was discovered in Django 5.0 before 5.0.7 and 4.2 before 4.2.14. Derived classes of the django.core.files.storage.Storage base class, when they override generate_filename() without replicating the file-path validations from the parent class, potentially allow directory traversal via certain inputs during a save() call. (Built-in Storage sub-classes are unaffected.)

Affected packages

Ecosystem Package Introduced Fixed
PyPI django 4.2 4.2.14
PyPI django 5.0 5.0.7
Bitnami django 4.2.0 4.2.14
Chainguard py3-django 0 5.0.7-r0
Chainguard py3-supported-django 0 5.0.7-r0
Chainguard py3.10-django 0 5.0.7-r0
Chainguard py3.10-django-bin 0 5.0.7-r0
Chainguard py3.11-django 0 5.0.7-r0
Chainguard py3.11-django-bin 0 5.0.7-r0
Chainguard py3.12-django 0 5.0.7-r0
Chainguard py3.12-django-bin 0 5.0.7-r0
Chainguard py3.13-django 0 5.0.7-r0
Chainguard py3.13-django-bin 0 5.0.7-r0
Debian:11 python-django 0 No fix
Debian:12 python-django 0 No fix
Debian:13 python-django 0 3:4.2.14-1
Debian:14 python-django 0 3:4.2.14-1
Mageia:9 python-django 0 4.1.13-1.2.mga9
Red Hat:ansible_automation_platform:2.4::el8 automation-controller 0 0:4.5.10-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 automation-controller-cli 0 0:4.5.10-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 automation-controller-server 0 0:4.5.10-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 automation-controller-ui 0 0:4.5.10-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 automation-controller-venv-tower 0 0:4.5.10-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 python39-django 0 0:4.2.15-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 python39-grpcio 0 0:1.58.3-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 python39-grpcio-debuginfo 0 0:1.58.3-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 python39-zipp 0 0:3.19.2-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 python3x-django 0 0:4.2.15-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 python3x-grpcio 0 0:1.58.3-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 python3x-grpcio-debugsource 0 0:1.58.3-1.el8ap
Red Hat:ansible_automation_platform:2.4::el9 automation-controller 0 0:4.5.10-1.el9ap
Red Hat:ansible_automation_platform:2.4::el9 automation-controller-cli 0 0:4.5.10-1.el9ap
Red Hat:ansible_automation_platform:2.4::el9 automation-controller-server 0 0:4.5.10-1.el9ap
Red Hat:ansible_automation_platform:2.4::el9 automation-controller-ui 0 0:4.5.10-1.el9ap
Red Hat:ansible_automation_platform:2.4::el9 automation-controller-venv-tower 0 0:4.5.10-1.el9ap
Red Hat:ansible_automation_platform:2.4::el9 python-django 0 0:4.2.15-1.el9ap
Red Hat:ansible_automation_platform:2.4::el9 python-grpcio 0 0:1.58.3-1.el9ap
Red Hat:ansible_automation_platform:2.4::el9 python-grpcio-debugsource 0 0:1.58.3-1.el9ap
Red Hat:ansible_automation_platform:2.4::el9 python-zipp 0 0:3.19.2-1.el9ap
Red Hat:ansible_automation_platform:2.4::el9 python3-django 0 0:4.2.15-1.el9ap
Red Hat:ansible_automation_platform:2.4::el9 python3-grpcio 0 0:1.58.3-1.el9ap
Red Hat:ansible_automation_platform:2.4::el9 python3-grpcio-debuginfo 0 0:1.58.3-1.el9ap
Red Hat:ansible_automation_platform:2.4::el9 python3-zipp 0 0:3.19.2-1.el9ap
Red Hat:ansible_automation_platform_developer:2.4::el8 automation-controller 0 0:4.5.10-1.el8ap
Red Hat:ansible_automation_platform_developer:2.4::el8 automation-controller-cli 0 0:4.5.10-1.el8ap
Red Hat:ansible_automation_platform_developer:2.4::el8 automation-controller-server 0 0:4.5.10-1.el8ap
Red Hat:ansible_automation_platform_developer:2.4::el8 automation-controller-ui 0 0:4.5.10-1.el8ap
Red Hat:ansible_automation_platform_developer:2.4::el8 automation-controller-venv-tower 0 0:4.5.10-1.el8ap
Red Hat:ansible_automation_platform_developer:2.4::el8 python39-zipp 0 0:3.19.2-1.el8ap
Red Hat:ansible_automation_platform_developer:2.4::el9 automation-controller 0 0:4.5.10-1.el9ap
Red Hat:ansible_automation_platform_developer:2.4::el9 automation-controller-cli 0 0:4.5.10-1.el9ap
Red Hat:ansible_automation_platform_developer:2.4::el9 automation-controller-server 0 0:4.5.10-1.el9ap
Red Hat:ansible_automation_platform_developer:2.4::el9 automation-controller-ui 0 0:4.5.10-1.el9ap
Red Hat:ansible_automation_platform_developer:2.4::el9 automation-controller-venv-tower 0 0:4.5.10-1.el9ap
Red Hat:ansible_automation_platform_developer:2.4::el9 python-zipp 0 0:3.19.2-1.el9ap
Red Hat:ansible_automation_platform_developer:2.4::el9 python3-zipp 0 0:3.19.2-1.el9ap
Red Hat:ansible_automation_platform_inside:2.4::el8 python39-zipp 0 0:3.19.2-1.el8ap
Red Hat:ansible_automation_platform_inside:2.4::el9 python-zipp 0 0:3.19.2-1.el9ap
Red Hat:ansible_automation_platform_inside:2.4::el9 python3-zipp 0 0:3.19.2-1.el9ap
Red Hat:openstack:18.0::el9 python-django 0 0:3.2.12-8.el9ost
Red Hat:openstack:18.0::el9 python3-django 0 0:3.2.12-8.el9ost
Red Hat:satellite:6.16::el8 ansible-collection-redhat-satellite 0 0:4.2.0-1.el8sat
Red Hat:satellite:6.16::el8 ansible-collection-redhat-satellite_operations 0 0:3.0.0-1.el8sat
Red Hat:satellite:6.16::el8 ansible-lint 0 0:5.4.0-1.el8pc
Red Hat:satellite:6.16::el8 ansible-runner 0 0:2.2.1-6.el8sat
Red Hat:satellite:6.16::el8 ansiblerole-foreman_scap_client 0 0:0.3.0-1.el8sat
Red Hat:satellite:6.16::el8 ansiblerole-insights-client 0 0:1.7.1-2.el8sat
Red Hat:satellite:6.16::el8 candlepin 0 0:4.4.16-1.el8sat
Red Hat:satellite:6.16::el8 candlepin-selinux 0 0:4.4.16-1.el8sat
Red Hat:satellite:6.16::el8 cjson 0 0:1.7.17-1.el8sat
Red Hat:satellite:6.16::el8 cjson-debuginfo 0 0:1.7.17-1.el8sat
Red Hat:satellite:6.16::el8 cjson-debugsource 0 0:1.7.17-1.el8sat
Red Hat:satellite:6.16::el8 createrepo_c 0 0:1.1.3-1.el8pc
Red Hat:satellite:6.16::el8 createrepo_c-debuginfo 0 0:1.1.3-1.el8pc
Red Hat:satellite:6.16::el8 createrepo_c-debugsource 0 0:1.1.3-1.el8pc
Red Hat:satellite:6.16::el8 createrepo_c-libs 0 0:1.1.3-1.el8pc
Red Hat:satellite:6.16::el8 createrepo_c-libs-debuginfo 0 0:1.1.3-1.el8pc
Red Hat:satellite:6.16::el8 dynflow-utils 0 0:1.6.3-1.el8sat
Red Hat:satellite:6.16::el8 foreman 0 0:3.12.0.1-1.el8sat
Red Hat:satellite:6.16::el8 foreman-bootloaders-redhat 0 0:202102220000-3.el8sat
Red Hat:satellite:6.16::el8 foreman-bootloaders-redhat-tftpboot 0 0:202102220000-3.el8sat
Red Hat:satellite:6.16::el8 foreman-cli 0 0:3.12.0.1-1.el8sat
Red Hat:satellite:6.16::el8 foreman-debug 0 0:3.12.0.1-1.el8sat
Red Hat:satellite:6.16::el8 foreman-discovery-image 0 1:4.1.0-61.el8sat
Red Hat:satellite:6.16::el8 foreman-discovery-image-service 0 0:1.0.0-4.1.el8sat
Red Hat:satellite:6.16::el8 foreman-discovery-image-service-tui 0 0:1.0.0-4.1.el8sat
Red Hat:satellite:6.16::el8 foreman-dynflow-sidekiq 0 0:3.12.0.1-1.el8sat
Red Hat:satellite:6.16::el8 foreman-ec2 0 0:3.12.0.1-1.el8sat
Red Hat:satellite:6.16::el8 foreman-fapolicyd 0 0:1.0.1-3.el8sat
Red Hat:satellite:6.16::el8 foreman-installer 0 1:3.12.0.1-1.el8sat
Red Hat:satellite:6.16::el8 foreman-installer-katello 0 1:3.12.0.1-1.el8sat
Red Hat:satellite:6.16::el8 foreman-journald 0 0:3.12.0.1-1.el8sat
Red Hat:satellite:6.16::el8 foreman-libvirt 0 0:3.12.0.1-1.el8sat
Red Hat:satellite:6.16::el8 foreman-obsolete-packages 0 0:1.10-1.el8sat
Red Hat:satellite:6.16::el8 foreman-openstack 0 0:3.12.0.1-1.el8sat
Red Hat:satellite:6.16::el8 foreman-ovirt 0 0:3.12.0.1-1.el8sat
Red Hat:satellite:6.16::el8 foreman-pcp 0 0:3.12.0.1-1.el8sat
Red Hat:satellite:6.16::el8 foreman-postgresql 0 0:3.12.0.1-1.el8sat
Red Hat:satellite:6.16::el8 foreman-proxy 0 0:3.12.0-1.el8sat
Red Hat:satellite:6.16::el8 foreman-proxy-content 0 0:4.14.0-0.1.rc2.el8sat
Red Hat:satellite:6.16::el8 foreman-proxy-fapolicyd 0 0:1.0.1-3.el8sat
Red Hat:satellite:6.16::el8 foreman-proxy-journald 0 0:3.12.0-1.el8sat
Red Hat:satellite:6.16::el8 foreman-redis 0 0:3.12.0.1-1.el8sat
Red Hat:satellite:6.16::el8 foreman-selinux 0 0:3.12.0-1.el8sat
Red Hat:satellite:6.16::el8 foreman-service 0 0:3.12.0.1-1.el8sat
Red Hat:satellite:6.16::el8 foreman-telemetry 0 0:3.12.0.1-1.el8sat
Red Hat:satellite:6.16::el8 foreman-vmware 0 0:3.12.0.1-1.el8sat
Red Hat:satellite:6.16::el8 katello 0 0:4.14.0-0.1.rc2.el8sat
Red Hat:satellite:6.16::el8 katello-certs-tools 0 0:2.10.0-1.el8sat
Red Hat:satellite:6.16::el8 katello-client-bootstrap 0 0:1.7.9-1.el8sat
Red Hat:satellite:6.16::el8 katello-common 0 0:4.14.0-0.1.rc2.el8sat
Red Hat:satellite:6.16::el8 katello-debug 0 0:4.14.0-0.1.rc2.el8sat
Red Hat:satellite:6.16::el8 katello-selinux 0 0:5.0.2-1.el8sat
Red Hat:satellite:6.16::el8 libcomps 0 0:0.1.21-1.el8pc
Red Hat:satellite:6.16::el8 libcomps-debuginfo 0 0:0.1.21-1.el8pc
Red Hat:satellite:6.16::el8 libcomps-debugsource 0 0:0.1.21-1.el8pc
Red Hat:satellite:6.16::el8 libsodium 0 0:1.0.17-3.el8sat
Red Hat:satellite:6.16::el8 libsodium-debuginfo 0 0:1.0.17-3.el8sat
Red Hat:satellite:6.16::el8 libsodium-debugsource 0 0:1.0.17-3.el8sat
Red Hat:satellite:6.16::el8 libsolv 0 1:0.7.20-6.el8sat
Red Hat:satellite:6.16::el8 libsolv-debuginfo 0 1:0.7.20-6.el8sat
Red Hat:satellite:6.16::el8 libsolv-debugsource 0 1:0.7.20-6.el8sat
Red Hat:satellite:6.16::el8 libsolv-demo-debuginfo 0 1:0.7.20-6.el8sat
Red Hat:satellite:6.16::el8 libsolv-tools-debuginfo 0 1:0.7.20-6.el8sat
Red Hat:satellite:6.16::el8 mosquitto 0 0:2.0.19-1.el8sat
Red Hat:satellite:6.16::el8 mosquitto-debuginfo 0 0:2.0.19-1.el8sat
Red Hat:satellite:6.16::el8 mosquitto-debugsource 0 0:2.0.19-1.el8sat
Red Hat:satellite:6.16::el8 perl-solv-debuginfo 0 1:0.7.20-6.el8sat
Red Hat:satellite:6.16::el8 postgresql-evr 0 0:0.0.2-3.el8sat
Red Hat:satellite:6.16::el8 pulpcore-obsolete-packages 0 0:1.2.0-1.el8pc
Red Hat:satellite:6.16::el8 pulpcore-selinux 0 0:2.0.1-1.el8pc
Red Hat:satellite:6.16::el8 puppet-agent 0 0:8.8.1-1.el8sat
Red Hat:satellite:6.16::el8 puppet-agent-oauth 0 0:0.5.10-1.el8sat
Red Hat:satellite:6.16::el8 puppet-foreman_scap_client 0 0:1.0.0-2.el8sat
Red Hat:satellite:6.16::el8 puppetlabs-stdlib 0 0:9.4.1-1.el8sat
Red Hat:satellite:6.16::el8 puppetserver 0 0:8.6.2-2.el8sat
Red Hat:satellite:6.16::el8 python-aiodns 0 0:3.0.0-7.el8pc
Red Hat:satellite:6.16::el8 python-aiofiles 0 0:22.1.0-5.el8pc
Red Hat:satellite:6.16::el8 python-aiohttp 0 0:3.9.4-1.el8pc
Red Hat:satellite:6.16::el8 python-aiohttp-debugsource 0 0:3.9.4-1.el8pc
Red Hat:satellite:6.16::el8 python-aiohttp-xmlrpc 0 0:1.5.0-6.el8pc
Red Hat:satellite:6.16::el8 python-aioredis 0 0:2.0.1-6.el8pc
Red Hat:satellite:6.16::el8 python-aiosignal 0 0:1.3.1-5.el8pc
Red Hat:satellite:6.16::el8 python-ansible-builder 0 0:3.0.0-1.el8pc
Red Hat:satellite:6.16::el8 python-asgiref 0 0:3.6.0-5.el8pc
Red Hat:satellite:6.16::el8 python-async-lru 0 0:1.0.3-5.el8pc
Red Hat:satellite:6.16::el8 python-async-timeout 0 0:4.0.2-6.el8pc
Red Hat:satellite:6.16::el8 python-asyncio-throttle 0 0:1.0.2-7.el8pc
Red Hat:satellite:6.16::el8 python-attrs 0 0:21.4.0-6.el8pc
Red Hat:satellite:6.16::el8 python-backoff 0 0:2.2.1-5.el8pc
Red Hat:satellite:6.16::el8 python-bindep 0 0:2.11.0-5.el8pc
Red Hat:satellite:6.16::el8 python-bleach 0 0:3.3.1-6.el8pc
Red Hat:satellite:6.16::el8 python-bleach-allowlist 0 0:1.0.3-7.el8pc
Red Hat:satellite:6.16::el8 python-bracex 0 0:2.2.1-6.el8pc
Red Hat:satellite:6.16::el8 python-brotli 0 0:1.0.9-6.el8pc
Red Hat:satellite:6.16::el8 python-brotli-debugsource 0 0:1.0.9-6.el8pc
Red Hat:satellite:6.16::el8 python-certifi 0 0:2022.12.7-5.el8pc
Red Hat:satellite:6.16::el8 python-cffi 0 0:1.15.1-5.el8pc
Red Hat:satellite:6.16::el8 python-cffi-debugsource 0 0:1.15.1-5.el8pc
Red Hat:satellite:6.16::el8 python-chardet 0 0:5.0.0-2.el8pc
Red Hat:satellite:6.16::el8 python-charset-normalizer 0 0:2.1.1-5.el8pc
Red Hat:satellite:6.16::el8 python-click 0 0:8.1.3-5.el8pc
Red Hat:satellite:6.16::el8 python-click-shell 0 0:2.1-7.el8pc
Red Hat:satellite:6.16::el8 python-colorama 0 0:0.4.4-7.el8pc
Red Hat:satellite:6.16::el8 python-commonmark 0 0:0.9.1-9.el8pc
Red Hat:satellite:6.16::el8 python-contextlib2 0 0:21.6.0-7.el8pc
Red Hat:satellite:6.16::el8 python-cryptography 0 0:42.0.8-1.el8pc
Red Hat:satellite:6.16::el8 python-cryptography-debugsource 0 0:42.0.8-1.el8pc
Red Hat:satellite:6.16::el8 python-daemon 0 0:2.3.1-3.el8sat
Red Hat:satellite:6.16::el8 python-dataclasses 0 0:0.8-7.el8pc
Red Hat:satellite:6.16::el8 python-dateutil 0 0:2.8.2-5.el8pc
Red Hat:satellite:6.16::el8 python-debian 0 0:0.1.44-7.el8pc
Red Hat:satellite:6.16::el8 python-defusedxml 0 0:0.7.1-7.el8pc
Red Hat:satellite:6.16::el8 python-deprecated 0 0:1.2.13-5.el8pc
Red Hat:satellite:6.16::el8 python-diff-match-patch 0 0:20200713-7.el8pc
Red Hat:satellite:6.16::el8 python-distro 0 0:1.7.0-4.el8pc
Red Hat:satellite:6.16::el8 python-django 0 0:4.2.16-1.el8pc
Red Hat:satellite:6.16::el8 python-django-filter 0 0:23.2-4.el8pc
Red Hat:satellite:6.16::el8 python-django-guid 0 0:3.3.0-5.el8pc
Red Hat:satellite:6.16::el8 python-django-import-export 0 0:3.1.0-4.el8pc
Red Hat:satellite:6.16::el8 python-django-lifecycle 0 0:1.0.0-4.el8pc
Red Hat:satellite:6.16::el8 python-django-readonly-field 0 0:1.1.2-4.el8pc
Red Hat:satellite:6.16::el8 python-djangorestframework 0 0:3.14.0-4.el8pc
Red Hat:satellite:6.16::el8 python-djangorestframework-queryfields 0 0:1.0.0-8.el8pc
Red Hat:satellite:6.16::el8 python-docutils 0 0:0.20.1-4.el8pc
Red Hat:satellite:6.16::el8 python-drf-access-policy 0 0:1.3.0-4.el8pc
Red Hat:satellite:6.16::el8 python-drf-nested-routers 0 0:0.93.4-6.el8pc
Red Hat:satellite:6.16::el8 python-drf-spectacular 0 0:0.26.5-5.el8pc
Red Hat:satellite:6.16::el8 python-dynaconf 0 0:3.1.12-4.el8pc
Red Hat:satellite:6.16::el8 python-ecdsa 0 0:0.18.0-5.el8pc
Red Hat:satellite:6.16::el8 python-enrich 0 0:1.2.6-7.el8pc
Red Hat:satellite:6.16::el8 python-et-xmlfile 0 0:1.1.0-6.el8pc
Red Hat:satellite:6.16::el8 python-flake8 0 0:5.0.0-3.el8pc
Red Hat:satellite:6.16::el8 python-frozenlist 0 0:1.3.3-5.el8pc
Red Hat:satellite:6.16::el8 python-frozenlist-debugsource 0 0:1.3.3-5.el8pc
Red Hat:satellite:6.16::el8 python-future 0 0:0.18.3-5.el8pc
Red Hat:satellite:6.16::el8 python-galaxy-importer 0 0:0.4.19-2.el8pc
Red Hat:satellite:6.16::el8 python-gitdb 0 0:4.0.10-5.el8pc
Red Hat:satellite:6.16::el8 python-gitpython 0 0:3.1.40-3.el8pc
Red Hat:satellite:6.16::el8 python-gnupg 0 0:0.5.0-4.el8pc

Related vulnerabilities