CVE-2024-47742: firmware_loader: Block path traversal
In the Linux kernel, the following vulnerability has been resolved:
firmwareloader: Block path traversal
Most firmware names are hardcoded strings, or are constructed from fairly constrained format strings where the dynamic parts are just some hex numbers or such.
However, there are a couple codepaths in the kernel where firmware file names contain string components that are passed through from a device or semi-privileged userspace; the ones I could find (not counting interfaces that require root privileges) are:
- lpfcsli4requestfirmwareupdate() seems to construct the firmware filename from "ModelName", a string that was previously parsed out of some descriptor ("Vital Product Data") in lpfcfillvpd() - nfpnetfwfind() seems to construct a firmware filename from a model name coming from nfphwinfolookup(pf->hwinfo, "nffw.partno"), which I think parses some descriptor that was read from the device. (But this case likely isn't exploitable because the format string looks like "netronome/nic%s", and there shouldn't be any folders starting with "netronome/nic". The previous case was different because there, the "%s" is at the start of the format string.) - moduleflashfwschedule() is reachable from the ETHTOOLMSGMODULEFWFLASHACT netlink command, which is marked as GENLUNSADMINPERM (meaning CAPNETADMIN inside a user namespace is enough to pass the privilege check), and takes a userspace-provided firmware name. (But I think to reach this case, you need to have CAPNETADMIN over a network namespace that a special kind of ethernet device is mapped into, so I think this is not a viable attack path in practice.)
Fix it by rejecting any firmware names containing ".." path components.
For what it's worth, I went looking and haven't found any USB device drivers that use the firmware loader dangerously.
Other sources
This CVE was automatically created from a reference found in an email or other text. If you are reading this, then this CVE entry is probably erroneous, since this text should be replaced by the official CVE description automatically.
— Launchpad
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 5.10.234-1Fixed in 6.1.129-1Fixed in 6.1.135-1Fixed in 6.12.22-1Fixed in 6.12.25-1 - Upgrade
Upgrade
debian/linux-6.1to a version that resolves this vulnerability.Fixed in 6.1.129-1~deb11u1
Event History
Frequently Asked Questions
What is the severity of CVE-2024-47742?
CVE-2024-47742 is classified as a high-severity vulnerability due to its potential exploitation that can lead to unauthorized access to files.
How do I fix CVE-2024-47742?
To fix CVE-2024-47742, it is recommended to update the Linux Kernel to the latest stable version that is not affected by this vulnerability.
What versions of the Linux Kernel are affected by CVE-2024-47742?
CVE-2024-47742 affects multiple versions of the Linux Kernel from 3.7 up to 6.11.2, and specific version ranges are detailed in the vulnerability's documentation.
Is CVE-2024-47742 a remote code execution vulnerability?
CVE-2024-47742 does not directly allow for remote code execution but could be exploited to bypass security measures leading to potential privilege escalation.
What are the potential impacts of exploiting CVE-2024-47742?
Exploiting CVE-2024-47742 could allow an attacker to access sensitive files and evade security mechanisms in the Linux operating system.