CVEfocus › CVE database › CVE-2024-5742

CVE-2024-5742Nano: running `chmod` and `chown` on the filename allows malicious user to replace the…

CVSS 6.7 MediumEPSS 0.4% (higher than 22% of CVEs)Published 2024-06-12Updated 2026-11-25Assigner: redhat

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.

CWE-59

What to do

Fixed builds are available from AlmaLinux, Debian, Red Hat, Rocky Linux, Ubuntu: see the table below for the fixed version per release.

Ubuntu has not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

12Fixed
3Fix pending
2Will not fix
1Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 24.04nanoFixed7.2-2ubuntu0.1UBUNTU-CVE-2024-5742
Ubuntu 22.04nanoFixed6.2-1ubuntu0.1UBUNTU-CVE-2024-5742
Ubuntu 20.04nanoFixed4.8-1ubuntu1.1UBUNTU-CVE-2024-5742
Ubuntu 18.04nanoFix pending2.9.3-2ubuntu0.1~esm1 (Ubuntu Pro)UBUNTU-CVE-2024-5742
Ubuntu 16.04nanoFix pending2.5.3-2ubuntu2+esm1 (Ubuntu Pro)UBUNTU-CVE-2024-5742
Ubuntu 14.04nanoFix pending2.2.6-1ubuntu1+esm1 (Ubuntu Pro)UBUNTU-CVE-2024-5742
Debian 14nanoFixed8.0-1DEBIAN-CVE-2024-5742
Debian 13nanoFixed8.0-1DEBIAN-CVE-2024-5742
Debian 12nanoFixed7.2-1+deb12u1DEBIAN-CVE-2024-5742
Red Hat Enterprise Linux 10nanoNot affected
Red Hat Enterprise Linux 9nanoFixed0:5.6.1-6.el9RHSA-2024:9430
Red Hat Enterprise Linux 8nanoFixed0:2.9.8-3.el8_10RHSA-2024:6986
Red Hat Enterprise Linux 7nanoWill not fix
Out of support scope
Red Hat Enterprise Linux 6nanoWill not fix
Out of support scope
AlmaLinux 9nanoFixed5.6.1-6.el9ALSA-2024:9430
AlmaLinux 8nanoFixed2.9.8-3.el8_10ALSA-2024:6986
Rocky Linux 9nanoFixed0:5.6.1-6.el9RLSA-2024:9430
Rocky Linux 8nanoFixed0:2.9.8-3.el8_10RLSA-2024:6986

What the vendor says

As published in the CVE record by redhat, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

Vendor advisories:

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.