{"answers":{"affected":"3 open source packages ship an affected version, including django-s3file. It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-24840 exists.","fix":"Upgrade django-s3file to 5.5.1 or later.","what":"CVE-2022-24840 is a critical vulnerability in codingjoe django-s3file, published on 6 Jun 2022."},"fix_prompt":"Check this codebase for CVE-2022-24840 and fix it if it is affected.\n\nWhat it is: CVE-2022-24840 is a critical vulnerability in codingjoe django-s3file, published on 6 Jun 2022. \nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-24840 exists.\n\nAffected packages and fixed versions:\n- django-s3file (PyPI): affected all versions; fixed in 5.5.1\n- django-s3file (PyPI): affected all versions; fixed in 5.5.1\n- django-s3file (PyPI): affected all versions; fixed in 5.5.1\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2022-24840/ (Markdown: https://insights.sbomify.com/CVE-2022-24840/index.md)","id":"CVE-2022-24840","markdown":"https://insights.sbomify.com/CVE-2022-24840/index.md","name":"CVE-2022-24840","record":{"aliases":["GHSA-4w8f-hjm9-xwgf","PYSEC-2022-208"],"analysis":null,"analysis_generated_by":null,"assigner":"GitHub_M","cpe":[{"product":"django-s3file","vendor":"django-s3file_project"}],"cvss":{"score":9.1,"severity":"critical","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N","version":"3.1"},"cwes":[{"id":"CWE-22","name":"Improper Limitation of a Pathname to a Restricted Directory"}],"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.","ecosystems":["PyPI"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"weaponised"},"has_fix":true,"headline":"Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in django-s3file","id":"CVE-2022-24840","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":null,"year":"2022"},"n_packages":3,"n_references":2,"next":{"headline":"Improper Authorization in github.com/fleetdm/fleet","id":"CVE-2022-24841"},"packages":[{"ecosystem":"PyPI","fixed":["5.5.1"],"introduced":["0"],"last_affected":[],"package":"django-s3file","purl":null,"source":"GHSA-4w8f-hjm9-xwgf"},{"ecosystem":"PyPI","fixed":["5.5.1"],"introduced":["0"],"last_affected":[],"package":"django-s3file","purl":"pkg:pypi/django-s3file","source":"GHSA-4w8f-hjm9-xwgf"},{"ecosystem":"PyPI","fixed":["5.5.1"],"introduced":["0"],"last_affected":[],"package":"django-s3file","purl":"pkg:pypi/django-s3file","source":"PYSEC-2022-208"}],"prev":{"headline":"Uncontrolled Resource Consumption in org.cyberneko.html (nokogiri fork)","id":"CVE-2022-24839"},"products":["django-s3file"],"published":"2022-06-06","related":[],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"PyPA Advisory Database","prefix":"PYSEC"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"yes","exploitation":"poc","technical_impact":"total"},"state":"PUBLISHED","updated":"2025-04-22","vendors":["codingjoe"]},"summary":null,"url":"https://insights.sbomify.com/CVE-2022-24840/"}