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
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
| CVSS | Score | Vector | Source |
|---|---|---|---|
| 3.1 | 6.7 Medium | CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H | redhat |
Weaknesses
- CWE-59 Improper Link Resolution Before File Access ('Link Following')
Affected Products
| Product | Versions |
|---|---|
nano | |
Red Hat Enterprise Linux 8Red Hat |
|
Red Hat Enterprise Linux 9Red Hat |
|
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.