CVE-2026-11812
JSON

2.5low

UpdateHub: race condition on shared context causes out-of-bounds write and DoS

Severity
2.5low CVSS:3.1 by zephyr
Exploit likelihood
0.08% (higher than 0% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
zephyr

Description

The UpdateHub management subsystem (subsys/mgmt/updatehub/updatehub.c) drives every update operation through a single file-scope ctx structure that holds the CoAP block context, payload buffer, status code, socket, and a one-element poll-fd array fds[1]. Access to ctx was not serialized, and prepare_fds() wrote ctx.fds[ctx.nfds] and incremented ctx.nfds with no bounds check. Two independent paths mutate ctx concurrently: the background autohandler running on the system workqueue, and user-triggered operations reached through the updatehub run shell command, direct API calls, or — since the operations are exposed as syscalls — userspace threads. When a second flow enters prepare_fds() while ctx.nfds is already 1, the write lands one element past the array; by struct layout it overlaps the adjacent ctx.sock/ctx.nfds members. More broadly, the unsynchronized sharing lets two flows interleave connection setup and teardown, double-closing a socket descriptor or scribbling the shared buffers. The result is corruption of the update subsystem's internal state and denial of service of the firmware-update path; the out-of-bounds write is contained within the ctx structure and there is no demonstrated path to memory outside it or to code execution. Triggering requires a local actor able to invoke update operations (or, with CONFIG_USERSPACE, an unprivileged userspace thread) and to win a timing race against the background handler; remote peers cannot control the race timing. The fix serializes the entry points with a mutex and adds a bounds check to prepare_fds().

Affected

Product or packageVersionsReported by
zephyrfrom 2.0.0 before 4.3.2, from 4.4.0 before 4.4.2CVE List

Classification

CWE-362

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

The UpdateHub management subsystem (subsys/mgmt/updatehub/updatehub.c) drives every update operation through a single file-scope ctx structure that holds the CoAP block context, payload buffer, status code, socket, and a one-element poll-fd array fds[1]. Access to ctx was not serialized, and prepare_fds() wrote ctx.fds[ctx.nfds] and incremented ctx.nfds with no bounds check. Two independent paths mutate ctx concurrently: the background autohandler running on the system workqueue, and user-triggered operations reached through the updatehub run shell command, direct API calls, or — since the operations are exposed as syscalls — userspace threads. When a second flow enters prepare_fds() while ctx.nfds is already 1, the write lands one element past the array; by struct layout it overlaps the adjacent ctx.sock/ctx.nfds members. More broadly, the unsynchronized sharing lets two flows interleave connection setup and teardown, double-closing a socket descriptor or scribbling the shared buffers. The result is corruption of the update subsystem's internal state and denial of service of the firmware-update path; the out-of-bounds write is contained within the ctx structure and there is no demonstrated path to memory outside it or to code execution. Triggering requires a local actor able to invoke update operations (or, with CONFIG_USERSPACE, an unprivileged userspace thread) and to win a timing race against the background handler; remote peers cannot control the race timing. The fix serializes the entry points with a mutex and adds a bounds check to prepare_fds().

NVD (es)

El subsistema de gestión de UpdateHub (subsys/mgmt/updatehub/updatehub.c) impulsa cada operación de actualización a través de una única estructura ctx de ámbito de archivo que contiene el contexto del bloque CoAP, el búfer de carga útil, el código de estado, el socket y un array poll-fd de un elemento fds[1]. El acceso a ctx no estaba serializado, y prepare_fds() escribió ctx.fds[ctx.nfds] e incrementó ctx.nfds sin una comprobación de límites. Dos rutas independientes mutan ctx concurrentemente: el autogestor en segundo plano ejecutándose en la cola de trabajo del sistema, y operaciones activadas por el usuario a las que se accede a través del comando de shell updatehub run, llamadas directas a la API, o - dado que las operaciones se exponen como llamadas al sistema (syscalls) - hilos de espacio de usuario. Cuando un segundo flujo entra en prepare_fds() mientras ctx.nfds ya es 1, la escritura se produce un elemento más allá del array; por la disposición de la estructura, se superpone a los miembros adyacentes ctx.sock/ctx.nfds. En términos más generales, el intercambio no sincronizado permite que dos flujos intercalen el establecimiento y la desconexión de la conexión, cerrando dos veces un descriptor de socket o sobrescribiendo los búferes compartidos. El resultado es la corrupción del estado interno del subsistema de actualización y la denegación de servicio de la ruta de actualización del firmware; la escritura fuera de límites está contenida dentro de la estructura ctx y no hay una ruta demostrada a la memoria fuera de ella o a la ejecución de código. El desencadenamiento requiere un actor local capaz de invocar operaciones de actualización (o, con CONFIG_USERSPACE, un hilo de espacio de usuario sin privilegios) y de ganar una carrera de tiempo contra el gestor en segundo plano; los pares remotos no pueden controlar el tiempo de la carrera. La solución serializa los puntos de entrada con un mutex y añade una comprobación de límites a prepare_fds().

References

Sources

SourceRecordLicence
CVE ListCVE-2026-11812 changed 2026-11-04CVE Terms of Use
NVDCVE-2026-11812 changed 2026-11-04Public domain