{"id":"CVE-2026-10639","summary":"Use-after-free reading `net_pkt_iface()` of a sent ICMPv4 echo-reply packet in `icmpv4_handle_echo_request()`","details":"In Zephyr's native IPv4 stack, icmpv4_handle_echo_request() in subsys/net/ip/icmpv4.c builds an echo-reply packet (reply), hands it to net_try_send_data(), and then, on success, calls net_stats_update_icmp_sent(net_pkt_iface(reply)). net_try_send_data() transfers ownership of reply to the TX path (net_if_try_queue_tx -\u003e net_if_tx -\u003e L2/driver send, or the asynchronous net_if_tx_thread), which can unref it to refcount 0 and return the struct net_pkt to its slab (net_pkt_unref -\u003e k_mem_slab_free) before the stats line runs. net_core.c documents this exact contract ('the pkt might contain garbage already ... do not use pkt after that call').\n\nThe post-send net_pkt_iface(reply) therefore reads reply-\u003eiface out of a freed (and possibly already reallocated) net_pkt, a use-after-free read; with CONFIG_NET_STATISTICS_PER_INTERFACE the stats macro additionally increments a counter through that value, i.e. a dereference/write through a stale or recycled-slot pointer.\n\nThe path is reached unauthenticated by any remote host that pings the device (net_icmpv4_input -\u003e net_icmp_call_ipv4_handlers -\u003e icmpv4_handle_echo_request) and is gated on CONFIG_NET_STATISTICS_ICMP. Impact is a probabilistic read of recycled packet memory plus a possible wild-pointer write under a timing race, leading most likely to corrupted interface statistics or a remotely triggerable crash (DoS).\n\nThe defect was introduced in 2019 (v1.14) and is present through v4.4.0. The companion change in net_icmpv4_send_error() is not a use-after-free because it reads net_pkt_iface(orig), the caller-owned received packet, which stays alive across the send. The fix caches the interface pointer from the live received packet before sending and uses it for the post-send stats updates.","aliases":["GHSA-qhrf-w466-qmpw"],"modified":"2026-11-05T08:04:00.483775164Z","published":"2026-06-16T13:22:23.165Z","database_specific":{"cwe_ids":["CWE-416"],"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/10xxx/CVE-2026-10639.json","cna_assigner":"zephyr"},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/10xxx/CVE-2026-10639.json"},{"type":"ADVISORY","url":"https://github.com/zephyrproject-rtos/zephyr/security/advisories/GHSA-qhrf-w466-qmpw"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-10639"},{"type":"FIX","url":"https://github.com/zephyrproject-rtos/zephyr/commit/86e21665d4641f304dc3895bfb03b8f89db83291"},{"type":"PACKAGE","url":"https://github.com/zephyrproject-rtos/zephyr"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/zephyrproject-rtos/zephyr","events":[{"introduced":"413b789deb391d3a37d06b463288a5fe765ee57e"},{"fixed":"75f67d766726351b30199f9a2bf55803d717a3be"},{"introduced":"684c9e8f32e4373a21098559f748f06915f950c9"},{"fixed":"1f6485eca25431b5ff27ce9a754218c9e559bbbb"},{"fixed":"86e21665d4641f304dc3895bfb03b8f89db83291"}],"database_specific":{"extracted_events":[{"strategy":"StandardRange","range":[{"introduced":"4.2.0"},{"fixed":"4.3.1"}],"source":"AFFECTED_FIELD"},{"source":"AFFECTED_FIELD","strategy":"StandardRange","range":[{"introduced":"4.4.0"},{"fixed":"4.4.1"}]},{"range":[{"fixed":"86e21665d4641f304dc3895bfb03b8f89db83291"}],"source":"REFERENCES_COMMIT"}]}}],"versions":["v4.3.1-rc1","v4.4.1-rc1","v4.4.0","v4.3.0","v4.3.0-rc3","v4.3.0-rc2","v4.3.0-rc1","v4.2.0"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-10639.json","vanir_signatures":[{"signature_type":"Line","signature_version":"v1","source":"https://github.com/zephyrproject-rtos/zephyr/commit/86e21665d4641f304dc3895bfb03b8f89db83291","target":{"file":"subsys/net/ip/icmpv4.c"},"deprecated":false,"digest":{"line_hashes":["306846724511269379609734030342351488904","137711737536272103039696069473052075618","183555859103953823746807657251045556579","155694175302151334220765031997363644022","199967274758736406669695016130845401051","230797643044123360083418393555068145947","96019076228555204662507568393396415389","327910216056322119489492042211567148647","301464493459553015497041215892884663259","151417990608217330371424994026689911163","268521006821721146847839765456959533790","130206420548358672152829117368376506346","315202341520359848369566445961863123462","185019892641018123890114228167287904292","252814421188225463336772542155621098446","159597802615440062551725398128173600539","12612501820930177495041020191429664604","173931695126583965103479410179715575984","123054348838969073355102515608930357089","252951710089213278733372635567902443613","274854579454242222546262015161229160473","165999804712964622555303070590481615109","189781853771881473307329432680961919012","309866442935752533617771611809597227437","304274078603695096963740722423523286643","112521742455009381749792828343380705131","40132503968344401046831638467970097910","200202412125187913009861109777075674270","218920365078525249586487608618895341659","250725385327808765620042333611695533638","183085866120763350337551047652679072567","49717001134280722770868968227383624283","250713938891462787754450759585243326079","332086446071051128946186750268324704596","13960126175612767308155380270315981767","329413060768491893869796260821877557504","92061632719290198494428592588154634787","290287344744384716058706730696212944905","18532530323472005983849134710332545831","179123817653695252066539865718039446145","61012533772160110461652987303269472997"],"threshold":0.9},"id":"CVE-2026-10639-48ee2c83"},{"id":"CVE-2026-10639-aee6c8aa","signature_type":"Function","signature_version":"v1","source":"https://github.com/zephyrproject-rtos/zephyr/commit/86e21665d4641f304dc3895bfb03b8f89db83291","target":{"file":"subsys/net/ip/icmpv4.c","function":"net_icmpv4_send_error"},"deprecated":false,"digest":{"function_hash":"5807021600316646741490891970067331340","length":1858}},{"signature_type":"Function","signature_version":"v1","source":"https://github.com/zephyrproject-rtos/zephyr/commit/86e21665d4641f304dc3895bfb03b8f89db83291","target":{"file":"subsys/net/ip/icmpv4.c","function":"icmpv4_handle_echo_request"},"deprecated":false,"digest":{"function_hash":"176042661748160622093094981955898226289","length":1802},"id":"CVE-2026-10639-fd821aa3"}],"vanir_signatures_modified":"2026-11-05T08:04:00Z"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:L"}]}