double tagging
termKept in this browser · My desk
A VLAN hopping technique in which a host in a trunk's native VLAN sends a frame with two 802.1Q tags, so that the first switch strips the outer tag on the untagged native VLAN and the next switch delivers the frame into the VLAN named by the inner one.
It works because a bridge classifies a frame by its first tag and, as the IEEE 802.1Q revision editor's 2022 note puts it, can remove a tag but does not double tag and does not look beyond the tag it reads. Cisco's 2008 campus design guide calls it a remote possibility that needs the native VLAN ID and carries traffic in a single direction only; Convery's 2002 slides add that it works even when trunk negotiation is off.
What it is. Double tagging is a VLAN (virtual local area network) hopping technique in which a host in a trunk's native VLAN sends a frame carrying two 802.1Q tags, so that the first switch strips the outer tag when it sends the frame across the trunk untagged in the native VLAN, and the next switch, reading the inner tag as the frame's only tag, delivers it into the VLAN the attacker chose. It needs no negotiation and no misbehaving protocol, only a native VLAN shared by the attacker's access port and the trunk.
Worked by hand. A frame with an outer tag 81 00 00 01 (VLAN 1) and an inner tag 81 00 00 14 (VLAN 20) enters an access port in VLAN 1; the trunk sends VLAN 1 untagged, so what crosses it carries only 81 00 00 14, and the far switch puts it in VLAN 20. Byte by byte the frame leaves the attacker as destination address, source address, 81 00 00 01, 81 00 00 14, 08 00 and an IPv4 packet. Each tag is the Tag Protocol Identifier 0x8100, which IANA (Internet Assigned Numbers Authority) registers as the Customer VLAN Tag Type, followed by 16 bits: 3 of priority, 1 drop eligible indicator and 12 of VLAN identifier; 0x0014 is priority 0, VLAN 20, and 0x0001 is VLAN 1. Wireshark decodes both headers and shows two vlan.id values in one frame, which is the signature to look for on an access port.
Why it works. It works because a bridge classifies a frame by its first tag and, as the IEEE (Institute of Electrical and Electronics Engineers) 802.1Q revision editor's 2022 note puts it, can remove a tag but does not double tag and does not look beyond the tag it reads. The first switch sees a frame tagged VLAN 1 arriving on a port in VLAN 1, removes the tag because VLAN 1 is the trunk's untagged VLAN, and forwards; it never examines the second tag. The second switch sees one tag and obeys it. Neither switch is faulty by the standard; the native VLAN is the weak link.
Why one way. The frame reaches the victim, but any reply is addressed within VLAN 20 and stays there; it never returns to VLAN 1. Cisco's 2008 campus design guide calls the technique a remote possibility that needs the native VLAN ID and carries traffic in a single direction only; Convery's 2002 slides, from Cisco and @stake testing, add that it works even when trunk negotiation is off, because it uses ordinary forwarding rather than DTP (Dynamic Trunking Protocol). One-way delivery limits it to packets that need no answer, a spoofed datagram or a trigger, but that is enough to reach a host that a router or firewall was meant to protect.
The record. The National Vulnerability Database (NVD) entry CVE-2005-4440, published on 21 December 2005, describes it as the double-tagging VLAN jumping attack, demonstrated by Yersinia: a message with two 802.1Q tags, the second acted on by a downstream switch after the first has been stripped. Yersinia's authors, David Barroso and Alfredo Andrés of S21sec, presented it at Black Hat Europe that year among attacks on DTP, STP (Spanning Tree Protocol) and VTP (VLAN Trunking Protocol).
Legitimate double tags. Two tags are not always an attack. Provider bridging (often called Q-in-Q) carries a customer's tagged frames inside a service tag, which IANA registers as 0x88A8, the S-Tag, distinct from the customer's 0x8100; the IEEE editor's note mentions the related case of a customer bridge sending S-tagged priority-tagged frames to a provider bridge. The attack is a pair of customer tags arriving where only untagged frames belong.
The fixes. Moving the trunk's native VLAN to an unused ID, tagging the native VLAN on trunks, or making access ports admit only untagged and priority-tagged frames each stops the example; the STIG (Security Technical Implementation Guide) finding V-220646 of the Defense Information Systems Agency (DISA) and the 2022 guidance of the National Security Agency (NSA) require the first, and accept the second as an alternative. The IEEE bridge model names the third option admit-only-untagged-and-priority-tagged, while its default is admit-all-frames, so an access port that has never been configured accepts the attacker's tagged frame. Removing access ports from VLAN 1 altogether, as the NSA advises, removes the common case where the attacker's VLAN and the default native VLAN coincide.
Misreadings. Double tagging is not switch spoofing: it needs no trunk on the attacker's port and survives DTP being off. It is not VLAN 0 abuse either: a priority tag carries VLAN 0 and moves nothing between VLANs, though it can hide traffic from filters. Neighbours: VLAN hopping, native VLAN, 802.1Q, trunk port, VLAN and priority tag.
Also known as: double tagging, double-tagged frame, double encapsulation, 802.1q double tagging, double 802.1q encapsulation
Sources
- Mick Seaman, Using VLAN Tags to convey priority, IEEE P802.1Q-Rev editor's note, 19 January 2022 (read 2026-11-23): every received frame is classified to a VID; VID 0 is not a valid PVID; bridges do not transmit priority-tagged frames, do not double tag and do not look beyond a C-VLAN tag
- Cisco, Campus Network for High Availability Design Guide, Cisco Validated Design, 21 May 2008, PDF bytes saved by WebFetch (read 2026-11-23): enable root guard or BPDU guard on access ports; disable trunking on host ports; trunks on with no negotiation; native VLAN on an unused ID or tagged; double 802.1Q encapsulation is one-way and needs the native VLAN ID
- DISA, Cisco IOS Switch L2S STIG, finding V-220646 (guide dated 2026-05-01), stigviewer.com (read 2026-11-23): native VLAN other than the default on every 802.1q trunk; tagging native traffic as the alternative; the double-tagging mechanism described
- Sean Convery (Cisco Systems), Hacking Layer 2: Fun with Ethernet Switches, Black Hat USA 2002 (read 2026-11-23): Cisco and @stake tests; macof since May 1999 (Ian Vitek, Perl; C port by Dug Song); 155,000 entries a minute filled a 131,052-entry Catalyst 6506 table in 70 seconds; existing entries keep forwarding; port security and its modes; STP root claims, the dual-homed requirement, a gigabit backbone reduced to 10 Mb half duplex; BPDU guard and root guard; DTP switch spoofing and double 802.1Q encapsulation, one-way, needs the trunk's native VLAN; port security does not help against ARP spoofing
- NSA, Network Infrastructure Security Guidance, PP-22-0266, March 2022, AHA-hosted copy (read 2026-11-23): section 9.1 disable dynamic trunking, an adversary on a dynamic port could make it a trunk; section 9.3 default VLAN disallowed, unique native VLAN on trunks, unused disabled VLANs
- IEEE 802.1, ieee802-dot1q-bridge YANG module, revision 2023-10-26 (read 2026-11-23): PVID default 1; acceptable frame types admit-only-VLAN-tagged-frames, admit-only-untagged-and-priority-tagged, admit-all-frames (default); ingress filtering default false
- NIST National Vulnerability Database (NVD), CVE-2005-4440, record through the NVD API (read 2026-11-23): the 802.1Q VLAN protocol lets attackers bypass segmentation with a message carrying two 802.1Q tags, the second acted on by a downstream switch after the first is stripped, as demonstrated by Yersinia, the double-tagging VLAN jumping attack; published 21 December 2005
- IANA, IEEE 802 Numbers registry (read 2026-11-23): EtherTypes 0x0800 IPv4, 0x0806 ARP, 0x8100 Customer VLAN Tag Type (C-Tag, formerly called the Q-Tag), 0x88A8 Service VLAN tag (S-Tag), 0x86DD IPv6
- Wireshark, Display Filter Reference: 802.1Q Virtual LAN (read 2026-11-23): vlan.priority, vlan.dei, vlan.id and vlan.etype
- David Barroso and Alfredo Andrés (S21sec), Yersinia: Framework for layer 2 attacks, Black Hat Europe 2005, PDF at Dartmouth (read 2026-11-23): STP, CDP, DTP, DHCP, HSRP, 802.1Q, VTP attacks; no authentication in these protocols; set all ports to DTP off
- IEEE 802.1, ieee802-dot1q-types YANG module (read 2026-11-23): priority code point 3 bits, VLAN identifier 12 bits, usable range 1 to 4094; 0 and 4095 not permitted as VLAN indices