Skip to main content
Vulnerability Database/CVE-2026-78119

CVE-2026-78119: Nuvoton NPCX eSPI Driver Buffer Overflow

CVE-2026-78119 is a buffer overflow flaw in Nuvoton NPCX eSPI driver that allows malicious eSPI hosts to corrupt controller memory. This post explains its technical details, affected configurations, and mitigation.

Published:

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-78119 Overview

CVE-2026-78119 is an out-of-bounds write [CWE-787] in the Zephyr RTOS Nuvoton NPCX enhanced Serial Peripheral Interface (eSPI) driver. The flaw lives in espi_taf_parse() within drivers/espi/espi_npcx.c, where the Target-Attached-Flash (TAF) handler trusts a 12-bit length field from the request header without comparing it against the destination buffer or the negotiated eSPI receive payload size. A malicious or malformed eSPI flash request can drive up to 239 unchecked 32-bit stores past the end of a static structure, corrupt .bss, and leak adjacent controller SRAM back to the host through SPI flash.

Critical Impact

An eSPI host that violates the negotiated payload size can trigger roughly 956 bytes of out-of-bounds write into controller memory and read up to 4 KB of adjacent SRAM into attacker-controlled flash locations, crossing the trust boundary TAF is intended to enforce.

Affected Products

  • Zephyr RTOS builds using the Nuvoton NPCX eSPI driver (drivers/espi/espi_npcx.c)
  • NPCX and NPCK SoC targets with CONFIG_ESPI_TAF enabled
  • Boards relying on TAF flash protection regions arbitrated by the embedded controller

Discovery Timeline

  • 2026-10-21 - CVE-2026-78119 published to NVD
  • 2026-10-22 - Last updated in NVD database

Technical Details for CVE-2026-78119

Vulnerability Analysis

The TAF parser reads the request header out of the FLASHRXBUF FIFO and uses the raw 12-bit length to populate struct espi_taf_pckt.src, a fixed 16-word (64-byte) member of a static structure. For write and RPMC OP1 requests, the driver copies DIV_ROUND_UP(len, 4) words into that buffer without validating len against either the structure size or the negotiated rx-plsize (64 bytes on in-tree NPCX/NPCK SoCs).

Both the loop counter and word count were declared as uint8_t, allowing the copy to iterate up to 255 times. The unvalidated length is then forwarded to flash_write() in espi_taf_npcx_flash_write() using the 64-byte src buffer as the source, so the SPI flash write pulls from adjacent controller SRAM at a host-chosen address. A related fixed-size stack buffer in taf_npcx_completion_handler() is also overflowed by four bytes on the maximum-size completion path when tx-plsize equals 64.

Root Cause

The root cause is missing bounds validation on an attacker-controllable length field combined with undersized counter types. The driver assumes the eSPI host honors the negotiated payload size, but TAF exists precisely because the host is not trusted to arbitrate flash access.

Attack Vector

Exploitation requires host-side firmware or bus-level control that can emit a non-compliant eSPI flash request. Ordinary host software cannot reach the defect, but a compromised or malicious host firmware can corrupt controller .bss, hang the embedded controller, or tamper with driver state that gates the TAF flash protection regions (espi_taf_check_read_protect() / espi_taf_check_write_protect()).

c
	struct espi_reg *const inst = HAL_INSTANCE(dev);
	struct npcx_taf_head taf_head;
	uint32_t taf_addr, head_data;
-	uint8_t i, roundsize;
+	uint16_t i, roundsize, max_rxbuf_words;

	/* Get type, length and tag from RX buffer */
	head_data = inst->FLASHRXBUF[0];

Source: Zephyr commit 1a8a0839 — widens counters and adds payload size validation in espi_taf_parse().

Detection Methods for CVE-2026-78119

Indicators of Compromise

  • Unexpected embedded controller crashes, hangs, or watchdog resets correlated with eSPI flash activity.
  • SPI flash contents at host-addressable offsets containing non-flash data that resembles controller SRAM or register state.
  • TAF flash protection regions behaving inconsistently with their configured policy.

Detection Strategies

  • Audit build configurations for CONFIG_ESPI_TAF=y on NPCX or NPCK targets and compare against the fixed Zephyr revision.
  • Instrument TAF request handling to log any flash request whose header length exceeds the negotiated rx-plsize.
  • Review firmware images for the vulnerable uint8_t counters in espi_taf_parse() prior to the patch.

Monitoring Recommendations

  • Monitor host-to-EC eSPI traffic for malformed flash cycle headers, oversized payloads, or unsupported cycle types.
  • Alert on repeated unsuccessful TAF completion packets, which may indicate probing after the patched invalid_flag path is active.
  • Track embedded controller firmware integrity using measured boot or runtime attestation where supported.

How to Mitigate CVE-2026-78119

Immediate Actions Required

  • Rebuild and reflash affected Zephyr firmware with the fix from commit 1a8a0839c557a4aaa7572eb5d4948abde307b39f.
  • Inventory devices built with CONFIG_ESPI_TAF enabled on NPCX/NPCK SoCs and prioritize them for update.
  • Validate the devicetree rx-plsize and tx-plsize values match the hardware configuration expected by the patched driver.

Patch Information

The fix widens the loop and word counters to uint16_t, rejects any request whose word count exceeds both ARRAY_SIZE(FLASHRXBUF) - NPCX_ESPI_FLASH_HEADER_ADDRESS_LEN and NPCX_TAF_RX_PAYLOAD_WORDS (derived from rx-plsize), and marks offending packets with a new invalid_flag so espi_taf_work() responds with an unsuccessful completion. It also bounds the transmit payload against FLASHTXBUF and adds a default case for unsupported cycle types. See the Zephyr GHSA-p882-92qp-g6jr advisory and the upstream commit.

Workarounds

  • Disable CONFIG_ESPI_TAF where the embedded controller does not need to arbitrate host flash access.
  • Restrict host firmware update paths and enforce signed host BIOS/EC images so untrusted code cannot emit non-compliant eSPI flash requests.
  • Ensure physical and supply-chain controls prevent bus-level tampering with the eSPI link between host and embedded controller.
bash
# Confirm the Zephyr tree includes the fix before building firmware
git -C zephyr log --oneline 1a8a0839c557a4aaa7572eb5d4948abde307b39f -1

# Audit a board configuration for the vulnerable feature
grep -R "CONFIG_ESPI_TAF" boards/ build/zephyr/.config

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

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.