CVE Vulnerabilities

CVE-2024-5742

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

Published: Jun 12, 2024 | Modified: Nov 12, 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

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

Name Vendor Start Version End Version
Nano Gnu 2.2.0 (including) 8.0 (excluding)
Red Hat Enterprise Linux 8 RedHat nano-0:2.9.8-3.el8_10 *
Red Hat Enterprise Linux 9 RedHat nano-0:5.6.1-6.el9 *
Nano Ubuntu esm-infra/bionic *
Nano Ubuntu esm-infra/xenial *
Nano Ubuntu focal *
Nano Ubuntu jammy *
Nano Ubuntu mantic *
Nano Ubuntu noble *
Nano Ubuntu trusty/esm *
Nano Ubuntu upstream *

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