DHCPv6-Shield

term

networkingsecurity

Kept in this browser · My desk

The switch feature, specified in RFC 7610 of August 2015, that drops DHCPv6 server messages arriving on ports where no DHCPv6 server or relay is expected; vendors call it DHCPv6 Guard.

It is the IPv6 counterpart of DHCP snooping and the companion of RA Guard. It matters on networks that run no IPv6 as much as on those that do, because hosts with IPv6 enabled ask for DHCPv6 configuration on their own and accept a resolver from whoever answers, the behaviour Fox-IT's mitm6 tool exploited in 2018. RFC 8415 points to it for mitigating rogue DHCPv6 servers.

What it is. RFC 7610, 'DHCPv6-Shield: Protecting against Rogue DHCPv6 Servers', by Fernando Gont, Will Liu and Gunter Van de Velde, published as Best Current Practice 199 in August 2015. In its words, 'a layer 2 device filters DHCPv6 messages intended for DHCPv6 clients', and 'The most basic filtering criterion is that DHCPv6-server messages are discarded by the layer 2 device unless they are received on specific ports'. The administrator configures the ports where servers or relays are attached; everything else is treated as client-facing. RFC 6104 had asked for exactly this in 2011, noting that 'DHCPv6 message snooping would also be very desirable in IPv6 networks'.

How it works. DHCPv6 (RFC 8415, November 2018) runs over UDP: clients listen on port 546, servers and relays on 547, and clients send Solicit messages to the multicast address ff02::1:2. Servers reply with Advertise and Reply messages, and those, with Reconfigure and the relay messages, are what a shield blocks on untrusted ports. The protocol makes the switch's role decisive: a client 'MUST collect valid Advertise messages for the first RT seconds, unless it receives a valid Advertise message with a preference value of 255', in which case it 'immediately begins' the exchange with that server, so a rogue server does not even have to win a race. RFC 8415's security considerations list the threats a shield addresses (a malicious server mounting a man-in-the-middle for DNS or NTP, a Server Unicast option that bypasses relays) and say they 'can be mitigated by making use of the mechanisms described in [RFC7610]'.

Implementation detail. RFC 7610 carries the lesson learnt from RA Guard's evasions: IPv6 extension headers and fragmentation can hide the UDP header from a simple filter. So a shield must parse the whole IPv6 header chain, and a first fragment that does not contain the entire chain 'MUST drop the packet and ought to log the packet drop event in an implementation-specific manner as a security fault'. Cisco's implementation, IPv6 DHCP Guard on Catalyst 9300 (IOS XE 17.10 guide, November 2022), 'blocks reply and advertisement messages that come from unauthorized DHCPv6 servers and relay agents', defaults ports to the client role, and 'can prevent forged messages from being entered in the binding table' that the switch's first hop security features share (SISF).

In practice and what goes wrong. Fox-IT's mitm6 (January 2018) answered the DHCPv6 requests that Windows sends by default, assigned addresses and named itself as the IPv6 DNS server, which Windows then preferred for both A and AAAA queries; MITRE's mitigation for DHCP Spoofing accordingly says to 'block DHCPv6 traffic and incoming router advertisements, especially if IPv6 is not commonly used in the network'. A shield configured without RA Guard leaves the other door open, since an RA with the O or M flag tells hosts to use DHCPv6 and an RDNSS option can set a resolver directly. Trusting every trunk, or omitting IPv6 policy on wireless segments, recreates the gap.

What the shield is protecting. RFC 8415's own security section lists the attacks a rogue server can make once its messages reach a client: providing 'incorrect configuration information' to 'mount a man in the middle attack' for DNS or NTP; setting SOL_MAX_RT and INF_MAX_RT 'to an unreasonably high value' to delay a client that hears no valid server; a Server Unicast option that makes the client 'bypass relays and communicate only with the malicious server'; and a forged Reconfigure, which a client 'MUST discard' unless authenticated, the Reconfigure Key Authentication Protocol being the protection, itself weak against an attacker who sees the key sent in plain text at first. MITRE adds the stateless case: DHCPv6 clients can receive configuration without an address 'by sending an INFORMATION-REQUEST (code 11) message to the All_DHCP_Relay_Agents_and_Servers multicast address', and a rogue server can answer that too. All of these require the server's messages to reach the client, which is the single thing the shield denies.

Neighbours. DHCP snooping (IPv4), RA Guard, the first-hop security binding table and IPv6 Source Guard, rogue DHCP servers, Router Advertisements and the RDNSS option.

Also known as: dhcpv6 guard, ipv6 dhcp guard, rfc 7610, rogue dhcpv6 protection

← Back to D Back to the glossary