OpenWrt Project is a Linux operating system targeting embedded devices. In versions prior to 24.10.6 and 25.12.1, the mdns daemon has a Stack-based Buffer Overflow vulnerability in the match_ipv6_addresses function, triggered when processing PTR queries for IPv6 reverse DNS domains (.ip6.arpa) received via multicast DNS on UDP port 5353. During processing, the domain name from name_buffer is copied via strcpy into a fixed 256-byte stack buffer, and then the reverse IPv6 request is extracted into a buffer of only 46 bytes (INET6_ADDRSTRLEN). Because the length of the data is never validated before this extraction, an attacker can supply input larger than 46 bytes, causing an out-of-bounds write. This allows a specially crafted DNS query to overflow the stack buffer in match_ipv6_addresses, potentially enabling remote code execution. This issue has been fixed in versions 24.10.6 and 25.12.1.
The mdns daemon in the match_ipv6_addresses function processes PTR queries for reversed IPv6 domains (*.ip6.arpa) received via multicast DNS on UDP port 5353. The domain name is copied by strcpy into a fixed 256-byte buffer on the stack, after which the reversed IPv6 request is extracted into a buffer of only 46 bytes (INET6_ADDRSTRLEN). Since the length of input data is never verified before extraction, an attacker can supply data longer than 46 bytes, causing an out-of-bounds write. A specially crafted DNS query thus leads to a stack buffer overflow in the match_ipv6_addresses function.
An attacker can cause remote code execution (RCE) on a device running a vulnerable version of OpenWrt, potentially gaining full control over it. Due to the high impact on the confidentiality, integrity, and availability of both the system and network resources, the consequences of compromise may also include further lateral movement in the network.
OpenWrt should be updated to version 24.10.6 or 25.12.1, in which the vulnerability has been fixed. Patches and details are available in the project repositories: https://github.com/openwrt/openwrt/releases/tag/v24.10.6 and https://github.com/openwrt/openwrt/releases/tag/v25.12.1. As a temporary workaround, consider blocking multicast DNS traffic (UDP port 5353) from untrusted network segments.
OpenWrt versions earlier than 24.10.6 and earlier than 25.12.1 — affects embedded devices running the mdns daemon.
CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:XOpenwrt
OSOpenwrt< 24.10.625.12.0 – 25.12.1 (excl.)
Related vulnerabilities
OpenWrt odhcpd: XSS przez wstrzyknięcie newline w nazwę hosta DHCPv6
Stack-based Buffer Overflow w demonie mdns OpenWrt — przepełnienie stosu przez PTR query
Out-of-bounds write w sterowniku WLAN AP MediaTek — privilege escalation
Out-of-bounds write w sterowniku WLAN AP MediaTek – privilege escalation
Out of bounds write w sterowniku wlan AP — eskalacja uprawnień na układach MediaTek