Skip to content
OpenAdvisories
Medium · 6.7 CVE-2024-5742 EUVD-2024-47130GHSA-ffhx-2rrf-9c23

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

Published Jun 12, 2024 · Updated Nov 6, 2026 · Assigned by redhat

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.

Affected products

VendorProductAffectedFixed
— nano — —
Red Hat Red Hat Enterprise Linux 8 — —
Red Hat Red Hat Enterprise Linux 9 — —
Red Hat Red Hat Enterprise Linux 10 — —
Red Hat Red Hat Enterprise Linux 6 — —
Red Hat Red Hat Enterprise Linux 7 — —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 nano 8.0-1 —
Debian 13 nano 8.0-1 —
Debian 12 nano 7.2-1+deb12u1 —
Debian 10 nano 3.2-3+deb10u1 DLA-3831-1
ReleasePackageFixed inAdvisory
Ubuntu 24.04 LTS nano 7.2-2ubuntu0.1 USN-7064-1
Ubuntu 22.04 LTS nano 6.2-1ubuntu0.1 USN-7064-1
Ubuntu 20.04 LTS nano 4.8-1ubuntu1.1 USN-7064-1
Show 3 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu Pro 18.04 LTS nano 2.9.3-2ubuntu0.1~esm1 USN-7064-1
Ubuntu Pro 16.04 LTS nano 2.5.3-2ubuntu2+esm1 USN-7064-1
Ubuntu Pro 14.04 LTS nano 2.2.6-1ubuntu1+esm1 USN-7064-2
ReleasePackageFixed inAdvisory
RHEL 9 nano 5.6.1-6.el9 RHSA-2024:9430
RHEL 8 nano 2.9.8-3.el8_10 RHSA-2024:6986

AlmaLinux

Errata ↗
ReleasePackageFixed inAdvisory
AlmaLinux 9 nano 5.6.1-6.el9 ALSA-2024:9430
AlmaLinux 8 nano 2.9.8-3.el8_10 ALSA-2024:6986

Rocky Linux

Errata ↗
ReleasePackageFixed inAdvisory
Rocky Linux 9 nano 5.6.1-6.el9 RLSA-2024:9430
Rocky Linux 8 nano 2.9.8-3.el8_10 RLSA-2024:6986
ReleasePackageFixed inAdvisory
SUSE Package Hub 15 SP6 nano 7.2-bp156.3.3.1 openSUSE-SU-2024:0157-2, openSUSE-SU-2024:0157-1
SUSE Package Hub 15 SP5 nano 7.2-bp156.3.3.1 openSUSE-SU-2024:0157-2, openSUSE-SU-2024:0157-1
ReleasePackageFixed inAdvisory
openSUSE Tumbleweed nano 8.0-2.1 openSUSE-SU-2024:14034-1
openSUSE Leap 15.6 nano 7.2-bp156.3.3.1 openSUSE-SU-2024:0157-2, openSUSE-SU-2024:0157-1
openSUSE Leap 15.5 nano 7.2-bp156.3.3.1 openSUSE-SU-2024:0157-2, openSUSE-SU-2024:0157-1

Amazon Linux

ReleasePackageFixed inAdvisory
Amazon Linux 2023 nano +2 5.8-3.amzn2023.0.4 ALAS2023-2024-652
Amazon Linux 2 nano 2.9.8-2.amzn2.0.2 ALAS2-2024-2590

Azure Linux

ReleasePackageFixed inAdvisory
Azure Linux 3 nano 6.4-2 —
Azure Linux 2 (CBL-Mariner) nano 6.0-3 —

Oracle Linux

ReleasePackageFixed inAdvisory
Oracle Linux 9 nano 5.6.1-6.el9 ELSA-2024-9430
Oracle Linux 8 nano 2.9.8-3.el8_10 ELSA-2024-6986

Advisories 20

References