CVE Vulnerabilities

CVE-2021-28153

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

Published: Mar 11, 2021 | Modified: Nov 21, 2024
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
root.io logo minimus.io logo echo.ai logo

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

NameVendorStart VersionEnd Version
GlibGnome*2.66.8 (excluding)
Red Hat Enterprise Linux 8RedHatglib2-0:2.56.4-156.el8*
Red Hat Enterprise Linux 9RedHatmingw-glib2-0:2.70.1-2.el9*
Glib2.0Ubuntubionic*
Glib2.0Ubuntuesm-infra-legacy/trusty*
Glib2.0Ubuntuesm-infra/bionic*
Glib2.0Ubuntuesm-infra/focal*
Glib2.0Ubuntuesm-infra/xenial*
Glib2.0Ubuntufocal*
Glib2.0Ubuntugroovy*
Glib2.0Ubuntuprecise/esm*
Glib2.0Ubuntutrusty*
Glib2.0Ubuntutrusty/esm*
Glib2.0Ubuntuupstream*
Glib2.0Ubuntuxenial*

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