Skip to content

can: Local Denial of Service via SocketCAN Send

Moderate
ceolin published GHSA-c3w6-x7m3-3c58 May 30, 2026

Package

zephyr (zephyr)

Affected versions

<= 4.3

Patched versions

None

Description

The SocketCAN implementation uses NET_ASSERT to validate the length of a user-provided buffer that can contain a socketcan_frame object before dereferencing the object. In production build, assertions may be disabled, which can cause out-of-bound reads when processing an incomplete or truncated frame.

Details

  1. A userspace application issues a sendto syscall passing a pointer to a buffer and the length of the buffer

  2. The zcan_sendto_ctx function processes the received data and validates the length of the buffer using only an assert statement ( sockets_can.c:L259 ) before calling socketcan_to_can_frame.

  3. In socketcan_to_can_frame ( socketcan_utils.h:L40-L45 ), fields from the buffer are dereferenced without any additional validation.

Potential Impact

If the NET_ASSERT statement was compiled out in production build and an attacker can influence the length of data sent by the application, the attacker can cause out-of-bound memory read, poison internal memory structures or cause denial of service crashes. Because the accessed memory contents are sent via the network, this can further lead to exfiltrating sensitive data stored in the memory ( sockets_can.c:L263 ).

Recommended Fix

Add an explicit runtime check in zcan_sendto_ctx : if (len != sizeof(struct socketcan_frame)) return -EINVAL; . This should be a standard if check, not an assertion, to ensure safety in production builds.

Patches

main: #104654
v4.3: #104679
v4.2: #104678
v3.7: #104677

For more information

If you have any questions or comments about this advisory:

embargo: 2026-05-18

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Local
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
None
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:H

CVE ID

CVE-2026-5071

Weaknesses

Out-of-bounds Read

The product reads data past the end, or before the beginning, of the intended buffer. Learn more on MITRE.

Credits