High
Security advisory
squashfs_opendir in unsquash-1.c in Squashfs-Tools 4.5 stores the filename in the directory entry; this is then used by unsquashfs to create the new file during the unsquash. The filename is not validated for traversal outside of the destination directory, and thus allows writing to locations outside of the destination.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2021-40153
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 31 Oct 2026, 12:53 UTC · Revision 1
Source evidence
squashfs_opendir in unsquash-1.c in Squashfs-Tools 4.5 stores the filename in the directory entry; this is then used by unsquashfs to create the new file during the unsquash. The filename is not validated for traversal outside of the destination directory, and thus allows writing to locations outside of the destination.
osv:CVE-2021-40153
Complete source record
{
"id": "918a6f43f8dc774e72acffdf7219a4072556038d6cac5a4697048659656354b2",
"url": "https://osv.dev/vulnerability/CVE-2021-40153",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "CVE-2021-40153",
"summary": "squashfs_opendir in unsquash-1.c in Squashfs-Tools 4.5 stores the filename in the directory entry; this is then used by unsquashfs to create the new file during the unsquash. The filename is not validated for traversal outside of the destination directory, and thus allows writing to locations outside of the destination.",
"evidence": "osv:CVE-2021-40153",
"products": [],
"severity": "high",
"structured": {
"id": "CVE-2021-40153",
"aliases": [
"CVE-2021-40153"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/plougher/squashfs-tools",
"type": "GIT",
"events": [
{
"introduced": "0496d7c3de3e09da37ba492081c86159806ebb07"
},
{
"last_affected": "0496d7c3de3e09da37ba492081c86159806ebb07"
},
{
"fixed": "79b5a555058eef4e1e7ff220c344d39f8cd09646"
}
],
"database_specific": {
"extracted_events": [
{
"cpe": "cpe:2.3:a:squashfs-tools_project:squashfs-tools:4.5:*:*:*:*:*:*:*",
"range": [
{
"introduced": "4.5"
},
{
"last_affected": "4.5"
}
],
"source": "CPE_STRING"
},
{
"range": [
{
"fixed": "79b5a555058eef4e1e7ff220c344d39f8cd09646"
}
],
"source": "REFERENCES_COMMIT"
}
]
}
}
],
"versions": [
"4.5"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-40153.json",
"vanir_signatures": [
{
"id": "CVE-2021-40153-009ba15a",
"digest": {
"threshold": 0.9,
"line_hashes": [
"50828977239246341552227491787446239835",
"128576841512081726737754358413906834367",
"110043700371647694562612672828809094040"
]
},
"source": "https://github.com/plougher/squashfs-tools/commit/79b5a555058eef4e1e7ff220c344d39f8cd09646",
"target": {
"file": "squashfs-tools/unsquashfs.h"
},
"deprecated": false,
"signature_type": "Line",
"signature_version": "v1"
},
{
"id": "CVE-2021-40153-017e9ff3",
"digest": {
"threshold": 0.9,
"line_hashes": [
"160501286239700629092135283669755288177",
"213780428136095547299888337788402941706",
"23619371042075555198739527988650145162",
"221334141776301865758225224668281721804",
"266758379142232307434566963428457973280"
]
},
"source": "https://github.com/plougher/squashfs-tools/commit/79b5a555058eef4e1e7ff220c344d39f8cd09646",
"target": {
"file": "squashfs-tools/unsquash-2.c"
},
"deprecated": false,
"signature_type": "Line",
"signature_version": "v1"
},
{
"id": "CVE-2021-40153-1d0dd43f",
"digest": {
"length": 2505,
"function_hash": "51293039805656847917657443662744577466"
},
"source": "https://github.com/plougher/squashfs-tools/commit/79b5a555058eef4e1e7ff220c344d39f8cd09646",
"target": {
"file": "squashfs-tools/unsquash-4.c",
"function": "squashfs_opendir"
},
"deprecated": false,
"signature_type": "Function",
"signature_version": "v1"
},
{
"id": "CVE-2021-40153-2e9654ae",
"digest": {
"length": 2783,
"function_hash": "80923551572641589015915162064405619249"
},
"source": "https://github.com/plougher/squashfs-tools/commit/79b5a555058eef4e1e7ff220c344d39f8cd09646",
"target": {
"file": "squashfs-tools/unsquash-1.c",
"function": "squashfs_opendir"
},
"deprecated": false,
"signature_type": "Function",
"signature_version": "v1"
},
{
"id": "CVE-2021-40153-660bbe71",
"digest": {
"threshold": 0.9,
"line_hashes": [
"240446617043653286480198865004930916245",
"85036573388738113650473330562054475123",
"178959040955563739941298411213357854478",
"52757748330772165091005910095155019992"
]
},
"source": "https://github.com/plougher/squashfs-tools/commit/79b5a555058eef4e1e7ff220c344d39f8cd09646",
"target": {
"file": "squashfs-tools/unsquashfs.c"
},
"deprecated": false,
"signature_type": "Line",
"signature_version": "v1"
},
{
"id": "CVE-2021-40153-7ca598b0",
"digest": {
"threshold": 0.9,
"line_hashes": [
"34954808733838894450630971783915405997",
"213780428136095547299888337788402941706",
"23619371042075555198739527988650145162",
"221334141776301865758225224668281721804",
"266758379142232307434566963428457973280"
]
},
"source": "https://github.com/plougher/squashfs-tools/commit/79b5a555058eef4e1e7ff220c344d39f8cd09646",
"target": {
"file": "squashfs-tools/unsquash-1.c"
},
"deprecated": false,
"signature_type": "Line",
"signature_version": "v1"
},
{
"id": "CVE-2021-40153-82fdbc53",
"digest": {
"threshold": 0.9,
"line_hashes": [
"197022567876957868834385391713847007419",
"213780428136095547299888337788402941706",
"23619371042075555198739527988650145162",
"221334141776301865758225224668281721804",
"266758379142232307434566963428457973280"
]
},
"source": "https://github.com/plougher/squashfs-tools/commit/79b5a555058eef4e1e7ff220c344d39f8cd09646",
"target": {
"file": "squashfs-tools/unsquash-4.c"
},
"deprecated": false,
"signature_type": "Line",
"signature_version": "v1"
},
{
"id": "CVE-2021-40153-8898e7df",
"digest": {
"length": 2787,
"function_hash": "276419838980127061434609503158908259625"
},
"source": "https://github.com/plougher/squashfs-tools/commit/79b5a555058eef4e1e7ff220c344d39f8cd09646",
"target": {
"file": "squashfs-tools/unsquash-3.c",
"function": "squashfs_opendir"
},
"deprecated": false,
"signature_type": "Function",
"signature_version": "v1"
},
{
"id": "CVE-2021-40153-90eb83c8",
"digest": {
"length": 2783,
"function_hash": "80923551572641589015915162064405619249"
},
"source": "https://github.com/plougher/squashfs-tools/commit/79b5a555058eef4e1e7ff220c344d39f8cd09646",
"target": {
"file": "squashfs-tools/unsquash-2.c",
"function": "squashfs_opendir"
},
"deprecated": false,
"signature_type": "Function",
"signature_version": "v1"
},
{
"id": "CVE-2021-40153-d2150224",
"digest": {
"threshold": 0.9,
"line_hashes": [
"254152677995986906383011311190010600236",
"213780428136095547299888337788402941706",
"23619371042075555198739527988650145162",
"221334141776301865758225224668281721804",
"266758379142232307434566963428457973280"
]
},
"source": "https://github.com/plougher/squashfs-tools/commit/79b5a555058eef4e1e7ff220c344d39f8cd09646",
"target": {
"file": "squashfs-tools/unsquash-3.c"
},
"deprecated": false,
"signature_type": "Line",
"signature_version": "v1"
}
],
"vanir_signatures_modified": "2026-10-20T14:29:55Z"
}
}
],
"modified": "2026-10-20T14:29:55.748679663Z",
"provider": "osv",
"references": [
"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/GSMRKVJMJFX3MB7D3PXJSYY3TLZROE5S/",
"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/RAOZ4BKWAC4Y3U2K5MMW3S77HWWXHQDL/",
"https://bugs.launchpad.net/ubuntu/+source/squashfs-tools/+bug/1941790",
"https://lists.debian.org/debian-lts-announce/2021/08/msg00030.html",
"https://security.gentoo.org/glsa/202305-29",
"https://www.debian.org/security/2021/dsa-4967",
"https://github.com/plougher/squashfs-tools/commit/79b5a555058eef4e1e7ff220c344d39f8cd09646",
"https://github.com/plougher/squashfs-tools/issues/72"
],
"provider_metadata": {
"unresolved_ranges": [
{
"cpes": [
"cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*",
"cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*"
],
"vendor_product": "debian:debian_linux",
"extracted_events": [
{
"range": [
{
"introduced": "9.0"
},
{
"last_affected": "9.0"
},
{
"introduced": "10.0"
},
{
"last_affected": "10.0"
}
],
"source": "CPE_STRING"
}
]
},
{
"cpes": [
"cpe:2.3:o:fedoraproject:fedora:33:*:*:*:*:*:*:*",
"cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*"
],
"vendor_product": "fedoraproject:fedora",
"extracted_events": [
{
"range": [
{
"introduced": "34"
},
{
"last_affected": "34"
},
{
"introduced": "33"
},
{
"last_affected": "33"
}
],
"source": "CPE_STRING"
}
]
},
{
"cpes": [
"cpe:2.3:o:redhat:enterprise_linux:7.0:*:*:*:*:*:*:*",
"cpe:2.3:o:redhat:enterprise_linux:8.0:*:*:*:*:*:*:*"
],
"vendor_product": "redhat:enterprise_linux",
"extracted_events": [
{
"range": [
{
"introduced": "7.0"
},
{
"last_affected": "7.0"
},
{
"introduced": "8.0"
},
{
"last_affected": "8.0"
}
],
"source": "CPE_STRING"
}
]
}
]
}
},
"related_cves": [
{
"value": "CVE-2021-40153",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 389089,
"published_at": "2021-08-27T15:15:09.657+00:00"
}