Bug 2024237 (CVE-2021-31566) - CVE-2021-31566 libarchive: symbolic links incorrectly followed when changing modes, times, ACL and flags of a file while extracting an archive
Summary: CVE-2021-31566 libarchive: symbolic links incorrectly followed when changing ...
Alias: CVE-2021-31566
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
: 2024242 (view as bug list)
Depends On: 2024238 2024239 2026075 2026078 2026828 2026829 2028035
Blocks: 2024258
TreeView+ depends on / blocked
Reported: 2021-11-17 16:42 UTC by Guilherme de Almeida Suckevicz
Modified: 2023-02-02 10:34 UTC (History)
19 users (show)

Fixed In Version: libarchive 3.5.2
Doc Type: If docs needed, set a value
Doc Text:
An improper link resolution flaw can occur while extracting an archive leading to changing modes, times, access control lists, and flags of a file outside of the archive. An attacker may provide a malicious archive to a victim user, who would trigger this flaw when trying to extract the archive. A local attacker may use this flaw to gain more privileges in a system.
Clone Of:
Last Closed: 2022-03-15 15:01:34 UTC

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2022:0892 0 None None None 2022-03-15 10:20:05 UTC

Description Guilherme de Almeida Suckevicz 2021-11-17 16:42:34 UTC
Some modes, times, ACLs and file flags especially on directories are set on archive_write_close() time. An archive can contain multiple entries with the same path. If a directory entry is marked for post-processing and a symlink entry with the same path "replaces" the directory with the symlink, the "fixup" postprocessing may alter the link target instead of the file itself.


Upstream patch:

Comment 1 Guilherme de Almeida Suckevicz 2021-11-17 16:42:59 UTC
Created libarchive tracking bugs for this issue:

Affects: fedora-all [bug 2024238]

Created mingw-libarchive tracking bugs for this issue:

Affects: fedora-all [bug 2024239]

Comment 4 Doran Moppert 2021-11-26 04:29:17 UTC
Second upstream patch completes the fix for this issue:


Comment 5 Doran Moppert 2021-11-26 04:30:37 UTC
*** Bug 2024242 has been marked as a duplicate of this bug. ***

Comment 11 Honza Horak 2021-12-22 13:35:58 UTC
There is another upstream fix that seems to be related (mentions the original b41daec):

which seems to be problematic and was later improved with this one:

Comment 13 errata-xmlrpc 2022-03-15 10:20:03 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2022:0892 https://access.redhat.com/errata/RHSA-2022:0892

Comment 14 Product Security DevOps Team 2022-03-15 15:01:31 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):


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