Stack-based Buffer Overflow Affecting kernel-tools-devel package, versions <0:4.14.349-266.564.amzn2


Severity

Recommended
high

Based on Amazon Linux security rating.

Threat Intelligence

EPSS
0.04% (6th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-AMZN2-KERNELTOOLSDEVEL-7681807
  • published14 Aug 2024
  • disclosed5 Jul 2024

Introduced: 5 Jul 2024

CVE-2024-39480  (opens in a new tab)
CWE-121  (opens in a new tab)
First added by Snyk

How to fix?

Upgrade Amazon-Linux:2 kernel-tools-devel to version 0:4.14.349-266.564.amzn2 or higher.
This issue was patched in ALAS2-2024-2613.

NVD Description

Note: Versions mentioned in the description apply only to the upstream kernel-tools-devel package and not the kernel-tools-devel package as distributed by Amazon-Linux. See How to fix? for Amazon-Linux:2 relevant fixed versions and status.

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.

CVSS Scores

version 3.1