CVE Vulnerabilities

CVE-2021-28153

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

Published: Mar 11, 2021 | Modified: Nov 07, 2023
CVSS 3.x
5.3
MEDIUM
Source:
NVD
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
CVSS 2.x
5 MEDIUM
AV:N/AC:L/Au:N/C:N/I:P/A:N
RedHat/V2
RedHat/V3
5.3 LOW
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
Ubuntu
MEDIUM

An issue was discovered in GNOME GLib before 2.66.8. When g_file_replace() is used with G_FILE_CREATE_REPLACE_DESTINATION to replace a path that is a dangling symlink, it incorrectly also creates the target of the symlink as an empty file, which could conceivably have security relevance if the symlink is attacker-controlled. (If the path is a symlink to a file that already exists, then the contents of that file correctly remain unchanged.)

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
Glib Gnome * 2.66.8 (excluding)
Red Hat Enterprise Linux 8 RedHat glib2-0:2.56.4-156.el8 *
Red Hat Enterprise Linux 9 RedHat mingw-glib2-0:2.70.1-2.el9 *
Glib2.0 Ubuntu bionic *
Glib2.0 Ubuntu esm-infra-legacy/trusty *
Glib2.0 Ubuntu focal *
Glib2.0 Ubuntu groovy *
Glib2.0 Ubuntu precise/esm *
Glib2.0 Ubuntu trusty *
Glib2.0 Ubuntu trusty/esm *
Glib2.0 Ubuntu upstream *
Glib2.0 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