CVE Vulnerabilities

CVE-2021-20197

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

Published: Mar 26, 2021 | Modified: Feb 12, 2023
CVSS 3.x
6.3
MEDIUM
Source:
NVD
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:N
CVSS 2.x
3.3 LOW
AV:L/AC:M/Au:N/C:P/I:P/A:N
RedHat/V2
RedHat/V3
4.2 MODERATE
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:L/I:L/A:N
Ubuntu
LOW

There is an open race window when writing output in the following utilities in GNU binutils version 2.35 and earlier:ar, objcopy, strip, ranlib. When these utilities are run as a privileged user (presumably as part of a script updating binaries across different users), an unprivileged user can trick these utilities into getting ownership of arbitrary files through a symlink.

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

Name Vendor Start Version End Version
Binutils Gnu * 2.35 (including)
Red Hat Enterprise Linux 8 RedHat binutils-0:2.30-108.el8 *
Red Hat Enterprise Linux 8 RedHat binutils-0:2.30-108.el8 *
Binutils Ubuntu bionic *
Binutils Ubuntu esm-infra-legacy/trusty *
Binutils Ubuntu esm-infra/bionic *
Binutils Ubuntu esm-infra/xenial *
Binutils Ubuntu focal *
Binutils Ubuntu groovy *
Binutils Ubuntu precise/esm *
Binutils Ubuntu trusty *
Binutils Ubuntu trusty/esm *
Binutils Ubuntu upstream *
Binutils Ubuntu xenial *

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