libcsp Buffer Overflow Vulnerability in csp_eth_init Function

Vulnerability

A heap-based buffer overflow vulnerability has been identified in libcsp version 2.0 within the csp_eth_init() function. The issue arises from improper handling of the ifname parameter, where strcpy is used to copy the interface name into a structure member without validating the input length. This oversight allows for writing beyond the bounds of the buffer, leading to a heap overflow.

Impact

Exploitation of this vulnerability causes a heap-based buffer overflow, which can potentially be exploited to execute arbitrary code or cause a denial-of-service condition.

Reproduction

The vulnerability can be reproduced by calling the csp_eth_init() function with an interface name that exceeds CSP_IFLIST_NAME_MAX bytes. The function will then use strcpy to copy the name into a buffer, leading to a heap-buffer-overflow error, as reported by AddressSanitizer.

Remediation

Users can update to the latest version of libcsp, where this vulnerability has been addressed by replacing the unsafe strcpy call with strncpy, limiting the copy to ensure memory safety.

Added: Aug 11, 2025, 7:38 PM
Updated: Aug 11, 2025, 8:17 PM

Vulnerability Rating

Custom Algorithm
spread
0.8
impact
7.5
exploitability
8.4
remediation
7.7
relevance
0.4
threat
4.8
urgency
2.9
incentive
5.8

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.