6.7medium
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
- 6.7medium CVSS:3.1 by redhat
- Exploit likelihood
- 0.35% (higher than 30% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- 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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| nano | Not specified Not affected: from 0:2.9.8-3.el8_10 before *, from 0:5.6.1-6.el9 before * | CVE List |
| gnu nano | from 2.2.0 before 8.0 | NVD |
| redhat enterprise_linux | 6.0, 7.0, 8.0, 9.0 | NVD |
All scores
| redhat | 6.7medium CVSS:3.1 | CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H |
| NVD | 6.7medium CVSS:3.1 | CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact total.
What each source says
CVE List
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.
NVD (es)
Se encontró una vulnerabilidad en GNU Nano que permite una posible escalada de privilegios a través de un archivo temporal inseguro. Si Nano muere mientras edita, un archivo que guarda en un archivo de emergencia con los permisos del usuario que lo ejecuta brinda una ventana de oportunidad para que los atacantes aumenten los privilegios a través de un enlace simbólico malicioso.
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
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2024-5742 changed 2026-11-25 | CVE Terms of Use |
| NVD | CVE-2024-5742 changed 2026-11-25 | Public domain |