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
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.
Attack profile
How easy it is to exploit
- Attack vector
- Local
- Complexity
- High
- Privileges needed
- Low
- User interaction
- Required
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
CVE List Score used
6.7
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
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.
- Record
CVE-2024-5742- CVSS 3.1
- 6.7 Medium
CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H - Weakness
- CWE-59
- Updated
- 2026-11-06
EUVDEUVD-2024-47130
6.7
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.
- Record
EUVD-2024-47130- CVSS 3.1
- 6.7 Medium
CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H - Updated
- 2026-11-06
GitHub AdvisoriesGHSA-ffhx-2rrf-9c23
4.7
A vulnerability was found in GNU Nano that allows a possible privilege escalation through an...
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.
- Record
GHSA-ffhx-2rrf-9c23- CVSS 3.1
- 4.7 Medium
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:N - Weakness
- CWE-59, CWE-377
- Updated
- 2026-11-02
NVD
6.7
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.
- Record
CVE-2024-5742- CVSS 3.1
- 6.7 Medium
CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H - Weakness
- CWE-59
- Updated
- 2026-11-06
OSVAZL-42612
6.7
CVE-2024-5742 affecting package nano for versions less than 6.4-2
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.
- Record
AZL-42612- CVSS 3.1
- 6.7 Medium
CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H - Updated
- 2026-11-05
OSVAZL-42619
6.7
CVE-2024-5742 affecting package nano for versions less than 6.0-3
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.
- Record
AZL-42619- CVSS 3.1
- 6.7 Medium
CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
Show 18 moreShow less
OSVBELL-CVE-2024-5742
6.7
- Record
BELL-CVE-2024-5742- CVSS 3.1
- 6.7 Medium
CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSV
6.7
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.
- Record
CVE-2024-5742- CVSS 3.1
- 6.7 Medium
CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVDEBIAN-CVE-2024-5742
6.7
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.
- Record
DEBIAN-CVE-2024-5742- CVSS 3.1
- 6.7 Medium
CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H - Updated
- 2026-11-07
OSVOESA-2024-1735
4.7
nano security update
Nano is now part of Apache CouchDB.
Security Fix(es):
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.(CVE-2024-5742)
- Record
OESA-2024-1735- CVSS 3.1
- 4.7 Medium
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:N - Updated
- 2026-11-02
OSVRHSA-2024:6986
6.7
Red Hat Security Advisory: nano security update
- Record
RHSA-2024:6986- CVSS 3.1
- 6.7 Medium
CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVRHSA-2024:9430
6.7
Red Hat Security Advisory: nano security update
- Record
RHSA-2024:9430- CVSS 3.1
- 6.7 Medium
CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVUBUNTU-CVE-2024-5742
6.7
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.
- Record
UBUNTU-CVE-2024-5742- CVSS 3.1
- 6.7 Medium
CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSVALSA-2024:6986 No score
Low: nano security update
GNU nano is a small and friendly text editor.
Security Fix(es):
- nano: running
chmodandchownon the filename allows malicious user to replace the emergency file with a malicious symlink to a root-owned file (CVE-2024-5742)
For more details about the security issue(s), including the impact, a CVSS score, acknowledgments, and other related information, refer to the CVE page(s) listed in the References section.
- Record
ALSA-2024:6986- Updated
- 2026-11-02
OSVALSA-2024:9430 No score
Low: nano security update
GNU nano is a small and friendly text editor.
Security Fix(es):
- nano: running
chmodandchownon the filename allows malicious user to replace the emergency file with a malicious symlink to a root-owned file (CVE-2024-5742)
For more details about the security issue(s), including the impact, a CVSS score, acknowledgments, and other related information, refer to the CVE page(s) listed in the References section.
Additional Changes:
For detailed information on changes in this release, see the AlmaLinux Release Notes linked from the References section.
- Record
ALSA-2024:9430- Updated
- 2026-11-02
OSVCLSA-2026-1779122764 No score
nano: Fix of CVE-2024-5742
- CVE-2024-5742: emergency_save() applied chmod/chown to a path after the descriptor was closed, allowing a symlink swap to redirect the ownership change to an attacker-controlled file
- Backport of upstream commit 5e7a3c2e from nano v8.0, adapted to the 5.6.1 codebase (write_file signature predates the SPECIAL/NONOTES refactor)
- Record
CLSA-2026-1779122764- Updated
- 2026-11-02
OSVMGASA-2024-0223 No score
Updated nano packages fix security vulnerability
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. (CVE-2024-5742)
- Record
MGASA-2024-0223- Updated
- 2026-11-02
OSVopenSUSE-SU-2024:0157-1 No score
Security update for nano
This update for nano fixes the following issues:
- CVE-2024-5742: Avoid privilege escalations via symlink attacks on emergency save file (boo#1226099)
- Record
openSUSE-SU-2024:0157-1- Updated
- 2026-11-02
OSVopenSUSE-SU-2024:0157-2 No score
Security update for nano
This update for nano fixes the following issues:
- CVE-2024-5742: Avoid privilege escalations via symlink attacks on emergency save file (boo#1226099)
- Record
openSUSE-SU-2024:0157-2- Updated
- 2026-11-02
OSVopenSUSE-SU-2024:14034-1 No score
nano-8.0-2.1 on GA media
These are all security issues fixed in the nano-8.0-2.1 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2024:14034-1- Updated
- 2026-11-02
OSVRLSA-2024:6986 No score
Low: nano security update
GNU nano is a small and friendly text editor.
Security Fix(es):
- nano: running
chmodandchownon the filename allows malicious user to replace the emergency file with a malicious symlink to a root-owned file (CVE-2024-5742)
For more details about the security issue(s), including the impact, a CVSS score, acknowledgments, and other related information, refer to the CVE page(s) listed in the References section.
- Record
RLSA-2024:6986- Updated
- 2026-11-02
OSVRLSA-2024:9430 No score
Low: nano security update
GNU nano is a small and friendly text editor.
Security Fix(es):
- nano: running
chmodandchownon the filename allows malicious user to replace the emergency file with a malicious symlink to a root-owned file (CVE-2024-5742)
For more details about the security issue(s), including the impact, a CVSS score, acknowledgments, and other related information, refer to the CVE page(s) listed in the References section.
Additional Changes:
For detailed information on changes in this release, see the Rocky Linux 9.5 Release Notes linked from the References section.
- Record
RLSA-2024:9430- Updated
- 2026-11-02
OSVUSN-7064-1 No score
nano vulnerability
It was discovered that nano allowed a possible privilege escalation through an insecure temporary file. If nano was killed while editing, the permissions granted to the emergency save file could be used by an attacker to escalate privileges using a malicious symlink.
- Record
USN-7064-1- Updated
- 2026-11-02
OSVUSN-7064-2 No score
nano vulnerability
USN-7064-1 fixed a vulnerability in nano. This update provides the corresponding update for Ubuntu 14.04 LTS.
Original advisory details:
It was discovered that nano allowed a possible privilege escalation through an insecure temporary file. If nano was killed while editing, the permissions granted to the emergency save file could be used by an attacker to escalate privileges using a malicious symlink.
- Record
USN-7064-2- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
nanoAlmaLinux:8 |
before 2.9.8-3.el8_10 | 2.9.8-3.el8_10 |
nanoAlmaLinux:9 |
before 5.6.1-6.el9 | 5.6.1-6.el9 |
nanoAzure Linux:3 |
before 6.4-2 | 6.4-2 |
nanoAzure Linux:2 |
before 6.0-3 | 6.0-3 |
nanoAlpaquita:23 |
7.0-r0 up to 8.7.1-r0 | 8.7.1-r0 |
nanoAlpaquita:stream |
7.0-r0 up to 8.0-r0 | 8.0-r0 |
nanoTuxCare:AlmaLinux:9.2 |
before 5.6.1-5.el9.tuxcare.els1 | 5.6.1-5.el9.tuxcare.els1 |
nanoDebian:12 |
before 7.2-1+deb12u1, plus listed versions 7.2-1 |
7.2-1+deb12u1 |
nanoDebian:13 |
before 8.0-1 | 8.0-1 |
nanoDebian:14 |
before 8.0-1 | 8.0-1 |
Show 25 moreShow less
| Package | Affected | Fixed |
|---|---|---|
nanoDebian:10 |
before 3.2-3+deb10u1, plus listed versions 3.2-3 |
3.2-3+deb10u1 |
nanoMageia:9 |
before 7.2-1.1.mga9 | 7.2-1.1.mga9 |
nanoopenEuler:20.03-LTS-SP4 |
before 8.0-1.oe2003sp4 | 8.0-1.oe2003sp4 |
nanoopenEuler:22.03-LTS-SP1 |
before 8.0-1.oe2203sp1 | 8.0-1.oe2203sp1 |
nanoopenEuler:22.03-LTS-SP3 |
before 8.0-1.oe2203sp3 | 8.0-1.oe2203sp3 |
nanoopenEuler:24.03-LTS |
before 8.0-1.oe2403 | 8.0-1.oe2403 |
nanoRed Hat:enterprise_linux:8::baseos |
before 0:2.9.8-3.el8_10 | 0:2.9.8-3.el8_10 |
nano-debuginfoRed Hat:enterprise_linux:8::baseos |
before 0:2.9.8-3.el8_10 | 0:2.9.8-3.el8_10 |
nano-debugsourceRed Hat:enterprise_linux:8::baseos |
before 0:2.9.8-3.el8_10 | 0:2.9.8-3.el8_10 |
nanoRed Hat:enterprise_linux:9::baseos |
before 0:5.6.1-6.el9 | 0:5.6.1-6.el9 |
nano-debuginfoRed Hat:enterprise_linux:9::baseos |
before 0:5.6.1-6.el9 | 0:5.6.1-6.el9 |
nano-debugsourceRed Hat:enterprise_linux:9::baseos |
before 0:5.6.1-6.el9 | 0:5.6.1-6.el9 |
nanoRocky Linux:8 |
before 0:2.9.8-3.el8_10 | 0:2.9.8-3.el8_10 |
nanoRocky Linux:9 |
before 0:5.6.1-6.el9 | 0:5.6.1-6.el9 |
nanoUbuntu:Pro:14.04:LTS |
before 2.2.6-1ubuntu1+esm1, plus listed versions 2.2.6-1ubuntu1 |
2.2.6-1ubuntu1+esm1 |
nanoUbuntu:Pro:16.04:LTS |
before 2.5.3-2ubuntu2+esm1, plus listed versions 2.4.2-12.4.2-1ubuntu12.4.3-12.5.0-12.5.1-1 Show 4 moreShow less2.5.2-12.5.3-22.5.3-2ubuntu12.5.3-2ubuntu2 |
2.5.3-2ubuntu2+esm1 |
nanoUbuntu:Pro:18.04:LTS |
before 2.9.3-2ubuntu0.1~esm1, plus listed versions 2.8.6-32.8.7-12.9.0-12.9.1-12.9.2-12.9.3-12.9.3-2 |
2.9.3-2ubuntu0.1~esm1 |
nanoUbuntu:20.04:LTS |
before 4.8-1ubuntu1.1, plus listed versions 4.3-14.5-14.7-14.7-24.8-14.8-1ubuntu1 |
4.8-1ubuntu1.1 |
nanoUbuntu:22.04:LTS |
before 6.2-1ubuntu0.1, plus listed versions 5.6.1-1build15.9-16.0-16.1-16.2-1 |
6.2-1ubuntu0.1 |
nanoUbuntu:24.04:LTS |
before 7.2-2ubuntu0.1, plus listed versions 7.2-17.2-27.2-2build1 |
7.2-2ubuntu0.1 |
nanoSUSE:Package Hub 15 SP5 |
before 7.2-bp156.3.3.1 | 7.2-bp156.3.3.1 |
nanoSUSE:Package Hub 15 SP6 |
before 7.2-bp156.3.3.1 | 7.2-bp156.3.3.1 |
nanoopenSUSE:Leap 15.5 |
before 7.2-bp156.3.3.1 | 7.2-bp156.3.3.1 |
nanoopenSUSE:Leap 15.6 |
before 7.2-bp156.3.3.1 | 7.2-bp156.3.3.1 |
nanoopenSUSE:Tumbleweed |
before 8.0-2.1 | 8.0-2.1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| facts | OSV | |
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2024-5742 is a medium vulnerability (CVSS 6.7) in Gnu Nano, published June 8, 2024. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.34%, the 28th percentile. Fixed in nano 2.9.8-3.el8_10.
References
access.redhat.com/errata/RHSA-2024:6986
access.redhat.com/errata/RHSA-2024:9430
access.redhat.com/security/cve/CVE-2024-5742
bugzilla.redhat.com/show_bug.cgi?id=2278574
lists.debian.org/debian-lts-announce/2024/06/msg00006.html
cert-portal.siemens.com/productcert/html/ssa-398330.html
Show 26 moreShow less
nvd.nist.gov/vuln/detail/CVE-2024-5742
github.com/advisories/GHSA-ffhx-2rrf-9c23
bugzilla.redhat.com/2278574
errata.almalinux.org/8/ALSA-2024-6986.html
errata.almalinux.org/9/ALSA-2024-9430.html
docs.bell-sw.com/security/cves/CVE-2024-5742
errata.tuxcare.com/els_os/almalinux9.2esu/CLSA-2026-1779122764.html
security-tracker.debian.org/tracker/CVE-2024-5742
advisories.mageia.org/MGASA-2024-0223.html
bugs.mageia.org/show_bug.cgi?id=33297
lists.opensuse.org/archives/list/[email protected]/message/VCJGQ6SCOSZGXAPYA7GYUT3M6ZPBLO5V
openeuler.org/en/security/safety-bulletin/detail.html?id=openEuler-SA-2024-1735
access.redhat.com/security/updates/classification
security.access.redhat.com/data/csaf/v2/advisories/2024/rhsa-2024_6986.json
cve.org/CVERecord?id=CVE-2024-5742
docs.redhat.com/en/documentation/red_hat_enterprise_linux/9/html/9.5_release_notes/index
security.access.redhat.com/data/csaf/v2/advisories/2024/rhsa-2024_9430.json
errata.rockylinux.org/RLSA-2024:6986
errata.rockylinux.org/RLSA-2024:9430
ubuntu.com/security/CVE-2024-5742
ubuntu.com/security/notices/USN-7064-1
ubuntu.com/security/notices/USN-7064-2
lists.opensuse.org/archives/list/[email protected]/thread/VCJGQ6SCOSZGXAPYA7GYUT3M6ZPBLO5V
bugzilla.suse.com/1226099
suse.com/security/cve/CVE-2024-5742
lists.opensuse.org/archives/list/[email protected]/thread/GBANP4TJZOYQBX7QCCMXMTPLJ7XCVTTU