CVE-2024-5742

published 12 Jun 2024 · updated 6 Nov 2026

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.7MediumCVSS 6.7EPSS 0%

No exploitation in the wild has been reported. EPSS puts the chance of exploitation in the next 30 days at 0%. Fixed in nano 8.0.

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

Vendors, products and packages with version ranges

VendorProductVersionsFixed
GNUnano>=2.2.0 <8.08.0
Red HatEnterprise Linux
redhatenterprise_linux=7.0, =8.0, =9.0, =6.0

Timeline

Every event on this vulnerability

Related

Other vulnerabilities in GNU, strongest first

Embed

A live severity badge for an advisory, README or ticket

CVE-2024-5742 severity on Zeptric[![CVE-2024-5742](https://zeptric.io/badge/cve/CVE-2024-5742.svg)](https://zeptric.io/cve/CVE-2024-5742)