Vulnerability · Published Jun 12, 2024 · Assigned by redhat
CVE-2024-5742Nano: running `chmod` and `chown` on the filename allows malicious user to replace the emergency file with a malicious symlink to a root-owned file
Medium 6.7
In plain English
A medium-severity security flaw in nano. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.3% (higher than 28% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Severity (CVSS 3.1)6.7Medium
Exploit odds (30 days)0.3%top 71.9% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known
Official 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 packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| AlmaLinux:8 | nano | 2.9.8-3.el8_10 | ALSA-2024:6986 |
| AlmaLinux:9 | nano | 5.6.1-6.el9 | ALSA-2024:9430 |
| Debian:12 | nano | 7.2-1+deb12u1 | DEBIAN-CVE-2024-5742 |
| Debian:13 | nano | 8.0-1 | DEBIAN-CVE-2024-5742 |
| Debian:14 | nano | 8.0-1 | DEBIAN-CVE-2024-5742 |
| Rocky Linux:8 | nano | 0:2.9.8-3.el8_10 | RLSA-2024:6986 |
| Rocky Linux:9 | nano | 0:5.6.1-6.el9 | RLSA-2024:9430 |
| Ubuntu:22.04:LTS | nano | 6.2-1ubuntu0.1 | USN-7064-1 |
| Ubuntu:22.04:LTS | nano | 6.2-1ubuntu0.1 | UBUNTU-CVE-2024-5742 |
| Ubuntu:24.04:LTS | nano | 7.2-2ubuntu0.1 | UBUNTU-CVE-2024-5742 |
| Ubuntu:24.04:LTS | nano | 7.2-2ubuntu0.1 | USN-7064-1 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| nano | see references | |
| Red Hat | Red Hat Enterprise Linux 8 | see references |
| Red Hat | Red Hat Enterprise Linux 9 | see references |
| Red Hat | Red Hat Enterprise Linux 10 | see references |
| Red Hat | Red Hat Enterprise Linux 6 | see references |
| Red Hat | Red Hat Enterprise Linux 7 | see references |
Weakness: CWE-59 · Vector: CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H
References
- RHSA-2024:6986 vendor-advisory, x_refsource_REDHAT
- RHSA-2024:9430 vendor-advisory, x_refsource_REDHAT
- https://access.redhat.com/security/cve/CVE-2024-5742 vdb-entry, x_refsource_REDHAT
- RHBZ#2278574 issue-tracking, x_refsource_REDHAT
- https://lists.debian.org/debian-lts-announce/2024/06/msg00006.html x_transferred
- https://cert-portal.siemens.com/productcert/html/ssa-398330.html