CVE Vulnerabilities

CVE-2024-5742

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

Published: Jun 12, 2024 | Modified: Nov 21, 2024
CVSS 3.x
6.7
MEDIUM
Source:
NVD
CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H
CVSS 2.x
RedHat/V2
RedHat/V3
6.7 LOW
CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H
Ubuntu
LOW
root.io logo minimus.io logo echo.ai logo

A vulnerability was found in GNU Nano that allows a possible privilege escalation through an insecure temporary file. If Nano is killed while editing, a file it saves to an emergency file with the permissions of the running user provides a window of opportunity for attackers to escalate privileges through a malicious 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

NameVendorStart VersionEnd Version
NanoGnu2.2.0 (including)8.0 (excluding)
Red Hat Enterprise Linux 8RedHatnano-0:2.9.8-3.el8_10*
Red Hat Enterprise Linux 9RedHatnano-0:5.6.1-6.el9*
NanoUbuntuesm-infra-legacy/trusty*
NanoUbuntuesm-infra/bionic*
NanoUbuntuesm-infra/focal*
NanoUbuntuesm-infra/xenial*
NanoUbuntufocal*
NanoUbuntujammy*
NanoUbuntumantic*
NanoUbuntunoble*
NanoUbuntutrusty/esm*
NanoUbuntuupstream*

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