CVE-2026-11809
Beschrijving NL
De UpdateHub OTA-client in subsys/mgmt/updatehub/updatehub.c bevat een out-of-bounds / uninitialized-memory gelezen in z_impl_updatehub_probe(). De probe-reactie van de UpdateHub-server wordt gekopieerd naar een heap-buffer (metadata) die correct NUL-geëindigd is, maar een tweede buffer (metadata_copy) wordt toegewezen met k_malloc (unzeroed) en gevuld met memcpy(metadata_copy, metadata, strlen(metadata)), waardoor de eindigende nul wegvalt. Alles na de gekopieerde inhoud blijft ongeïnitialiseerd heap. Wanneer de eerste json_obj_parse() over de array descriptor faalt, valt de code terug naar json_obj_parse(metadata_copy, strlen(metadata_copy), ...). De strlen() oproep scant voorbij de gekopieerde bytes door niet-geïnitialiseerde heap en, als er geen nul byte wordt gevonden voor het einde van de toewijzing, leest voorbij de buffer; de resulterende te lange lengte wordt dan geparseerd als JSON. De probe-payload wordt volledig beheerd door de (kwaadaardige, gecompromitteerde of — zonder de optionele CONFIG_UPDATEHUB_DTLS — on-path) UpdateHub-server, die een grote payload kan maken die niet de eerste parse heeft om dit pad te besturen. Het gevolg is een uitlezing van niet-geïnitialiseerde heap, met in het ergste geval een uitlezing buiten de grenzen voorbij de metadata_COPY-toewijzing die de update-thread/het apparaat kan beschadigen en laten crashen, waardoor een door het netwerk te activeren denial of service ontstaat. De overgelezen gegevens worden alleen intern verbruikt om de update te evalueren en worden niet teruggestuurd naar de aanvaller, dus er wordt geen directe informatie bekendgemaakt en er wordt niet buiten de grenzen geschreven. De fix zeroes metadata_copy met memset vóór de kopie, garandeert NUL-beëindiging en begrenzing strlen() binnen de toewijzing.
Origineel (Engels) tonen
The UpdateHub OTA client in subsys/mgmt/updatehub/updatehub.c contains an out-of-bounds / uninitialized-memory read in z_impl_updatehub_probe(). The probe response from the UpdateHub server is copied into a heap buffer (metadata) that is correctly NUL-terminated, but a second buffer (metadata_copy) is allocated with k_malloc (unzeroed) and filled with memcpy(metadata_copy, metadata, strlen(metadata)), which omits the terminating NUL. Everything after the copied content remains uninitialized heap.
When the first json_obj_parse() over the array descriptor fails, the code falls back to json_obj_parse(metadata_copy, strlen(metadata_copy), ...). The strlen() call scans past the copied bytes through uninitialized heap and, if no zero byte is found before the end of the allocation, reads beyond the buffer; the resulting over-long length is then parsed as JSON. The probe payload is fully controlled by the (malicious, compromised, or — without the optional CONFIG_UPDATEHUB_DTLS — on-path) UpdateHub server, which can craft a large payload that fails the first parse to drive this path.
The consequence is a read of uninitialized heap, with a worst case of an out-of-bounds read past the metadata_copy allocation that can fault and crash the update thread/device, producing a network-triggerable denial of service. The over-read data is consumed only internally to evaluate the update and is not returned to the attacker, so there is no direct information disclosure and no out-of-bounds write.
The fix zeroes metadata_copy with memset before the copy, guaranteeing NUL termination and bounding strlen() within the allocation.