Skip to content

net: ip/tcp: Null pointer dereference can be triggered by a race condition

Moderate
ceolin published GHSA-4vqm-pw24-g9jp Apr 5, 2026

Package

zephyr (zephyr)

Affected versions

<= 4.3

Patched versions

None

Description

The tcp_recv() function in subsys/net/ip/tcp.c contains a null pointer dereference vulnerability that can be triggered by a race condition:

Details

  1. The protocol stack releases a TCP connection via tcp_conn_release(), which sets conn->context->tcp = NULL at line 881, and later removes the connection while holding tcp_lock (lines 911–913).
  2. Meanwhile, packets that have just been received for that same connection may still be processed by tcp_recv(). The function first attempts to obtain an existing connection by calling tcp_conn_search() (line 2308), which is also protected by tcp_lock. If the removal in step 1 happens first, tcp_conn_search() returns NULL. If the packet is a SYN, the operation at line 2316 can then result in a null pointer, because user_data points to conn->context (as set in zsock_listen_ctx()). This null pointer is subsequently dereferenced by tcp_backlog_is_full() without a prior check.

Patches

main: #102110

For more information

If you have any questions or comments about this advisory:

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
Network
Attack complexity
High
Privileges required
Low
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
Low
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:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:H

CVE ID

CVE-2026-5590

Weaknesses

NULL Pointer Dereference

The product dereferences a pointer that it expects to be valid but is NULL. Learn more on MITRE.