# 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

- Severity: Medium 6.7 (CVSS:3.1, scored by redhat) `CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.35%, higher than 30% of CVEs (2026-12-01)
- Published: 2024-06-12T08:53:02.256Z
- Modified: 2026-11-25T14:17:05.887Z
- Weaknesses: CWE-59
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: redhat

## 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.

(As written by CVE List.)

## Affected

- nano: no versions given (not affected: from 0:2.9.8-3.el8_10 before *; from 0:5.6.1-6.el9 before *)
- gnu nano: from 2.2.0 before 8.0
- redhat enterprise_linux: 6.0; 7.0; 8.0; 9.0

## Every score

- redhat: CVSS:3.1 6.7 Medium `CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H`
- NVD: CVSS:3.1 6.7 Medium `CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H`

## References

- <https://access.redhat.com/errata/RHSA-2024:6986> (vendor-advisory)
- <https://access.redhat.com/errata/RHSA-2024:9430> (vendor-advisory)
- <https://access.redhat.com/security/cve/CVE-2024-5742> (vdb-entry, vendor-advisory)
- <https://bugzilla.redhat.com/show_bug.cgi?id=2278574> (issue-tracking, vendor-advisory)
- <https://lists.debian.org/debian-lts-announce/2024/06/msg00006.html>
- <https://cert-portal.siemens.com/productcert/html/ssa-398330.html>

## Sources

- CVE List: [CVE-2024-5742](https://www.cve.org/CVERecord?id=CVE-2024-5742), CVE Terms of Use, modified 2026-11-25
- NVD: [CVE-2024-5742](https://nvd.nist.gov/vuln/detail/CVE-2024-5742), Public domain, modified 2026-11-25

---

Page: https://cve.day/CVE-2024-5742 · Whole record: https://cve.day/CVE-2024-5742.json · Rebuilt by cve.day 2026-11-25T23:18:23.503Z
