CVE-2024-5742

Nano: running `chmod` and `chown` on the filename allows malicious user to replace the emergency file with a malicious symlink to a root-owned file

State
Published
Severity
6.7 Medium
Published
Jun 12, 2024
Updated
Oct 15, 2026
Reserved
Jun 7, 2024

Read the record on cve.org

Description

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.

Scores

CVSSScoreVectorSource
3.16.7 MediumCVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:Hredhat

Weaknesses

  • CWE-59 Improper Link Resolution Before File Access ('Link Following')

Affected Products

ProductVersions
nano
    Red Hat Enterprise Linux 8Red Hat
    • 0:2.9.8-3.el8_10 and laterNot affected
    Red Hat Enterprise Linux 9Red Hat
    • 0:5.6.1-6.el9 and laterNot affected
    Red Hat Enterprise Linux 10Red Hat
      Red Hat Enterprise Linux 6Red Hat
        Red Hat Enterprise Linux 7Red Hat

          References

          Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.