GHSA-9558-77jp-g3fw / CVE-2026-55490: EAD Integer Underflow → Pre-Auth Denial of Service
- Published:
- Fetched:
- Updated:
- Affects:
- openwrt openwrt
https://github.com/openwrt/openwrt/security/advisories/GHSA-9558-77jp-g3fw ↗
EAD Integer Underflow → Pre-Auth Denial of Service ### Summary An integer underflow in `handle_send_a()` of the Emergency Access Daemon (EAD) allows any unauthenticated attacker on the local network to crash the daemon by sending a single crafted UDP packet. No credentials are required — only a valid username (e.g. `root`) present in `/etc/passwd`. --- ### Details In `handle_send_a()` (lines 426–447 of `ead.c`), the message length is computed as: ```c // len is declared as int len = ntohl(msg->len) - sizeof(struct ead_msg_number); ``` `sizeof(struct ead_msg_number)` is `1` (one `uint8_t` field + flexible array). The subtraction is performed in **unsigned arithmetic** (C usual arithmetic conversions): if `msg->len == 0`, then `0u - 1u = 0xFFFFFFFF`. This value is then assigned to the `int len`, yielding `-1` on every two's-complement architecture (ARM, MIPS, x86, RISC-V — the full set of OpenWrt targets). The bounds check that follows is: ```c if (len > MAXPARAMLEN + 1) // -1 > 257 → FALSE → check bypassed return false; ``` `memcpy` is then called with `len` implicitly cast to `size_t`, producing `SIZE_MAX`: ```c A.len = len; // -1 A.data = abuf; memcpy(A.data, number->data, len); // memcpy(..., SIZE_MAX) → crash ``` **Why the packet passes all prior validation:** The dispatcher in `parse_message()` only checks that the *captured packet length* is `≥ sizeof(struct ead_packet) + 1`. It does **not** validate `msg->len`. `handle_packet()` (line 670) additionally requires: ```c if (h->len < sizeof(struct ead_packet) + ntohl(pkt->msg.len)) return; ``` When `msg->len == 0`, this reduces to `h->len >= sizeof(struct ead_packet)`. A packet with `h->len = sizeof(struct ead_packet) + 1` and `msg->len = 0` therefore **passes every check** and reaches the vulnerable `memcpy`. --- ### Proof of Concept **Prerequisites:** attacker on the same Layer-2/3 segment as the EAD daemon (UDP/56026). **Step 1 — Establish session with a valid username:** ``` # EAD_TYPE_SET_USERNAME → username = "root" # EAD_TYPE_GET_PRIME → retrieve SRP prime (no auth required) ``` **Step 2 — Send the malformed EAD_TYPE_SEND_A packet:** ``` h->len = sizeof(struct ead_packet) + 1 # passes handle_packet() check msg->len = 0x00000000 # triggers underflow in handle_send_a() ``` **Result:** `memcpy(abuf, number->data, SIZE_MAX)` is invoked, causing an immediate out-of-bounds read and daemon crash (SIGSEGV / SIGBUS). **No password knowledge is required.** --- ### Impact - **Type:** Denial of Service (daemon crash) - **Vector:** Adjacent Network, no authentication required - **Who is impacted:** Any OpenWrt device with EAD enabled and reachable on UDP/56026. EAD is used as an emergency remote-access mechanism; crashing it eliminates the emergency recovery capability and may be a precursor to a broader attack. - **Potential escalation:** The same `len = -1` path passes a `size_t` Affected packages: openwrt:openwrt