CVE Vulnerabilities

CVE-2021-31566

Improper Link Resolution Before File Access ('Link Following')

Published: Aug 23, 2022 | Modified: Nov 21, 2024
CVSS 3.x
7.8
HIGH
Source:
NVD
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
CVSS 2.x
RedHat/V2
RedHat/V3
7.1 MODERATE
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:H
Ubuntu
LOW
root.io logo minimus.io logo echo.ai logo

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.

Weakness

The product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource.

Affected Software

NameVendorStart VersionEnd Version
LibarchiveLibarchive*3.5.2 (excluding)
Red Hat Enterprise Linux 8RedHatlibarchive-0:3.3.3-3.el8_5*
LibarchiveUbuntubionic*
LibarchiveUbuntuesm-infra/bionic*
LibarchiveUbuntuesm-infra/focal*
LibarchiveUbuntufocal*
LibarchiveUbuntuhirsute*
LibarchiveUbuntuimpish*
LibarchiveUbuntutrusty*
LibarchiveUbuntutrusty/esm*
LibarchiveUbuntuupstream*
LibarchiveUbuntuxenial*

Potential Mitigations

  • Follow the principle of least privilege when assigning access rights to entities in a software system.
  • Denying access to a file can prevent an attacker from replacing that file with a link to a sensitive file. Ensure good compartmentalization in the system to provide protected areas that can be trusted.

References