CVE-2026-18416
Received Received - Intake

Buffer Over-Read in Zephyr RTOS CoAP Link-Format Helper

Vulnerability report for CVE-2026-18416, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-09-28

Last updated on: 2026-09-28

Assigner: Zephyr Project

Description

The CoAP link-format helper match_path_uri() in subsys/net/lib/coap/coap_link_format.c compares a registered resource path against the URI carried in a Uri-Query href= option. That URI is not NUL terminated, but the inner character loop advanced its index k once per path character without ever testing it against the option length len. When a registered path segment is longer than the supplied URI and the URI is a prefix of it, the loop reads uri[len] and beyond, past the end of the option value. The path is reached from coap_well_known_core_get_len() and coap_well_known_core_get() via match_queries_resource(), i.e. by any unauthenticated GET /.well-known/core?href=/<prefix> request to a device that serves /.well-known/core (for the CoAP server subsystem, CONFIG_COAP_SERVER_WELL_KNOWN_CORE, default y) and has at least one resource that declares struct coap_core_metadata attributes. The over-read does not reach the receive buffer. The well-known-core builders parse the query into a stack-local struct coap_option, whose value is a fixed array (value[12], or CONFIG_COAP_EXTENDED_OPTIONS_LEN_VALUE bytes) that the option bytes are copied into, so uri points into that copy. Reading past len therefore reads the unused, uninitialized tail of the array and, when the option fills it, the bytes just past it in the same stack frame. (In the ZoAP library of v1.8.0 to v1.9.x the option value was instead a pointer into the received packet, and the over-read ran past the option inside the packet buffer.) The impact is bounded. The number of bytes read past the end is limited by the length of the resource path segment, and each additional byte is only read if it happens to equal the next path character, so in practice the over-read is one byte. It also cannot influence the response: returning a match requires the final compared index to be len - 1 or len, both in bounds, so out-of-bounds bytes only ever steer the loop to the next candidate resource. The consequence is undefined behaviour, not information disclosure and not a matching error. The fix adds a k >= len guard at the top of the inner loop, so every uri[k] dereference is within the option value while still allowing a trailing * wildcard to match a longer path.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-09-28
Last Modified
2026-09-28
Generated
2026-09-29
AI Q&A
2026-09-29
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 2 associated CPEs
Vendor Product Version / Range
zephyrproject zoap 1.8.0
zephyrproject zoap 1.9

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-125 The product reads data past the end, or before the beginning, of the intended buffer.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

This vulnerability involves an out-of-bounds read in the CoAP link-format helper function match_path_uri(). When a URI in a Uri-Query href= option is not NUL-terminated and is shorter than a registered resource path, the function reads past the end of the URI buffer. This occurs because the loop does not check if the index exceeds the URI length before accessing characters.

Detection Guidance

This vulnerability involves a buffer over-read in the CoAP link-format helper function match_path_uri(). Detection requires checking if your system uses the affected Zephyr RTOS CoAP subsystem with CONFIG_COAP_SERVER_WELL_KNOWN_CORE enabled. Inspect CoAP server configurations and logs for malformed or unusually long Uri-Query href= options in GET requests to /.well-known/core endpoints.

Impact Analysis

The impact is limited to undefined behavior due to reading uninitialized memory. It does not lead to information disclosure or matching errors. The over-read is typically just one byte and cannot influence responses. However, it may cause crashes or instability in affected systems.

Compliance Impact

This vulnerability does not directly affect compliance with GDPR, HIPAA, or similar standards as it does not lead to information disclosure, unauthorized access, or data breaches. The impact is limited to undefined behavior due to out-of-bounds memory read, which does not compromise data integrity or confidentiality.

Mitigation Strategies

Apply the official patch from Zephyr Project that adds a bounds check in match_path_uri(). Disable CONFIG_COAP_SERVER_WELL_KNOWN_CORE if not needed. Monitor network traffic for suspicious GET requests to /.well-known/core with long Uri-Query parameters.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-18416. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart