{"id":"CVE-2021-3281","published":"2021-02-02T06:16:28Z","modified":"2024-08-03T16:53:17Z","title":"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…","vendor":null,"product":null,"tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":null,"epss":{"score":0.07605,"percentile":0.94693,"provenance":"source"},"cwes":[],"references":[{"url":"https://groups.google.com/forum/#%21forum/django-announce","tags":["x_refsource_MISC"]},{"url":"https://docs.djangoproject.com/en/3.1/releases/security/","tags":["x_refsource_MISC"]},{"url":"https://www.djangoproject.com/weblog/2021/feb/01/security-releases/","tags":["x_refsource_CONFIRM"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/YF52FKEH5S2P5CM4X7IXSYG67YY2CDOO/","tags":["vendor-advisory","x_refsource_FEDORA"]},{"url":"https://security.netapp.com/advisory/ntap-20210226-0004/","tags":["x_refsource_CONFIRM"]}],"priority":{"score":23.9,"factors":[{"name":"EPSS percentile","points":18.94},{"name":"Public exploit code","points":5.0}]},"exploitSources":{"pocGithub":{"count":1,"skipped":0,"earliest":"2021-07-05","earliestUrl":"https://github.com/lwzSoviet/CVE-2021-3281","repos":[{"name":"lwzSoviet/CVE-2021-3281","url":"https://github.com/lwzSoviet/CVE-2021-3281","stars":2,"created":"2021-07-05"}]},"first":{"date":"2021-07-05","source":"PoC-in-GitHub","url":"https://github.com/lwzSoviet/CVE-2021-3281"},"provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"Django","vulnerableRanges":[">=2.2, <2.2.18",">=3.1, <3.1.6",">=3.0, <3.0.12"],"patched":["2.2.18","3.1.6","3.0.12"],"from":["GHSA-fvgf-6h6h-3322","PYSEC-2021-9"],"provenance":"source"}],"summary":{"text":"The flaw lies in Django's django.utils.archive.extract method, which is used by the \"startapp --template\" and \"startproject --template\" commands, in Django 2.2 before 2.2.18, 3.0 before 3.0.12, and 3.1 before 3.1.6. It allows directory traversal through an archive containing absolute paths or relative paths with dot segments, so an attacker can write files outside the intended extraction directory when such an archive is processed.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T20:57:15Z"},"euvd":{"id":"EUVD-2021-0066","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-djangoproject-django-cve-2021-3281","children":[{"from":"CVE-2021-3281","to":"CVE-2025-59682","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["django/utils/archive.py"],"commits":["https://github.com/django/django/commit/02e6592835b4559909aa3aaaf67988fef435f624","https://github.com/django/django/commit/05413afa8c18cdb978fcdf470e09f7a12b234a23","https://github.com/django/django/commit/43d84aef04a9e71164c21a74885996981857e66e","https://github.com/django/django/commit/924a0c092e65fa2d0953fd1855d2dc8786d94de2"],"basis":"shared function","functions":["has_leading_dir"]}]}],"packageHistory":[{"cve":"CVE-2020-13596","published":"2020-06-03","fixed":"3.0.7","kev":false},{"cve":"CVE-2020-24583","published":"2020-09-01","fixed":"3.1.1","kev":false},{"cve":"CVE-2020-24584","published":"2020-09-01","fixed":"3.1.1","kev":false,"link":{"from":"CVE-2020-24584","to":"CVE-2021-3281","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:Django","fromFixed":"2.2.16","toFixed":"2.2.18","daysApart":154},{"kind":"version-step","provenance":"source","package":"PyPI:Django","fromFixed":"3.1.1","toFixed":"3.1.6","daysApart":154}]}},{"cve":"CVE-2021-3281","published":"2021-02-02","fixed":"3.1.6","kev":false},{"cve":"CVE-2021-28658","published":"2021-04-06","fixed":"3.1.8","kev":false,"link":{"from":"CVE-2021-3281","to":"CVE-2021-28658","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:Django","fromFixed":"2.2.18","toFixed":"2.2.20","daysApart":63},{"kind":"version-step","provenance":"source","package":"PyPI:Django","fromFixed":"3.0.12","toFixed":"3.0.14","daysApart":63}]}},{"cve":"CVE-2021-31542","published":"2021-05-05","fixed":"3.2.1","kev":false},{"cve":"CVE-2021-32052","published":"2021-05-06","fixed":"3.2.2","kev":false}],"package":"PyPI:Django"}}