# 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

- Priority: **Routine**
- Reason: Not severe (CVSS 6.7, local access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2024-06-12 · Modified: 2026-11-25
- Aliases: MGASA-2024-0223, openSUSE-SU-2024:0157-1, openSUSE-SU-2024:0157-2, RHSA-2024:6986, RHSA-2024:9430, UBUNTU-CVE-2024-5742, USN-7064-1, USN-7064-2, DEBIAN-CVE-2024-5742, DLA-3831-1, openSUSE-SU-2024:14034-1
- Record: https://cvemate.com/vulnerability/CVE-2024-5742 · JSON: https://cvemate.com/vulnerability/CVE-2024-5742/json

## Description

```text
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.
```

## Signals

- CVSS: 6.7 medium (v3.1, CVE.org) CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H
- EPSS: 0.348%, percentile 30.439%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected

- debian nano (Debian): \< 3.2-3+deb10u1 \| \< 7.2-1+deb12u1 \| \< 8.0-1
- ubuntu nano (Ubuntu): \< 2.2.6-1ubuntu1+esm1 \| \< 2.5.3-2ubuntu2+esm1 \| \< 2.9.3-2ubuntu0.1~esm1 \| \< 4.8-1ubuntu1.1 \| \< 6.2-1ubuntu0.1 \| \< 7.2-2ubuntu0.1
- gnu nano: ≥ 2.2.0, \< 8.0
- mageia nano (Mageia): \< 7.2-1.1.mga9
- redhat enterprise\_linux: 6.0 \| 7.0 \| 8.0 \| 9.0
- opensuse nano&distro=openSUSE Leap 15.5 (openSUSE): \< 7.2-bp156.3.3.1
- opensuse nano&distro=openSUSE Leap 15.6 (openSUSE): \< 7.2-bp156.3.3.1
- opensuse nano&distro=openSUSE Tumbleweed (openSUSE): \< 8.0-2.1
- redhat nano (Red Hat): \< 0:2.9.8-3.el8\_10 \| \< 0:5.6.1-6.el9
- redhat nano-debuginfo (Red Hat): \< 0:2.9.8-3.el8\_10 \| \< 0:5.6.1-6.el9
- redhat nano-debugsource (Red Hat): \< 0:2.9.8-3.el8\_10 \| \< 0:5.6.1-6.el9
- suse nano&distro=SUSE Package Hub 15 SP5 (SUSE Linux Enterprise): \< 7.2-bp156.3.3.1
- suse nano&distro=SUSE Package Hub 15 SP6 (SUSE Linux Enterprise): \< 7.2-bp156.3.3.1

## References (first 20 of 23)

- <https://access.redhat.com/errata/RHSA-2024:6986>
- <https://access.redhat.com/errata/RHSA-2024:9430>
- <https://access.redhat.com/security/cve/CVE-2024-5742>
- <https://bugzilla.redhat.com/show_bug.cgi?id=2278574>
- <https://lists.debian.org/debian-lts-announce/2024/06/msg00006.html>
- <https://advisories.mageia.org/MGASA-2024-0223.html>
- <https://bugs.mageia.org/show_bug.cgi?id=33297>
- <https://lists.opensuse.org/archives/list/security-announce@lists.opensuse.org/message/VCJGQ6SCOSZGXAPYA7GYUT3M6ZPBLO5V/>
- <https://lists.opensuse.org/archives/list/security-announce@lists.opensuse.org/thread/VCJGQ6SCOSZGXAPYA7GYUT3M6ZPBLO5V/>
- <https://bugzilla.suse.com/1226099>
- <https://www.suse.com/security/cve/CVE-2024-5742>
- <https://lists.opensuse.org/archives/list/security-announce@lists.opensuse.org/thread/GBANP4TJZOYQBX7QCCMXMTPLJ7XCVTTU/>
- <https://access.redhat.com/security/updates/classification/#low>
- <https://security.access.redhat.com/data/csaf/v2/advisories/2024/rhsa-2024_6986.json>
- <https://www.cve.org/CVERecord?id=CVE-2024-5742>
- <https://nvd.nist.gov/vuln/detail/CVE-2024-5742>
- <https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html/9.5_release_notes/index>
- <https://security.access.redhat.com/data/csaf/v2/advisories/2024/rhsa-2024_9430.json>
- <https://ubuntu.com/security/CVE-2024-5742>
- <https://ubuntu.com/security/notices/USN-7064-1>

---

Data as of 2026-12-05T03:14:50.503Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
