CVE-2026-87043

sys_rand_get() silently returns an unwritten buffer when the entropy device is not ready

Published Nov 4, 2026 CVSS 3.1 · 4.8 Medium EPSS < 1% KEV · Not listed
Description
The entropy-device random number generator in subsys/random/random_entropy_device.c returned early with -ENODEV from rand_get() as soon as device_is_ready() failed, before reaching the non-cryptographic system-timer fallback further down the same function. Because z_impl_sys_rand_get() returns void and discards that error — and the public sys_rand_get() syscall is itself declared void, so it cannot report failure — the caller's output buffer was left untouched and its previous contents were handed back as random data. The thin wrappers make this a plain uninitialized read: sys_rand32_get() declares uint32_t ret;, calls sys_rand_get(&ret, sizeof(ret)) and returns ret.

The "not ready" state is a normal runtime condition rather than a fault. Entropy drivers initialise at PRE_KERNEL_1 with CONFIG_ENTROPY_INIT_PRIORITY (default 50), so any earlier initialiser — kernel objects run at priority 30 — observes an unready device; the sibling generator subsys/random/random_xoshiro128.c and z_early_rand_get() in kernel/init.c both already carried an explicit timer fallback for exactly this case. The state is also permanent for the boot when an entropy driver's init hook fails, which several in-tree drivers can do on real hardware (entropy_stm32 on an RNG clock configuration error, entropy_psa_crypto when psa_crypto_init() fails, entropy_nrf_cracen, entropy_esp32, entropy_virtio).

When this occurs, every non-cryptographic random value in the system is either a constant or stale memory. coap_next_token() in subsys/net/lib/coap/coap.c fills a static buffer, so every CoAP token becomes the same .bss constant; tcp_init_isn() in subsys/net/ip/tcp.c returns an uninitialized stack word as the TCP initial sequence number; DHCPv4/DHCPv6 transaction IDs, WebSocket masking keys and RTP SSRCs are similarly degraded, and arch/arm64/core/pac.c derives per-thread Pointer Authentication keys from the same source. Where the bytes are transmitted directly — SSH packet padding, the netmidi2 session nonce, a DTLS connection ID on builds without CONFIG_CSPRNG_ENABLED — stale caller stack or heap contents are disclosed on the wire.

The fix initialises ret to -ENODEV and only calls entropy_get_entropy() when the device is ready, so the not-ready case now falls through to the timer fallback and the buffer is always written. The cryptographically secure path is unchanged: sys_csrand_get() still propagates the error to the caller and never silently degrades. An attacker cannot induce the unready state, but can observe and exploit the resulting non-random values remotely on an affected device.

Analysis

AI-generated

Technical impact

The Zephyr RTOS random‑number subsystem was found to return a silence error from its entropy device without writing to the caller’s buffer. Because the public syscall is declared void the error is discarded, leaving the buffer untouched. This results in callers receiving stale or constant values that are then used as non‑cryptographic random data throughout the system. The flaw exposes previously allocated memory on the wire through tokens, sequence numbers, and other random values, which can aid an attacker in observing predictable values and potentially compromising protocols that rely on randomness for security.

Affected Systems

Zephyr Project Zephyr RTOS. The vulnerability affects all builds where the entropy device is not yet initialized prior to a call to sys_rand_get(). The specific affected versions are not listed in the advisory, so any Zephyr release that contains the unmodified random‑entropy path may be impacted.

Risk and Exploitability

The CVSS score of 4.8 indicates a medium impact, and the EPSS score is not available. The flaw is not listed in the CISA KEV catalog, implying no confirmed exploitation yet. Attacks cannot induce the unready state, but an adversary can observe the predictable data leaked by protocols such as CoAP, TCP, DHCP, and WebSocket. The risk lies mainly in information disclosure and potential protocol manipulation due to weak sequence numbers or tokens, rather than direct code execution. The vector is inferred to be remote traffic that carries these values, and the impact is limited to the affected RF components that rely on non‑cryptographic random values.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply the vendor patch that initializes the return buffer or uses a timer fallback when the entropy device is not ready.
  • Verify that all entropy drivers initialize successfully and that their init priority is higher than kernel objects, ensuring device readiness before calls to sys_rand_get()
  • Perform sanity checks or tests of random outputs (e.g., ensure CoAP tokens are not constant) to confirm the patch's effectiveness
  • If a patch cannot be applied immediately, consider disabling reconfiguring features that use non‑cryptographic random values exposed by the subsystem.

Generated by OpenCVE AI on November 4, 2026 at 10:11 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Zephyrproject
Zephyrproject zephyr
Vendors & Products Zephyrproject
Zephyrproject zephyr
Type Values Removed Values Added
Description The entropy-device random number generator in subsys/random/random_entropy_device.c returned early with -ENODEV from rand_get() as soon as device_is_ready() failed, before reaching the non-cryptographic system-timer fallback further down the same function. Because z_impl_sys_rand_get() returns void and discards that error — and the public sys_rand_get() syscall is itself declared void, so it cannot report failure — the caller's output buffer was left untouched and its previous contents were handed back as random data. The thin wrappers make this a plain uninitialized read: sys_rand32_get() declares uint32_t ret;, calls sys_rand_get(&ret, sizeof(ret)) and returns ret. The "not ready" state is a normal runtime condition rather than a fault. Entropy drivers initialise at PRE_KERNEL_1 with CONFIG_ENTROPY_INIT_PRIORITY (default 50), so any earlier initialiser — kernel objects run at priority 30 — observes an unready device; the sibling generator subsys/random/random_xoshiro128.c and z_early_rand_get() in kernel/init.c both already carried an explicit timer fallback for exactly this case. The state is also permanent for the boot when an entropy driver's init hook fails, which several in-tree drivers can do on real hardware (entropy_stm32 on an RNG clock configuration error, entropy_psa_crypto when psa_crypto_init() fails, entropy_nrf_cracen, entropy_esp32, entropy_virtio). When this occurs, every non-cryptographic random value in the system is either a constant or stale memory. coap_next_token() in subsys/net/lib/coap/coap.c fills a static buffer, so every CoAP token becomes the same .bss constant; tcp_init_isn() in subsys/net/ip/tcp.c returns an uninitialized stack word as the TCP initial sequence number; DHCPv4/DHCPv6 transaction IDs, WebSocket masking keys and RTP SSRCs are similarly degraded, and arch/arm64/core/pac.c derives per-thread Pointer Authentication keys from the same source. Where the bytes are transmitted directly — SSH packet padding, the netmidi2 session nonce, a DTLS connection ID on builds without CONFIG_CSPRNG_ENABLED — stale caller stack or heap contents are disclosed on the wire. The fix initialises ret to -ENODEV and only calls entropy_get_entropy() when the device is ready, so the not-ready case now falls through to the timer fallback and the buffer is always written. The cryptographically secure path is unchanged: sys_csrand_get() still propagates the error to the caller and never silently degrades. An attacker cannot induce the unready state, but can observe and exploit the resulting non-random values remotely on an affected device.
Title sys_rand_get() silently returns an unwritten buffer when the entropy device is not ready
Weaknesses CWE-330
References
Metrics cvssV3_1

{'score': 4.8, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N'}

Weaknesses
  • CWE-330

    Use of Insufficiently Random Values

Sources

Status
PUBLISHED
Assigner
zephyr
Published
Updated
Nov 9, 2026, 9:23 PM
Reserved
Sep 8, 2026, 6:40 PM
Status
Awaiting Analysis
Published
Nov 4, 2026, 6:17 AM
Modified
Nov 9, 2026, 10:18 PM