NETGEAR R7800 AFPD PreAuth
📡

NETGEAR R7800 AFPD PreAuth

⚠️ [ ORIGIN SOURCE ]
https://ssd-disclosure.com/ssd-advisory-netgear-r7800-afpd-preauth/
📅 [ Archival Date ]
Nov 23, 2022 9:03 PM
🏷️ [ Tags ]
Netgear R7800Heap Overflow
✍️ [ Author ]

SSD Disclosure / Technical Lead

💣 [ PoC / Exploit ]
https://crash.link/r7800-afpd-preauth

TL;DR

A vulnerability in NETGEAR AFPD, Apple Filing Protocol daemon, process allows LAN side attackers to cause the product to overflow a buffer due to a pre-auth vulnerability.

Vulnerability Summary

A heap-buffer overflow in afpdʼs dsi_writeinit is leveraged to overwrite the proto_close function pointer in the DSI struct, and execute arbitrary code on the NETGEAR R7800 Smart Router, in the default configuration, on the LAN side, pre-auth.

Credit

An independent security researcher has reported this to the SSD Secure Disclosure program.

Affected Versions

NETGEAR R7800 (V1.0.2.90)

Technical Analysis

The core vulnerability lies within afpdʼs dsi_writeinit function:

In this function, buf is intended to be filled by the user-provided “dsi” buffer. “dsi” is completely attacker controlled. Here, the dsi->header.dsi_code can be set to an unexpectedly large value, and dsi_len can be set to an arbitrary value, so we are able to write from nearly arbitrary locations in “dsi” to nearly arbitrary length of “buf”. We use this bug to overwrite the proto_close member of the DSI struct, which is a function pointer called on close, and we can set up part of value of DSI structure here:

Vendor Response

The vendor has issued a patch on the 6th of November 2022, but has not provided us with any reference to which of its advisories it is, or what firmware version has fixed the vulnerability.

Exploit