CVE-2024-5742
NixOS vulnerability analysis and mitigation

Overview

A vulnerability was discovered in GNU Nano (CVE-2024-5742) that allows potential privilege escalation through an insecure temporary file handling mechanism. When Nano is killed while editing, it saves the buffer to an emergency file with the permissions of the running user, creating a window of opportunity for attackers to escalate privileges through a malicious symlink (Debian Security, Ubuntu Security).

Technical details

The vulnerability occurs when Nano is killed while having a modified buffer. The editor saves this buffer to an emergency .save file and then applies chmod and chown commands to match the permissions and owner of the original file. This becomes exploitable when Nano is run as root and edits a user-owned file in a directory writable by that user, allowing a malicious user to replace the .save file with a malicious symlink to a root-owned file. The vulnerability has a CVSS 3.1 base score of 6.7 (Medium), with attack vector being Local, attack complexity High, and requiring Low privileges (Ubuntu Security, Red Hat Bugzilla).

Impact

The primary impact of this vulnerability is the potential for privilege escalation on multi-user systems. It particularly affects scenarios where an administrator might open a user's file (for example, to fix a broken config file) using root privileges. If the user has the ability to kill the Nano process run by root, they could exploit this vulnerability to gain elevated privileges (Red Hat Bugzilla).

Exploitability

The vulnerability requires specific conditions to be exploitable: Nano must be running as root, editing a user-owned file in a user-writable directory, and the malicious user must have the ability to kill the Nano process. One example scenario involves root being logged in over SSH to a low-privilege user machine where the user can interrupt the connection, such as by turning off the WiFi (Red Hat Bugzilla).

Mitigation and workarounds

The vulnerability has been fixed in various distributions through security updates. The fix was implemented in Nano version 8.0 through commit 5e7a3c2e7e118c7f12d5dfda9f9140f638976aa2. Multiple vendors have released patched versions: Red Hat Enterprise Linux 8 (RHSA-2024:6986), Red Hat Enterprise Linux 9 (RHSA-2024:9430), Ubuntu 22.04 LTS (6.2-1ubuntu0.1), and Debian (various versions) (Red Hat Security, Ubuntu Security).

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

Debian

Fixed

bookworm

nano: 7.2-1+deb12u1

Fixed

bullseye

nano: 5.4-2+deb11u3

Fixed

sid

nano: 8.0-1

Fixed

trixie

nano: 8.0-1

Fixed

SourceThis report was generated using AI

Related NixOS vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-78662HIGH7.5
  • Docker logoDocker
  • argo-workflows-fips-4.1
NoYesSep 02, 2026
CVE-2026-56855HIGH7.5
  • Docker logoDocker
  • grafana-13.2
NoYesSep 02, 2026
CVE-2026-84642HIGH7.5
  • NixOS logoNixOS
  • cpe:2.3:a:mozilla:thunderbird
NoYesSep 01, 2026
CVE-2026-84641HIGH7.5
  • NixOS logoNixOS
  • thunderbird
NoYesSep 01, 2026
CVE-2026-32773MEDIUM6.1
  • NixOS logoNixOS
  • spark
NoYesSep 02, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management