{"answers":{"affected":"8 open source packages ship an affected version, including django and Django. It affects 3 products.","exploited":"There is no known exploitation of CVE-2021-3281 in the wild and no public exploit code.","fix":"Upgrade django to a fixed version for your release line: 2.2.18, 3.0.12 or 3.1.6.","what":"CVE-2021-3281 is a medium-severity path traversal vulnerability in Djangoproject Django, published on 2 Feb 2021. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2021-3281 and fix it if it is affected.\n\nWhat it is: CVE-2021-3281 is a medium-severity path traversal vulnerability in Djangoproject Django, published on 2 Feb 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2021-3281 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- django (Bitnami): affected from 2.2.0; fixed in 2.2.18, 3.0.12, 3.1.6\n- django (PyPI): affected from 2.2; fixed in 2.2.18, 3.0.12, 3.1.6\n- django (PyPI): affected from 2.2; fixed in 2.2.18\n- django (PyPI): affected from 3.0; fixed in 3.0.12\n- django (PyPI): affected from 3.1; fixed in 3.1.6\n- Django (PyPI): affected from 2.2; fixed in 2.2.18\n- Django (PyPI): affected from 3.0; fixed in 3.0.12\n- Django (PyPI): affected from 3.1; fixed in 3.1.6\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-2021-3281/ (Markdown: https://insights.sbomify.com/CVE-2021-3281/index.md)","id":"CVE-2021-3281","markdown":"https://insights.sbomify.com/CVE-2021-3281/index.md","name":"CVE-2021-3281","record":{"aliases":["BIT-django-2021-3281","DEBIAN-CVE-2021-3281","DLA-2540-1","GHSA-fvgf-6h6h-3322","PYSEC-2021-9","SUSE-RU-2021:0497-1","UBUNTU-CVE-2021-3281","USN-4715-1","USN-4715-2"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["data_read","data_modify"],"network_reachable":"yes","non_default_config":false,"product_category":"Django web framework","requires_auth":"none","summary":"Attackers can exploit directory traversal in Django's archive extraction to read or modify files outside the intended directory during project initialization.","user_interaction":"not_required","vuln_class":"path_traversal"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"mitre","cpe":[{"product":"django","vendor":"djangoproject"},{"product":"fedora","vendor":"fedoraproject"},{"product":"snapcenter","vendor":"netapp"}],"cvss":{"score":5.3,"severity":"medium","source":"nvd","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","version":"3.1"},"cwes":[{"id":"CWE-22","name":"Improper Limitation of a Pathname to a Restricted Directory"}],"description":"In Django 2.2 before 2.2.18, 3.0 before 3.0.12, and 3.1 before 3.1.6, the django.utils.archive.extract method (used by \"startapp --template\" and \"startproject --template\") allows directory traversal via an archive with absolute paths or relative paths with dot segments.","ecosystems":["Bitnami","PyPI","SUSE:OpenStack Cloud 9","SUSE:OpenStack Cloud Crowbar 9"],"exploits":{"exploitdb":0,"first_seen":"2021-07-05","github_poc":1,"max_poc_stars":2,"metasploit":0,"nuclei":0,"refs":[{"date":"2021-07-05T08:25:26Z","kind":"github_poc","ref":"https://github.com/lwzSoviet/CVE-2021-3281","stars":2,"title":null}],"tier":"poc_unverified"},"has_fix":true,"headline":"Django Directory Traversal via archive.extract","id":"CVE-2021-3281","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Bitnami","product":"djangoproject:django","products":["djangoproject:django","fedoraproject:fedora","netapp:snapcenter"],"type":"path_traversal","year":"2021"},"n_packages":37,"n_references":5,"next":{"headline":"Improper Authentication in HashiCorp Vault","id":"CVE-2021-3282"},"packages":[{"ecosystem":"Bitnami","fixed":["2.2.18","3.0.12","3.1.6"],"introduced":["2.2.0","3.0.0","3.1.0"],"last_affected":[],"package":"django","purl":"pkg:bitnami/django","source":"BIT-django-2021-3281"},{"ecosystem":"PyPI","fixed":["2.2.18"],"introduced":["2.2"],"last_affected":[],"package":"Django","purl":null,"source":"GHSA-fvgf-6h6h-3322"},{"ecosystem":"PyPI","fixed":["3.0.12"],"introduced":["3.0"],"last_affected":[],"package":"Django","purl":null,"source":"GHSA-fvgf-6h6h-3322"},{"ecosystem":"PyPI","fixed":["3.1.6"],"introduced":["3.1"],"last_affected":[],"package":"Django","purl":null,"source":"GHSA-fvgf-6h6h-3322"},{"ecosystem":"PyPI","fixed":["2.2.18","3.0.12","3.1.6"],"introduced":["2.2","3.0","3.1"],"last_affected":[],"package":"django","purl":"pkg:pypi/django","source":"PYSEC-2021-9"},{"ecosystem":"PyPI","fixed":["2.2.18"],"introduced":["2.2"],"last_affected":[],"package":"django","purl":"pkg:pypi/django","source":"GHSA-fvgf-6h6h-3322"},{"ecosystem":"PyPI","fixed":["3.0.12"],"introduced":["3.0"],"last_affected":[],"package":"django","purl":"pkg:pypi/django","source":"GHSA-fvgf-6h6h-3322"},{"ecosystem":"PyPI","fixed":["3.1.6"],"introduced":["3.1"],"last_affected":[],"package":"django","purl":"pkg:pypi/django","source":"GHSA-fvgf-6h6h-3322"},{"ecosystem":"SUSE:OpenStack Cloud 9","fixed":["9.0+git.1611600773.5f1de5f-3.22.1"],"introduced":["0"],"last_affected":[],"package":"ardana-db","purl":"pkg:rpm/suse/ardana-db\u0026distro=SUSE%20OpenStack%20Cloud%209","source":"SUSE-RU-2021:0497-1"},{"ecosystem":"SUSE:OpenStack Cloud 9","fixed":["9.0+git.1610491814.38661c2-3.16.1"],"introduced":["0"],"last_affected":[],"package":"ardana-horizon","purl":"pkg:rpm/suse/ardana-horizon\u0026distro=SUSE%20OpenStack%20Cloud%209","source":"SUSE-RU-2021:0497-1"},{"ecosystem":"SUSE:OpenStack Cloud 9","fixed":["9.0+git.1610490922.d5f9813-3.16.1"],"introduced":["0"],"last_affected":[],"package":"ardana-logging","purl":"pkg:rpm/suse/ardana-logging\u0026distro=SUSE%20OpenStack%20Cloud%209","source":"SUSE-RU-2021:0497-1"},{"ecosystem":"SUSE:OpenStack Cloud 9","fixed":["9.0+git.1610547641.d79ecfd-3.22.1"],"introduced":["0"],"last_affected":[],"package":"ardana-monasca","purl":"pkg:rpm/suse/ardana-monasca\u0026distro=SUSE%20OpenStack%20Cloud%209","source":"SUSE-RU-2021:0497-1"},{"ecosystem":"SUSE:OpenStack Cloud 9","fixed":["9.0+git.1611867924.eb82818-4.16.1"],"introduced":["0"],"last_affected":[],"package":"ardana-opsconsole-ui","purl":"pkg:rpm/suse/ardana-opsconsole-ui\u0026distro=SUSE%20OpenStack%20Cloud%209","source":"SUSE-RU-2021:0497-1"},{"ecosystem":"SUSE:OpenStack Cloud 9","fixed":["9.0+git.1610634027.5934cf8-3.25.1"],"introduced":["0"],"last_affected":[],"package":"ardana-osconfig","purl":"pkg:rpm/suse/ardana-osconfig\u0026distro=SUSE%20OpenStack%20Cloud%209","source":"SUSE-RU-2021:0497-1"},{"ecosystem":"SUSE:OpenStack Cloud 9","fixed":["4.6.3-4.6.1"],"introduced":["0"],"last_affected":[],"package":"kibana","purl":"pkg:rpm/suse/kibana\u0026distro=SUSE%20OpenStack%20Cloud%209","source":"SUSE-RU-2021:0497-1"},{"ecosystem":"SUSE:OpenStack Cloud 9","fixed":["14.1.1~dev10-3.21.3"],"introduced":["0"],"last_affected":[],"package":"openstack-dashboard","purl":"pkg:rpm/suse/openstack-dashboard\u0026distro=SUSE%20OpenStack%20Cloud%209","source":"SUSE-RU-2021:0497-1"},{"ecosystem":"SUSE:OpenStack Cloud 9","fixed":["7.4.2~dev60-4.33.2"],"introduced":["0"],"last_affected":[],"package":"openstack-manila","purl":"pkg:rpm/suse/openstack-manila\u0026distro=SUSE%20OpenStack%20Cloud%209","source":"SUSE-RU-2021:0497-1"},{"ecosystem":"SUSE:OpenStack Cloud 9","fixed":["13.0.8~dev147-3.34.2"],"introduced":["0"],"last_affected":[],"package":"openstack-neutron","purl":"pkg:rpm/suse/openstack-neutron\u0026distro=SUSE%20OpenStack%20Cloud%209","source":"SUSE-RU-2021:0497-1"},{"ecosystem":"SUSE:OpenStack Cloud 9","fixed":["12.0.1~dev16-3.22.2"],"introduced":["0"],"last_affected":[],"package":"openstack-neutron-gbp","purl":"pkg:rpm/suse/openstack-neutron-gbp\u0026distro=SUSE%20OpenStack%20Cloud%209","source":"SUSE-RU-2021:0497-1"},{"ecosystem":"SUSE:OpenStack Cloud 9","fixed":["18.3.1~dev78-3.34.2"],"introduced":["0"],"last_affected":[],"package":"openstack-nova","purl":"pkg:rpm/suse/openstack-nova\u0026distro=SUSE%20OpenStack%20Cloud%209","source":"SUSE-RU-2021:0497-1"},{"ecosystem":"SUSE:OpenStack Cloud 9","fixed":["1.11.29-3.18.2"],"introduced":["0"],"last_affected":[],"package":"python-Django1","purl":"pkg:rpm/suse/python-Django1\u0026distro=SUSE%20OpenStack%20Cloud%209","source":"SUSE-RU-2021:0497-1"},{"ecosystem":"SUSE:OpenStack Cloud 9","fixed":["9.20201214-3.27.2"],"introduced":["0"],"last_affected":[],"package":"release-notes-suse-openstack-cloud","purl":"pkg:rpm/suse/release-notes-suse-openstack-cloud\u0026distro=SUSE%20OpenStack%20Cloud%209","source":"SUSE-RU-2021:0497-1"},{"ecosystem":"SUSE:OpenStack Cloud 9","fixed":["14.1.1~dev10-4.25.2"],"introduced":["0"],"last_affected":[],"package":"venv-openstack-horizon","purl":"pkg:rpm/suse/venv-openstack-horizon\u0026distro=SUSE%20OpenStack%20Cloud%209","source":"SUSE-RU-2021:0497-1"},{"ecosystem":"SUSE:OpenStack Cloud 9","fixed":["7.4.2~dev60-3.27.2"],"introduced":["0"],"last_affected":[],"package":"venv-openstack-manila","purl":"pkg:rpm/suse/venv-openstack-manila\u0026distro=SUSE%20OpenStack%20Cloud%209","source":"SUSE-RU-2021:0497-1"},{"ecosystem":"SUSE:OpenStack Cloud 9","fixed":["13.0.8~dev147-6.25.2"],"introduced":["0"],"last_affected":[],"package":"venv-openstack-neutron","purl":"pkg:rpm/suse/venv-openstack-neutron\u0026distro=SUSE%20OpenStack%20Cloud%209","source":"SUSE-RU-2021:0497-1"},{"ecosystem":"SUSE:OpenStack Cloud 9","fixed":["18.3.1~dev78-3.25.2"],"introduced":["0"],"last_affected":[],"package":"venv-openstack-nova","purl":"pkg:rpm/suse/venv-openstack-nova\u0026distro=SUSE%20OpenStack%20Cloud%209","source":"SUSE-RU-2021:0497-1"},{"ecosystem":"SUSE:OpenStack Cloud Crowbar 9","fixed":["6.0+git.1611320924.849e748ff-3.34.1"],"introduced":["0"],"last_affected":[],"package":"crowbar-core","purl":"pkg:rpm/suse/crowbar-core\u0026distro=SUSE%20OpenStack%20Cloud%20Crowbar%209","source":"SUSE-RU-2021:0497-1"},{"ecosystem":"SUSE:OpenStack Cloud Crowbar 9","fixed":["6.0+git.1610402342.21499240d-3.31.1"],"introduced":["0"],"last_affected":[],"package":"crowbar-openstack","purl":"pkg:rpm/suse/crowbar-openstack\u0026distro=SUSE%20OpenStack%20Cloud%20Crowbar%209","source":"SUSE-RU-2021:0497-1"},{"ecosystem":"SUSE:OpenStack Cloud Crowbar 9","fixed":["4.6.3-4.6.1"],"introduced":["0"],"last_affected":[],"package":"kibana","purl":"pkg:rpm/suse/kibana\u0026distro=SUSE%20OpenStack%20Cloud%20Crowbar%209","source":"SUSE-RU-2021:0497-1"},{"ecosystem":"SUSE:OpenStack Cloud Crowbar 9","fixed":["14.1.1~dev10-3.21.3"],"introduced":["0"],"last_affected":[],"package":"openstack-dashboard","purl":"pkg:rpm/suse/openstack-dashboard\u0026distro=SUSE%20OpenStack%20Cloud%20Crowbar%209","source":"SUSE-RU-2021:0497-1"},{"ecosystem":"SUSE:OpenStack Cloud Crowbar 9","fixed":["7.4.2~dev60-4.33.2"],"introduced":["0"],"last_affected":[],"package":"openstack-manila","purl":"pkg:rpm/suse/openstack-manila\u0026distro=SUSE%20OpenStack%20Cloud%20Crowbar%209","source":"SUSE-RU-2021:0497-1"},{"ecosystem":"SUSE:OpenStack Cloud Crowbar 9","fixed":["13.0.8~dev147-3.34.2"],"introduced":["0"],"last_affected":[],"package":"openstack-neutron","purl":"pkg:rpm/suse/openstack-neutron\u0026distro=SUSE%20OpenStack%20Cloud%20Crowbar%209","source":"SUSE-RU-2021:0497-1"},{"ecosystem":"SUSE:OpenStack Cloud Crowbar 9","fixed":["12.0.1~dev16-3.22.2"],"introduced":["0"],"last_affected":[],"package":"openstack-neutron-gbp","purl":"pkg:rpm/suse/openstack-neutron-gbp\u0026distro=SUSE%20OpenStack%20Cloud%20Crowbar%209","source":"SUSE-RU-2021:0497-1"},{"ecosystem":"SUSE:OpenStack Cloud Crowbar 9","fixed":["18.3.1~dev78-3.34.2"],"introduced":["0"],"last_affected":[],"package":"openstack-nova","purl":"pkg:rpm/suse/openstack-nova\u0026distro=SUSE%20OpenStack%20Cloud%20Crowbar%209","source":"SUSE-RU-2021:0497-1"},{"ecosystem":"SUSE:OpenStack Cloud Crowbar 9","fixed":["1.11.29-3.18.2"],"introduced":["0"],"last_affected":[],"package":"python-Django1","purl":"pkg:rpm/suse/python-Django1\u0026distro=SUSE%20OpenStack%20Cloud%20Crowbar%209","source":"SUSE-RU-2021:0497-1"},{"ecosystem":"SUSE:OpenStack Cloud Crowbar 9","fixed":["9.20201214-3.27.2"],"introduced":["0"],"last_affected":[],"package":"release-notes-suse-openstack-cloud","purl":"pkg:rpm/suse/release-notes-suse-openstack-cloud\u0026distro=SUSE%20OpenStack%20Cloud%20Crowbar%209","source":"SUSE-RU-2021:0497-1"},{"ecosystem":"SUSE:OpenStack Cloud Crowbar 9","fixed":["0.9.0-7.6.1"],"introduced":["0"],"last_affected":[],"package":"sleshammer","purl":"pkg:rpm/suse/sleshammer\u0026distro=SUSE%20OpenStack%20Cloud%20Crowbar%209","source":"SUSE-RU-2021:0497-1"}],"prev":{"headline":"Cross-site scripting in n/a","id":"CVE-2021-3279"},"products":["n/a"],"published":"2021-02-02","related":[{"cvss_score":9.8,"headline":"Privilege abuse in GenericInlineModelAdmin","id":"CVE-2026-4277","kev_date_added":null,"published":"2026-04-07"},{"cvss_score":9.8,"headline":"Django SQL injection in HasKey(lhs, rhs) on Oracle","id":"CVE-2024-53908","kev_date_added":null,"published":"2024-12-06"},{"cvss_score":9.8,"headline":"Django SQL injection vulnerability","id":"CVE-2024-42005","kev_date_added":null,"published":"2024-08-07"},{"cvss_score":9.8,"headline":"Django bypasses validation when using one form field to upload multiple files","id":"CVE-2023-31047","kev_date_added":null,"published":"2023-05-07"},{"cvss_score":9.8,"headline":"Django `Trunc()` and `Extract()` database functions vulnerable to SQL Injection","id":"CVE-2022-34265","kev_date_added":null,"published":"2022-07-04"},{"cvss_score":9.8,"headline":"SQL Injection in Django","id":"CVE-2021-35042","kev_date_added":null,"published":"2021-07-02"},{"cvss_score":9.8,"headline":"SQL injection in Django","id":"CVE-2020-7471","kev_date_added":null,"published":"2020-02-03"}],"sources":[{"class":"attribution","licence":"Apache-2.0","name":"Bitnami","prefix":"BIT"},{"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":"CC BY 4.0","name":"SUSE","prefix":"SUSE"},{"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)"},{"class":"open","licence":"CC0","name":"PoC-in-GitHub"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":"PUBLISHED","updated":"2024-08-03","vendors":["n/a"]},"summary":"Attackers can exploit directory traversal in Django's archive extraction to read or modify files outside the intended directory during project initialization.","url":"https://insights.sbomify.com/CVE-2021-3281/"}