Bug 1998621 (CVE-2021-40153) - CVE-2021-40153 squashfs-tools: unvalidated filepaths allow writing outside of destination
Summary: CVE-2021-40153 squashfs-tools: unvalidated filepaths allow writing outside of...
Keywords:
Status: NEW
Alias: CVE-2021-40153
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Nobody
QA Contact:
URL:
Whiteboard:
Depends On: 1998622 2000637 2000638 2000656
Blocks: 1998293
TreeView+ depends on / blocked
 
Reported: 2021-08-27 18:20 UTC by Guilherme de Almeida Suckevicz
Modified: 2024-05-22 09:49 UTC (History)
4 users (show)

Fixed In Version: squashfs-tools 4.5
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2024:2396 0 None None None 2024-04-30 10:07:26 UTC
Red Hat Product Errata RHSA-2024:3139 0 None None None 2024-05-22 09:49:05 UTC

Description Guilherme de Almeida Suckevicz 2021-08-27 18:20:35 UTC
squashfs_opendir in unsquash-1.c in Squashfs-Tools versions before 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.

Reference:
https://github.com/plougher/squashfs-tools/issues/72

Upstream patch:
https://github.com/plougher/squashfs-tools/commit/79b5a555058eef4e1e7ff220c344d39f8cd09646

Comment 1 Guilherme de Almeida Suckevicz 2021-08-27 18:20:51 UTC
Created squashfs-tools tracking bugs for this issue:

Affects: fedora-all [bug 1998622]

Comment 2 Fedora Update System 2021-08-30 20:41:47 UTC
FEDORA-2021-cdbd827c1e has been pushed to the Fedora 34 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 6 Fedora Update System 2021-09-29 01:07:59 UTC
FEDORA-2021-9fb6da134f has been pushed to the Fedora 33 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 7 Bruno Wolff III 2021-10-06 06:24:22 UTC
The fix is now in all current versions of Fedora.

Comment 9 errata-xmlrpc 2024-04-30 10:07:25 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9

Via RHSA-2024:2396 https://access.redhat.com/errata/RHSA-2024:2396

Comment 10 errata-xmlrpc 2024-05-22 09:49:04 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2024:3139 https://access.redhat.com/errata/RHSA-2024:3139


Note You need to log in before you can comment on or make changes to this bug.