Every CVE Search/ Get API key

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

6.7 MediumFix available

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

0.34%Up 0.3 points since Jun 13, 2024
90%50%10%1%

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 MediumCVSS: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 MediumCVSS: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 MediumCVSS: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 MediumCVSS: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 MediumCVSS: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 MediumCVSS: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 MediumCVSS: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 MediumCVSS: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 MediumCVSS: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 MediumCVSS: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 MediumCVSS: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 MediumCVSS: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 MediumCVSS: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 chmod and chown on 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 chmod and chown on 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 chmod and chown on 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 chmod and chown on 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

Affected packages
PackageAffectedFixed
nano
AlmaLinux:8
before 2.9.8-3.el8_10
2.9.8-3.el8_10
nano
AlmaLinux:9
before 5.6.1-6.el9
5.6.1-6.el9
nano
Azure Linux:3
before 6.4-2
6.4-2
nano
Azure Linux:2
before 6.0-3
6.0-3
nano
Alpaquita:23
7.0-r0 up to 8.7.1-r0
8.7.1-r0
nano
Alpaquita:stream
7.0-r0 up to 8.0-r0
8.0-r0
nano
TuxCare:AlmaLinux:9.2
before 5.6.1-5.el9.tuxcare.els1
5.6.1-5.el9.tuxcare.els1
nano
Debian:12
before 7.2-1+deb12u1, plus listed versions
7.2-1
7.2-1+deb12u1
nano
Debian:13
before 8.0-1
8.0-1
nano
Debian:14
before 8.0-1
8.0-1
Show 25 moreShow less
Affected packages
PackageAffectedFixed
nano
Debian:10
before 3.2-3+deb10u1, plus listed versions
3.2-3
3.2-3+deb10u1
nano
Mageia:9
before 7.2-1.1.mga9
7.2-1.1.mga9
nano
openEuler:20.03-LTS-SP4
before 8.0-1.oe2003sp4
8.0-1.oe2003sp4
nano
openEuler:22.03-LTS-SP1
before 8.0-1.oe2203sp1
8.0-1.oe2203sp1
nano
openEuler:22.03-LTS-SP3
before 8.0-1.oe2203sp3
8.0-1.oe2203sp3
nano
openEuler:24.03-LTS
before 8.0-1.oe2403
8.0-1.oe2403
nano
Red Hat:enterprise_linux:8::baseos
before 0:2.9.8-3.el8_10
0:2.9.8-3.el8_10
nano-debuginfo
Red Hat:enterprise_linux:8::baseos
before 0:2.9.8-3.el8_10
0:2.9.8-3.el8_10
nano-debugsource
Red Hat:enterprise_linux:8::baseos
before 0:2.9.8-3.el8_10
0:2.9.8-3.el8_10
nano
Red Hat:enterprise_linux:9::baseos
before 0:5.6.1-6.el9
0:5.6.1-6.el9
nano-debuginfo
Red Hat:enterprise_linux:9::baseos
before 0:5.6.1-6.el9
0:5.6.1-6.el9
nano-debugsource
Red Hat:enterprise_linux:9::baseos
before 0:5.6.1-6.el9
0:5.6.1-6.el9
nano
Rocky Linux:8
before 0:2.9.8-3.el8_10
0:2.9.8-3.el8_10
nano
Rocky Linux:9
before 0:5.6.1-6.el9
0:5.6.1-6.el9
nano
Ubuntu:Pro:14.04:LTS
before 2.2.6-1ubuntu1+esm1, plus listed versions
2.2.6-1ubuntu1
2.2.6-1ubuntu1+esm1
nano
Ubuntu: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 less
2.5.2-12.5.3-22.5.3-2ubuntu12.5.3-2ubuntu2
2.5.3-2ubuntu2+esm1
nano
Ubuntu: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
nano
Ubuntu: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
nano
Ubuntu: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
nano
Ubuntu:24.04:LTS
before 7.2-2ubuntu0.1, plus listed versions
7.2-17.2-27.2-2build1
7.2-2ubuntu0.1
nano
SUSE:Package Hub 15 SP5
before 7.2-bp156.3.3.1
7.2-bp156.3.3.1
nano
SUSE:Package Hub 15 SP6
before 7.2-bp156.3.3.1
7.2-bp156.3.3.1
nano
openSUSE:Leap 15.5
before 7.2-bp156.3.3.1
7.2-bp156.3.3.1
nano
openSUSE:Leap 15.6
before 7.2-bp156.3.3.1
7.2-bp156.3.3.1
nano
openSUSE:Tumbleweed
before 8.0-2.1
8.0-2.1

History

History
RecordedChangedSources
factsOSV
first indexedCVE 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

Show 26 moreShow less
MoveEnter Open