CVE-2026-10646: use-after-free in zephyrproject zephyr
Zephyr's BSD-sockets getaddrinfo() implementation (subsys/net/lib/sockets/getaddrinfo.c) passes a pointer to a stack-allocated state object (struct getaddrinfo_state ai_state) as the user_data of an asynchronous DNS resolver query. The socket layer waits on a semaphore with a timeout deliberately set slightly longer than the resolver's own per-query timeout. When that semaphore wait nonetheless times out (-EAGAIN) - which can occur when the resolver's timeout work is delayed by workqueue contention, or in the documented multi-retry configuration where CONFIG_NET_SOCKETS_DNS_TIMEOUT exceeds CONFIG_NET_SOCKETS_DNS_BACKOFF_INTERVAL - the pre-fix code retries the query (goto again) without cancelling the previous one and without resetting the semaphore. The previous query slot remains active in the resolver with its callback and the stack pointer as user_data, and ai_state->dns_id is overwritten so the stale query can no longer be cancelled. A subsequent DNS response delivered over UDP and matched by its 16-bit transaction id (in dispatcher_cb()/dns_read()), or the resolver's own delayed query-timeout work, then invokes dns_resolve_cb() against the now out-of-scope stack frame, writing through the stale pointer (state->status, state->idx, state->ai_arr[], and k_sem_give()). Because the triggering response is network-delivered and its 16-bit id is spoofable/replayable by an on- or off-path attacker, this is a network-influenceable use-after-return that can corrupt reused stack memory, leading to crashes/denial of service or memory corruption. The fix cancels the timed-out query by name and type before retrying and resets the local semaphore, eliminating the stale callback path. Affected: Zephyr v4.0.0 through v4.4.0.
AI Analysis
Technical Summary
The vulnerability exists in Zephyr's getaddrinfo() implementation where an asynchronous DNS resolver query uses a pointer to a stack-allocated state object as user_data. If the semaphore wait times out, the code retries the query without canceling the previous one or resetting the semaphore, leaving a stale query active with a callback referencing the now out-of-scope stack frame. Subsequent DNS responses or timeout work can invoke this stale callback, causing use-after-return memory corruption. The flaw is network-influenceable via spoofed or replayed DNS responses. The fix involves canceling the timed-out query before retrying and resetting the semaphore to prevent stale callbacks. Affected versions are Zephyr v4.0.0 through v4.4.0.
Potential Impact
An attacker capable of sending spoofed or replayed DNS responses can trigger use-after-free conditions leading to memory corruption or denial of service (crashes) in affected Zephyr devices. The vulnerability does not impact confidentiality but can affect integrity and availability.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. The described fix cancels timed-out queries before retrying and resets the semaphore to eliminate stale callbacks. Until an official fix is available, users should monitor vendor advisories for patches addressing this issue.
CVE-2026-10646: use-after-free in zephyrproject zephyr
Description
Zephyr's BSD-sockets getaddrinfo() implementation (subsys/net/lib/sockets/getaddrinfo.c) passes a pointer to a stack-allocated state object (struct getaddrinfo_state ai_state) as the user_data of an asynchronous DNS resolver query. The socket layer waits on a semaphore with a timeout deliberately set slightly longer than the resolver's own per-query timeout. When that semaphore wait nonetheless times out (-EAGAIN) - which can occur when the resolver's timeout work is delayed by workqueue contention, or in the documented multi-retry configuration where CONFIG_NET_SOCKETS_DNS_TIMEOUT exceeds CONFIG_NET_SOCKETS_DNS_BACKOFF_INTERVAL - the pre-fix code retries the query (goto again) without cancelling the previous one and without resetting the semaphore. The previous query slot remains active in the resolver with its callback and the stack pointer as user_data, and ai_state->dns_id is overwritten so the stale query can no longer be cancelled. A subsequent DNS response delivered over UDP and matched by its 16-bit transaction id (in dispatcher_cb()/dns_read()), or the resolver's own delayed query-timeout work, then invokes dns_resolve_cb() against the now out-of-scope stack frame, writing through the stale pointer (state->status, state->idx, state->ai_arr[], and k_sem_give()). Because the triggering response is network-delivered and its 16-bit id is spoofable/replayable by an on- or off-path attacker, this is a network-influenceable use-after-return that can corrupt reused stack memory, leading to crashes/denial of service or memory corruption. The fix cancels the timed-out query by name and type before retrying and resets the local semaphore, eliminating the stale callback path. Affected: Zephyr v4.0.0 through v4.4.0.
CVSS v3.1
Score 7.4high
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability exists in Zephyr's getaddrinfo() implementation where an asynchronous DNS resolver query uses a pointer to a stack-allocated state object as user_data. If the semaphore wait times out, the code retries the query without canceling the previous one or resetting the semaphore, leaving a stale query active with a callback referencing the now out-of-scope stack frame. Subsequent DNS responses or timeout work can invoke this stale callback, causing use-after-return memory corruption. The flaw is network-influenceable via spoofed or replayed DNS responses. The fix involves canceling the timed-out query before retrying and resetting the semaphore to prevent stale callbacks. Affected versions are Zephyr v4.0.0 through v4.4.0.
Potential Impact
An attacker capable of sending spoofed or replayed DNS responses can trigger use-after-free conditions leading to memory corruption or denial of service (crashes) in affected Zephyr devices. The vulnerability does not impact confidentiality but can affect integrity and availability.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. The described fix cancels timed-out queries before retrying and resets the semaphore to eliminate stale callbacks. Until an official fix is available, users should monitor vendor advisories for patches addressing this issue.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- zephyr
- Date Reserved
- 2026-06-02T15:11:49.060Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a40ac0127e9c79719547629
Added to database: 06/28/2026, 05:07:13 UTC
Last enriched: 08/07/2026, 13:09:59 UTC
Last updated: 08/11/2026, 00:41:09 UTC
Views: 187
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.