Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-76788 Overview
CVE-2026-76788 is a stack-based buffer overflow [CWE-787] in the Zephyr Real-Time Operating System (RTOS) Open Supervised Device Protocol (OSDP) Control Panel reply parser. The flaw resides in cp_decode_response() within subsys/mgmt/osdp/src/osdp_cp.c. The parser decodes REPLY_KEYPPAD and REPLY_RAW reply types into stack-allocated struct osdp_event objects without bounding the payload length against OSDP_EVENT_MAX_DATALEN. An attacker on the RS-485 bus can inject an oversized reply frame, writing roughly 180 bytes of attacker-controlled data past the destination buffer.
Critical Impact
An adjacent-network attacker can overwrite saved registers and the return address of the OSDP receive thread, causing panel crashes or potential control-flow hijack.
Affected Products
- Zephyr RTOS OSDP subsystem (subsys/mgmt/osdp/src/osdp_cp.c)
- Builds with CONFIG_OSDP and CONFIG_OSDP_MODE_CP enabled
- Access control panel firmware integrating the Zephyr OSDP Control Panel role
Discovery Timeline
- 2026-10-19 - CVE-2026-76788 published to the National Vulnerability Database (NVD)
- 2026-10-20 - Last updated in NVD database
Technical Details for CVE-2026-76788
Vulnerability Analysis
The cp_decode_response() function parses replies received from a Peripheral Device (PD) over the OSDP RS-485 channel. For REPLY_KEYPPAD and REPLY_RAW reply types, the parser extracts a length byte from the attacker-controlled frame and validates only that the declared length matches the number of payload bytes present. The check (len - REPLY_KEYPPAD_DATA_LEN) != event.keypress.length is self-referential and imposes no upper bound on the length value.
The destination buffers event.keypress.data and event.cardread.data are fixed 64-byte arrays sized at OSDP_EVENT_MAX_DATALEN. The subsequent memcpy() writes the attacker-declared number of bytes into these stack-allocated destinations. The sibling REPLY_FMT handler in the same switch statement already enforced the missing OSDP_EVENT_MAX_DATALEN bound, indicating the omission was a copy-paste oversight.
Root Cause
The root cause is missing bounds validation on attacker-controlled length fields prior to memcpy(). No check ties the reply ID to the outstanding command, so an oversized REPLY_KEYPPAD or REPLY_RAW is accepted even as the answer to a routine CMD_POLL. With the default CONFIG_OSDP_UART_BUFFER_LENGTH of 256, approximately 180 bytes of attacker-chosen data can be written past the end of the stack event object. Zephyr does not enable stack canaries by default on Cortex-M or RISC-V, so saved registers and the return address are directly exposed.
Attack Vector
An attacker requires access to the OSDP RS-485 wiring, a compromised card reader, or a malicious Peripheral Device on the bus. The attacker crafts a frame carrying a valid Start of Message (SOM), a correct CRC-16, and a matching 2-bit sequence number. All three values are computable or observable by anyone with bus access. CONFIG_OSDP_SC_ENABLED only mitigates while a secure channel is active, and a single unauthenticated frame carrying a bad Message Authentication Code (MAC) triggers sc_deactivate(), after which plaintext replies are again accepted.
event.type = OSDP_EVENT_KEYPRESS;
event.keypress.reader_no = buf[pos++];
event.keypress.length = buf[pos++];
- if ((len - REPLY_KEYPPAD_DATA_LEN) != event.keypress.length) {
+ if ((len - REPLY_KEYPPAD_DATA_LEN) != event.keypress.length ||
+ (event.keypress.length > OSDP_EVENT_MAX_DATALEN)) {
break;
}
memcpy(event.keypress.data, buf + pos, event.keypress.length);
Source: GitHub Commit f10d55f — the patch adds the missing OSDP_EVENT_MAX_DATALEN bound to both the REPLY_KEYPPAD and REPLY_RAW handlers, capping each memcpy() at the size of its destination.
Detection Methods for CVE-2026-76788
Indicators of Compromise
- OSDP reply frames where the declared REPLY_KEYPPAD or REPLY_RAW payload length exceeds 64 bytes (OSDP_EVENT_MAX_DATALEN).
- Unexpected panel reboots, hard faults, or receive-thread crashes correlated with traffic from a specific Peripheral Device address.
- Repeated secure-channel deactivation events (sc_deactivate()) followed by plaintext replies from previously authenticated readers.
- REPLY_KEYPPAD or REPLY_RAW responses returned to a CMD_POLL where a keypress or raw card event was not expected.
Detection Strategies
- Deploy OSDP bus monitoring that logs reply type, declared length, and frame length for every frame on the RS-485 channel.
- Flag any reply where the length byte exceeds the destination buffer size defined by OSDP_EVENT_MAX_DATALEN.
- Alert on reply IDs that do not correspond to the outstanding Control Panel command on the same sequence number.
- Correlate panel firmware crash telemetry with upstream OSDP bus packet captures to identify malformed frames.
Monitoring Recommendations
- Instrument access control panels to export serial-console crash logs and faulting program counter values to a centralized logging platform.
- Monitor for sustained MAC validation failures from a single reader address, which indicate secure-channel downgrade attempts.
- Track physical access to RS-485 wiring closets and cable runs with tamper-evident enclosures and intrusion sensors.
How to Mitigate CVE-2026-76788
Immediate Actions Required
- Apply commit f10d55f47c6970e95d3a7c6ba08e6adec3c79acd to the Zephyr subsys/mgmt/osdp/src/osdp_cp.c source tree and rebuild affected firmware images.
- Inventory all deployed access control panels using Zephyr OSDP in Control Panel mode and prioritize patching of internet-exposed or physically accessible installations.
- Audit RS-485 cable runs and wiring closets for unauthorized taps or added devices between panels and readers.
Patch Information
The upstream fix is published in GitHub Commit f10d55f and tracked in GitHub Security Advisory GHSA-fgg7-h8p9-9q3w. The patch adds the event.keypress.length > OSDP_EVENT_MAX_DATALEN and corresponding REPLY_RAW length checks to the switch handlers, capping each memcpy() destination.
Workarounds
- Enable CONFIG_OSDP_SC_ENABLED and provision unique Secure Channel Base Keys (SCBK) per reader to raise the bar for frame injection.
- Enable stack canaries (CONFIG_STACK_CANARIES) in Zephyr builds to detect return-address corruption at function exit.
- Restrict physical access to the OSDP RS-485 bus through locked enclosures and tamper detection on reader housings.
- Deploy only trusted, firmware-verified Peripheral Devices on production access control buses.
# Rebuild Zephyr OSDP Control Panel firmware with the patched source and hardening
cd zephyrproject/zephyr
git cherry-pick f10d55f47c6970e95d3a7c6ba08e6adec3c79acd
west build -b <board> samples/subsys/mgmt/osdp/control_panel \
-- -DCONFIG_OSDP=y \
-DCONFIG_OSDP_MODE_CP=y \
-DCONFIG_OSDP_SC_ENABLED=y \
-DCONFIG_STACK_CANARIES=y
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

