CVE-2021-40153

Source
https://nvd.nist.gov/vuln/detail/CVE-2021-40153
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-40153.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2021-40153
Downstream
Related
Published
2021-08-27T15:15:09Z
Modified
2025-10-21T06:33:12.079824Z
Severity
  • 8.1 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H CVSS Calculator
Summary
[none]
Details

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.

References

Affected packages

Git / github.com/plougher/squashfs-tools

Affected ranges

Type
GIT
Repo
https://github.com/plougher/squashfs-tools
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Fixed

Affected versions

3.*

3.1
3.2
3.2-r2

4.*

4.4
4.4-git.1

Database specific

vanir_signatures

[
    {
        "source": "https://github.com/plougher/squashfs-tools/commit/79b5a555058eef4e1e7ff220c344d39f8cd09646",
        "target": {
            "file": "squashfs-tools/unsquashfs.h"
        },
        "signature_type": "Line",
        "deprecated": false,
        "id": "CVE-2021-40153-009ba15a",
        "signature_version": "v1",
        "digest": {
            "line_hashes": [
                "50828977239246341552227491787446239835",
                "128576841512081726737754358413906834367",
                "110043700371647694562612672828809094040"
            ],
            "threshold": 0.9
        }
    },
    {
        "source": "https://github.com/plougher/squashfs-tools/commit/79b5a555058eef4e1e7ff220c344d39f8cd09646",
        "target": {
            "file": "squashfs-tools/unsquash-2.c"
        },
        "signature_type": "Line",
        "deprecated": false,
        "id": "CVE-2021-40153-017e9ff3",
        "signature_version": "v1",
        "digest": {
            "line_hashes": [
                "160501286239700629092135283669755288177",
                "213780428136095547299888337788402941706",
                "23619371042075555198739527988650145162",
                "221334141776301865758225224668281721804",
                "266758379142232307434566963428457973280"
            ],
            "threshold": 0.9
        }
    },
    {
        "source": "https://github.com/plougher/squashfs-tools/commit/79b5a555058eef4e1e7ff220c344d39f8cd09646",
        "target": {
            "function": "squashfs_opendir",
            "file": "squashfs-tools/unsquash-4.c"
        },
        "signature_type": "Function",
        "deprecated": false,
        "id": "CVE-2021-40153-1d0dd43f",
        "signature_version": "v1",
        "digest": {
            "function_hash": "51293039805656847917657443662744577466",
            "length": 2505.0
        }
    },
    {
        "source": "https://github.com/plougher/squashfs-tools/commit/79b5a555058eef4e1e7ff220c344d39f8cd09646",
        "target": {
            "function": "squashfs_opendir",
            "file": "squashfs-tools/unsquash-1.c"
        },
        "signature_type": "Function",
        "deprecated": false,
        "id": "CVE-2021-40153-2e9654ae",
        "signature_version": "v1",
        "digest": {
            "function_hash": "80923551572641589015915162064405619249",
            "length": 2783.0
        }
    },
    {
        "source": "https://github.com/plougher/squashfs-tools/commit/79b5a555058eef4e1e7ff220c344d39f8cd09646",
        "target": {
            "file": "squashfs-tools/unsquashfs.c"
        },
        "signature_type": "Line",
        "deprecated": false,
        "id": "CVE-2021-40153-660bbe71",
        "signature_version": "v1",
        "digest": {
            "line_hashes": [
                "240446617043653286480198865004930916245",
                "85036573388738113650473330562054475123",
                "178959040955563739941298411213357854478",
                "52757748330772165091005910095155019992"
            ],
            "threshold": 0.9
        }
    },
    {
        "source": "https://github.com/plougher/squashfs-tools/commit/79b5a555058eef4e1e7ff220c344d39f8cd09646",
        "target": {
            "file": "squashfs-tools/unsquash-1.c"
        },
        "signature_type": "Line",
        "deprecated": false,
        "id": "CVE-2021-40153-7ca598b0",
        "signature_version": "v1",
        "digest": {
            "line_hashes": [
                "34954808733838894450630971783915405997",
                "213780428136095547299888337788402941706",
                "23619371042075555198739527988650145162",
                "221334141776301865758225224668281721804",
                "266758379142232307434566963428457973280"
            ],
            "threshold": 0.9
        }
    },
    {
        "source": "https://github.com/plougher/squashfs-tools/commit/79b5a555058eef4e1e7ff220c344d39f8cd09646",
        "target": {
            "file": "squashfs-tools/unsquash-4.c"
        },
        "signature_type": "Line",
        "deprecated": false,
        "id": "CVE-2021-40153-82fdbc53",
        "signature_version": "v1",
        "digest": {
            "line_hashes": [
                "197022567876957868834385391713847007419",
                "213780428136095547299888337788402941706",
                "23619371042075555198739527988650145162",
                "221334141776301865758225224668281721804",
                "266758379142232307434566963428457973280"
            ],
            "threshold": 0.9
        }
    },
    {
        "source": "https://github.com/plougher/squashfs-tools/commit/79b5a555058eef4e1e7ff220c344d39f8cd09646",
        "target": {
            "function": "squashfs_opendir",
            "file": "squashfs-tools/unsquash-3.c"
        },
        "signature_type": "Function",
        "deprecated": false,
        "id": "CVE-2021-40153-8898e7df",
        "signature_version": "v1",
        "digest": {
            "function_hash": "276419838980127061434609503158908259625",
            "length": 2787.0
        }
    },
    {
        "source": "https://github.com/plougher/squashfs-tools/commit/79b5a555058eef4e1e7ff220c344d39f8cd09646",
        "target": {
            "function": "squashfs_opendir",
            "file": "squashfs-tools/unsquash-2.c"
        },
        "signature_type": "Function",
        "deprecated": false,
        "id": "CVE-2021-40153-90eb83c8",
        "signature_version": "v1",
        "digest": {
            "function_hash": "80923551572641589015915162064405619249",
            "length": 2783.0
        }
    },
    {
        "source": "https://github.com/plougher/squashfs-tools/commit/79b5a555058eef4e1e7ff220c344d39f8cd09646",
        "target": {
            "file": "squashfs-tools/unsquash-3.c"
        },
        "signature_type": "Line",
        "deprecated": false,
        "id": "CVE-2021-40153-d2150224",
        "signature_version": "v1",
        "digest": {
            "line_hashes": [
                "254152677995986906383011311190010600236",
                "213780428136095547299888337788402941706",
                "23619371042075555198739527988650145162",
                "221334141776301865758225224668281721804",
                "266758379142232307434566963428457973280"
            ],
            "threshold": 0.9
        }
    }
]