VLAN hopping

term

networkingsecurity

Kept in this browser · My desk

Sending traffic into a VLAN that the sender's switch port does not belong to, without passing through a router, by abusing trunk negotiation (switch spoofing) or the untagged native VLAN of a trunk (double tagging).

Switch spoofing makes a port left in a negotiating mode, Cisco's default dynamic auto, form a trunk with a host that speaks the Dynamic Trunking Protocol; the host then reaches every VLAN the trunk carries, in both directions. Double tagging needs only an access port in the trunk's native VLAN and works one way. Both were tested by Cisco and @stake in 2002 and implemented in the Yersinia framework in 2005.

What it is. VLAN hopping is sending traffic into a VLAN (virtual local area network) that the sender's switch port does not belong to, without passing through a router or firewall. It matters because VLANs are routinely used as security boundaries, a guest network on one VLAN and payment terminals on another, and a hop crosses that boundary at layer 2, below every filter applied at the routed interface. The techniques abuse trunk negotiation (switch spoofing), the untagged native VLAN of a trunk (double tagging) or the trust a switch gives to tagged frames on a port meant for one VLAN.

The tag being abused. An 802.1Q tag is four bytes inserted after the source address: the Tag Protocol Identifier 0x8100, which IANA (Internet Assigned Numbers Authority) lists as the Customer VLAN Tag Type, then a 16-bit field holding a 3-bit priority code point, a drop eligible indicator and a 12-bit VLAN identifier whose usable values run from 1 to 4094 (the IEEE (Institute of Electrical and Electronics Engineers) types model forbids 0 and 4095 as VLAN indices). A trunk carries many VLANs by tagging each frame; an access port carries one and expects untagged frames. Every hop technique is a way of getting a tag the attacker chose honoured by a switch that should have rejected it.

The early record. The National Vulnerability Database (NVD) record CVE-1999-1129, published on 1 September 1999, states the problem in its first form: Cisco Catalyst 2900 VLAN switches let remote attackers inject 802.1Q frames into another VLAN by forging the VLAN identifier in the trunking tag. Sean Convery's Black Hat USA 2002 slides, reporting Cisco and @stake tests, note that a SANS paper on the subject was already two years old. They describe the basic attack (a station spoofs a switch with ISL (Inter-Switch Link) or 802.1Q signalling, usually with DTP (Dynamic Trunking Protocol) as well, and becomes a member of all VLANs, if the port's setting favours trunking) and the double-encapsulated one (the switch performs only one level of decapsulation, traffic flows one way only, it requires the trunk to share the attacker's native VLAN, and it works even if trunking is set to off). CVE-2005-4440 (21 December 2005) records double tagging as demonstrated by the Yersinia framework, which S21sec's David Barroso and Alfredo Andrés presented at Black Hat Europe 2005 together with DTP, STP (Spanning Tree Protocol) and VTP (VLAN Trunking Protocol) attacks.

Switch spoofing, worked. A port left in a negotiating mode, Cisco's default dynamic auto, forms a trunk with a host that speaks DTP; the Catalyst 9300 guide confirms dynamic auto as the default and states that a trunk carries all VLANs, 1 to 4094, by default. A host that sends DTP announcing itself as desirable therefore receives a trunk, configures tagged subinterfaces for VLAN 10, 20 and 30, and talks to each directly, in both directions, as if it were a switch. Nothing in the attack is malformed: the switch is doing what its default configuration allows.

Double tagging, in one line. A host in the trunk's native VLAN sends a frame with two tags; the first switch strips the outer one when it forwards the frame untagged on the native VLAN, and the next switch reads the inner tag and delivers the frame into the victim VLAN. Cisco's 2008 campus design guide calls it a remote possibility that needs the native VLAN identifier and carries traffic in one direction only; the IEEE editor's 2022 note explains why it works, since a bridge can remove a tag but does not double tag and does not look beyond the tag it reads.

Other doors. Voice VLANs are a legitimate tagged path into an access port, and VoIP Hopper (version 2.0 released on 15 August 2011, after DEF CON 19) shows the abuse: it imitates an IP phone's discovery, LLDP-MED (Link Layer Discovery Protocol, Media Endpoint Discovery) or DHCP (Dynamic Host Configuration Protocol) options, to learn and join the voice VLAN. And the IEEE 802.1Q management model's own defaults, ports that admit all frames and ingress filtering off, are the permissive ones, so access ports deserve checking: a port that accepts any tag behaves like the 1999 Catalyst.

The fixes are configuration. Fix host ports as access ports with negotiation off, fix trunks as trunks with negotiation off and an explicit list of allowed VLANs, give each trunk a native VLAN that no access port uses or tag the native VLAN, keep VLAN 1 out of user traffic, and park unused ports in an unused, disabled VLAN; the 2022 network infrastructure guidance of the National Security Agency (NSA), sections 9.1 to 9.3 with switchport trunk native vlan 500 as its example, and the Cisco switch STIG (Security Technical Implementation Guide) finding V-220646 of the Defense Information Systems Agency (DISA) require exactly these. Convery's slides gave the same list in 2002, with a reminder that defaults change between platforms, so the operational mode should be checked with show interface switchport rather than assumed.

Limits and neighbours. Voice VLANs and priority-tagged frames are the legitimate tags on access ports, and the 2022 VLAN 0 bypass (CERT Coordination Center note VU#855201) shows why an allow-list of frame types matters: a frame tagged with VLAN 0 does not hop, but it can slip past ARP (Address Resolution Protocol) inspection and RA (Router Advertisement) guard on its way to a host that strips the tag. A hop is not a routing failure either: inter-VLAN traffic that passes through a router or firewall is policy, and policy is where the boundary should be enforced. Neighbours: double tagging, DTP, priority tag, native VLAN, trunk port, 802.1Q, port security and 802.1X.

Also known as: vlan hopping, vlan hop, switch spoofing, vlan hopping attack

Sources

← Back to V Back to the glossary