CVE-2024-39480 kdb: Fix buffer overflow during tab-complete
A buffer overflow in the Linux kernel kdb debugger allows attackers to execute arbitrary code or escalate privileges via tab completion.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2024-39480?
CVE-2024-39480 is a high-severity memory corruption vulnerability in Linux kernel, published on 5 Jul 2024. It can only be exploited from the same machine or local network, with no action from the victim.
Official description
In the Linux kernel, the following vulnerability has been resolved:
kdb: Fix buffer overflow during tab-complete
Currently, when the user attempts symbol completion with the Tab key, kdb will use strncpy() to insert the completed symbol into the command buffer. Unfortunately it passes the size of the source buffer rather than the destination to strncpy() with predictably horrible results. Most obviously if the command buffer is already full but cp, the cursor position, is in the middle of the buffer, then we will write past the end of the supplied buffer.
Fix this by replacing the dubious strncpy() calls with memmove()/memcpy() calls plus explicit boundary checks to make sure we have enough space before we start moving characters around.
Which versions are affected by CVE-2024-39480?
It affects 1 product.
Products include Linux kernel.
How do I fix CVE-2024-39480?
Apply the vendor's patch.
Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.
Is CVE-2024-39480 being exploited?
There is no known exploitation of CVE-2024-39480 in the wild and no public exploit code.
Other vulnerabilities in Linux kernel
Sources
Also known as AZL-43294, BELL-CVE-2024-39480, DEBIAN-CVE-2024-39480, GHSA-32jg-6c46-hc8j, UBUNTU-CVE-2024-39480.