What’s Vulnerable › Vulnerabilities
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 (CVSS 6.7 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 0.3% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2024-06-12 · updated 2026-10-15
- Weakness: CWE-59
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.
Affected products
- GNU Nano: from 2.2.0 before 8.0 — fixed in 8.0
- Red Hat Enterprise Linux: 6.0, 7.0, 8.0, 9.0
How to fix
Upgrade to a fixed version: GNU Nano 8.0. Check the vendor advisory for mitigations.
References
- 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://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://cert-portal.siemens.com/productcert/html/ssa-398330.html
Get alerted when CVE-2024-5742 or the next vulnerability affects your stack