CVE-2023-28231: RCE In The Microsoft Windows DHCPv6 Service
A heap-based buffer overflow in the Microsoft Windows DHCPv6 service occurs because the server does not limit the number of nested Relay-forward messages to 32. An attacker on the same network can send a crafted DHCPv6 Relay-forward message with more than 32 nested messages to execute arbitrary code with the service's privileges.
Published on zerodayinitiative.com
A heap-based buffer overflow has been reported in Microsoft DHCPv6 Server. The vulnerability is due to improper processing of DHCPv6 Relay-forward messages.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The function ProcessRelayForwardMessage() allocates a fixed-size buffer for 32 nested Relay-forward messages but does not validate that the counter of nested messages stays within that limit, leading to a heap buffer overflow.
Impact
Successful exploitation could result in the execution of arbitrary code with administrative privileges, and since the service runs as NETWORK SERVICE, an attacker could escalate to SYSTEM.
What the attacker needed
Network access to the DHCPv6 server; ability to send DHCPv6 packets to UDP port 547
The fix
Microsoft addressed this vulnerability in April 2023 by releasing a patch; no other workaround is provided.
How it was found
- Craft a DHCPv6 Relay-forward message that contains more than 32 nested Relay-forward messages.
- Send the crafted message to the target DHCPv6 server on UDP port 547.
- The server processes the message and overflows the heap buffer, potentially allowing code execution.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
DHCPv6 is a protocol that automatically gives devices an IPv6 address on a network. A relay agent can forward these messages between networks, and messages can be nested inside each other. The server had a fixed-size memory area for keeping track of these nested messages but did not check if there were too many, so an attacker could overflow that area and potentially run their own code.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.