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 (nano)
At a glance
- Source
- NVD
- EPSS
- EPSS 0.34 % · percentile 28 ()
- State
- PUBLISHED
- Published
- Updated
- Assigner
- redhat
- NVD status
- Modified
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.
Weaknesses (CWE)
- CWE-59 — Improper Link Resolution Before File Access
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://lists.debian.org/debian-lts-announce/2024/06/msg00006.html
- https://cert-portal.siemens.com/productcert/html/ssa-398330.html
Scores
| Version | Score | Vector | Scored by |
|---|---|---|---|
| CVSS 3.1 | MEDIUM 6.7 | CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H | redhat |
| CVSS 3.1 | MEDIUM 6.7 | CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H | NVD · secalert@redhat.com (Secondary) |
| CVSS 3.1 | MEDIUM 6.7 | CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H | NVD · nvd@nist.gov (Secondary) |
European references
- ENISA EUVD · EUVD-2024-47130
- GCVE · GCVE-0-2024-5742
CERT-FR advisories
- CERTFR-2025-AVI-0855 — Multiples vulnérabilités dans les produits Juniper Networks · cert.ssi.gouv.fr
- CERTFR-2025-AVI-0086 — Multiples vulnérabilités dans les produits IBM · cert.ssi.gouv.fr
Affected configurations (NVD CPE)
cpe:2.3:a:gnu:nano:*:*:*:*:*:*:*:*≥ 2.2.0 < 8.0cpe:2.3:o:redhat:enterprise_linux:6.0:*:*:*:*:*:*:*cpe:2.3:o:redhat:enterprise_linux:7.0:*:*:*:*:*:*:*cpe:2.3:o:redhat:enterprise_linux:8.0:*:*:*:*:*:*:*cpe:2.3:o:redhat:enterprise_linux:9.0:*:*:*:*:*:*:*
Affected products
| Product | Versions |
|---|---|
| nano | |
| Red Hat · Red Hat Enterprise Linux 8 | unaffected 0:2.9.8-3.el8_10 < * |
| Red Hat · Red Hat Enterprise Linux 9 | unaffected 0:5.6.1-6.el9 < * |
| Red Hat · Red Hat Enterprise Linux 10 | |
| Red Hat · Red Hat Enterprise Linux 6 | |
| Red Hat · Red Hat Enterprise Linux 7 |
Sources
| Source | Licence |
|---|---|
| CVE List (CVEProject cvelistV5) | CVE Program Terms of Use |
| EPSS (FIRST.org) | FIRST — attribution requested |
| ENISA EUVD | ENISA — reproduction authorised, source acknowledged |
| CERT-FR (ANSSI) | Licence Ouverte / Etalab 2.0 |
| NVD (NIST) via fkie-cad/nvd-json-data-feeds | Public domain — this product uses data from the NVD API but is not endorsed or certified by the NVD |