CVE-2024-5742 Path traversal in Red Hat Enterprise Linux 10

Medium 6.7 Published Updated

Attackers can escalate privileges by replacing Nano emergency files with malicious symlinks during a race condition after a crash.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2024-5742?

CVE-2024-5742 is a medium-severity path traversal vulnerability in Redhat Enterprise Linux, published on 12 Jun 2024. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

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.

Weakness: CWE-59

Which versions are affected by CVE-2024-5742?

It affects 2 products.

Linux distribution packages (19)
nano AlmaLinux:8All versions2.9.8-3.el8_10
nano AlmaLinux:9All versions5.6.1-6.el9
nano Red Hat:enterprise_linux:8::baseosAll versions0:2.9.8-3.el8_10
nano-debuginfo Red Hat:enterprise_linux:8::baseosAll versions0:2.9.8-3.el8_10
nano-debugsource Red Hat:enterprise_linux:8::baseosAll versions0:2.9.8-3.el8_10
nano Red Hat:enterprise_linux:9::baseosAll versions0:5.6.1-6.el9
nano-debuginfo Red Hat:enterprise_linux:9::baseosAll versions0:5.6.1-6.el9
nano-debugsource Red Hat:enterprise_linux:9::baseosAll versions0:5.6.1-6.el9
nano Rocky Linux:8All versions0:2.9.8-3.el8_10
nano Rocky Linux:9All versions0:5.6.1-6.el9
nano SUSE:Package Hub 15 SP5All versions7.2-bp156.3.3.1
nano SUSE:Package Hub 15 SP5All versions7.2-bp156.3.3.1
nano SUSE:Package Hub 15 SP6All versions7.2-bp156.3.3.1
nano SUSE:Package Hub 15 SP6All versions7.2-bp156.3.3.1
nano openSUSE:Leap 15.5All versions7.2-bp156.3.3.1
nano openSUSE:Leap 15.5All versions7.2-bp156.3.3.1
nano openSUSE:Leap 15.6All versions7.2-bp156.3.3.1
nano openSUSE:Leap 15.6All versions7.2-bp156.3.3.1
nano openSUSE:TumbleweedAll versions8.0-2.1

Products include Gnu Nano, Redhat Enterprise Linux.

How do I fix CVE-2024-5742?

Apply the vendor's patch.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2024-5742 being exploited?

There is no known exploitation of CVE-2024-5742 in the wild and no public exploit code.

All Redhat Enterprise Linux vulnerabilities

Sources

Also known as ALSA-2024:6986, ALSA-2024:9430, AZL-42612, AZL-42619, BELL-CVE-2024-5742, CLSA-2026-1779122764 and 15 more.

Is CVE-2024-5742 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free