Activity log for bug #1884341

Date Who What changed Old value New value Message
2020-06-20 05:15:44 Etienne CHAMPETIER bug added bug
2020-06-20 05:17:04 Etienne CHAMPETIER summary Anti-spoofing bypass using VLAN0 stacking Anti-spoofing bypass
2020-06-20 15:12:13 Jeremy Stanley bug task added ossa
2020-06-20 15:12:19 Jeremy Stanley ossa: status New Incomplete
2020-06-20 15:13:20 Jeremy Stanley description Hello OpenStack Team, Looking at the neutron code I believe OpenStack to be vulnerable to VLAN0 stacking when using iptables + ebtables (bridge only, not OVS). I was not able to validate this issue on an OpenStack deployment (I tried to setup microstack but was unable to connect to the VMs ...) VLAN 0 or priority tagging allow to add 802.1p class of service information to a packet. When received by a linux machine (I haven't checked Windows or other OS behavior) the VLAN header with VID=0 is removed and the packet processed as if there was no VLAN header (It actually loop until there is no VLAN 0 headers left). Now Linux bridge firewall (net.bridge.bridge-nf-call-*tables) handles the packets normally, ie a packet with a VLAN header will not match any ip*tables rules on the forward path, which is expected. When enabling net.bridge.bridge-nf-filter-vlan-tagged=1, it will go look into the first VLAN header, but not deeper. Using this simple scapy script: ``` ra = Ether()/Dot1Q(vlan=0)/Dot1Q(vlan=0) ra /= IPv6(dst='ff02::1') ra /= ICMPv6ND_RA(chlim=64, prf='High', routerlifetime=1800) ra /= ICMPv6NDOptSrcLLAddr(lladdr=get_if_hwaddr('enp1s0')) ra /= ICMPv6NDOptPrefixInfo(prefix="2001:db8:1::", prefixlen=64, validlifetime=1810, preferredlifetime=1800) sendp(ra) ``` We send an IPv6 router advertisement stacked on top of 2 VLAN 0 headers This bypass any ip6tables rules, and looking at the usage of ebtables in neutron it should go thru as it's not ARP (I only see ebtables used in arp_protect.py and matching ARP protocol) When received by a neighboor Linux VMs it's accepted. This same attack should allow DHCP, ARP or any traffic spoofing. (We might be able to use NFQUEUE to had VLAN 0 headers to all our egress packets to bypass MAC/IP checks) I've seen some system actually use VLAN 0 tagged packets by default (Cisco UCS) so a possible fix is to allow 1 level of VLAN 0 and enable net.bridge.bridge-nf-filter-vlan-tagged=1 In my tests Linux 'removes' both Dot1Q(vlan=0) and Dot1AD(vlan=0). (for example this is accepted by Linux: 'Ether()/Dot1Q(vlan=0)/Dot1Q(vlan=0)/Dot1AD(vlan=0)/Dot1Q(vlan=0)') I wasn't able to find any reference to VLAN 0 attacks searching on Google, so this might affect other OSS projects (I need to check LXC at least, maybe some K8S CNI) All my tests were performed with a Fedora 32 host (Linux 5.6) running 2 ubuntu 20.04 VM, and using scapy 2.4.3. Best Etienne Champetier This issue is being treated as a potential security risk under embargo. Please do not make any public mention of embargoed (private) security vulnerabilities before their coordinated publication by the OpenStack Vulnerability Management Team in the form of an official OpenStack Security Advisory. This includes discussion of the bug or associated fixes in public forums such as mailing lists, code review systems and bug trackers. Please also avoid private disclosure to other individuals not already approved for access to this information, and provide this same reminder to those who are made aware of the issue prior to publication. All discussion should remain confined to this private bug report, and any proposed fixes should be added to the bug as attachments. This embargo shall not extend past 2020-09-18 and will be made public by or on that date even if no fix is identified. Hello OpenStack Team, Looking at the neutron code I believe OpenStack to be vulnerable to VLAN0 stacking when using iptables + ebtables (bridge only, not OVS). I was not able to validate this issue on an OpenStack deployment (I tried to setup microstack but was unable to connect to the VMs ...) VLAN 0 or priority tagging allow to add 802.1p class of service information to a packet. When received by a linux machine (I haven't checked Windows or other OS behavior) the VLAN header with VID=0 is removed and the packet processed as if there was no VLAN header (It actually loop until there is no VLAN 0 headers left). Now Linux bridge firewall (net.bridge.bridge-nf-call-*tables) handles the packets normally, ie a packet with a VLAN header will not match any ip*tables rules on the forward path, which is expected. When enabling net.bridge.bridge-nf-filter-vlan-tagged=1, it will go look into the first VLAN header, but not deeper. Using this simple scapy script: ``` ra = Ether()/Dot1Q(vlan=0)/Dot1Q(vlan=0) ra /= IPv6(dst='ff02::1') ra /= ICMPv6ND_RA(chlim=64, prf='High', routerlifetime=1800) ra /= ICMPv6NDOptSrcLLAddr(lladdr=get_if_hwaddr('enp1s0')) ra /= ICMPv6NDOptPrefixInfo(prefix="2001:db8:1::", prefixlen=64, validlifetime=1810, preferredlifetime=1800) sendp(ra) ``` We send an IPv6 router advertisement stacked on top of 2 VLAN 0 headers This bypass any ip6tables rules, and looking at the usage of ebtables in neutron it should go thru as it's not ARP (I only see ebtables used in arp_protect.py and matching ARP protocol) When received by a neighboor Linux VMs it's accepted. This same attack should allow DHCP, ARP or any traffic spoofing. (We might be able to use NFQUEUE to had VLAN 0 headers to all our egress packets to bypass MAC/IP checks) I've seen some system actually use VLAN 0 tagged packets by default (Cisco UCS) so a possible fix is to allow 1 level of VLAN 0 and enable net.bridge.bridge-nf-filter-vlan-tagged=1 In my tests Linux 'removes' both Dot1Q(vlan=0) and Dot1AD(vlan=0). (for example this is accepted by Linux: 'Ether()/Dot1Q(vlan=0)/Dot1Q(vlan=0)/Dot1AD(vlan=0)/Dot1Q(vlan=0)') I wasn't able to find any reference to VLAN 0 attacks searching on Google, so this might affect other OSS projects (I need to check LXC at least, maybe some K8S CNI) All my tests were performed with a Fedora 32 host (Linux 5.6) running 2 ubuntu 20.04 VM, and using scapy 2.4.3. Best Etienne Champetier
2020-06-20 15:13:40 Jeremy Stanley bug added subscriber Neutron Core Security reviewers
2020-06-23 15:32:21 Brian Haley bug added subscriber Brian Haley
2020-08-20 14:28:18 Jeremy Stanley description This issue is being treated as a potential security risk under embargo. Please do not make any public mention of embargoed (private) security vulnerabilities before their coordinated publication by the OpenStack Vulnerability Management Team in the form of an official OpenStack Security Advisory. This includes discussion of the bug or associated fixes in public forums such as mailing lists, code review systems and bug trackers. Please also avoid private disclosure to other individuals not already approved for access to this information, and provide this same reminder to those who are made aware of the issue prior to publication. All discussion should remain confined to this private bug report, and any proposed fixes should be added to the bug as attachments. This embargo shall not extend past 2020-09-18 and will be made public by or on that date even if no fix is identified. Hello OpenStack Team, Looking at the neutron code I believe OpenStack to be vulnerable to VLAN0 stacking when using iptables + ebtables (bridge only, not OVS). I was not able to validate this issue on an OpenStack deployment (I tried to setup microstack but was unable to connect to the VMs ...) VLAN 0 or priority tagging allow to add 802.1p class of service information to a packet. When received by a linux machine (I haven't checked Windows or other OS behavior) the VLAN header with VID=0 is removed and the packet processed as if there was no VLAN header (It actually loop until there is no VLAN 0 headers left). Now Linux bridge firewall (net.bridge.bridge-nf-call-*tables) handles the packets normally, ie a packet with a VLAN header will not match any ip*tables rules on the forward path, which is expected. When enabling net.bridge.bridge-nf-filter-vlan-tagged=1, it will go look into the first VLAN header, but not deeper. Using this simple scapy script: ``` ra = Ether()/Dot1Q(vlan=0)/Dot1Q(vlan=0) ra /= IPv6(dst='ff02::1') ra /= ICMPv6ND_RA(chlim=64, prf='High', routerlifetime=1800) ra /= ICMPv6NDOptSrcLLAddr(lladdr=get_if_hwaddr('enp1s0')) ra /= ICMPv6NDOptPrefixInfo(prefix="2001:db8:1::", prefixlen=64, validlifetime=1810, preferredlifetime=1800) sendp(ra) ``` We send an IPv6 router advertisement stacked on top of 2 VLAN 0 headers This bypass any ip6tables rules, and looking at the usage of ebtables in neutron it should go thru as it's not ARP (I only see ebtables used in arp_protect.py and matching ARP protocol) When received by a neighboor Linux VMs it's accepted. This same attack should allow DHCP, ARP or any traffic spoofing. (We might be able to use NFQUEUE to had VLAN 0 headers to all our egress packets to bypass MAC/IP checks) I've seen some system actually use VLAN 0 tagged packets by default (Cisco UCS) so a possible fix is to allow 1 level of VLAN 0 and enable net.bridge.bridge-nf-filter-vlan-tagged=1 In my tests Linux 'removes' both Dot1Q(vlan=0) and Dot1AD(vlan=0). (for example this is accepted by Linux: 'Ether()/Dot1Q(vlan=0)/Dot1Q(vlan=0)/Dot1AD(vlan=0)/Dot1Q(vlan=0)') I wasn't able to find any reference to VLAN 0 attacks searching on Google, so this might affect other OSS projects (I need to check LXC at least, maybe some K8S CNI) All my tests were performed with a Fedora 32 host (Linux 5.6) running 2 ubuntu 20.04 VM, and using scapy 2.4.3. Best Etienne Champetier Hello OpenStack Team, Looking at the neutron code I believe OpenStack to be vulnerable to VLAN0 stacking when using iptables + ebtables (bridge only, not OVS). I was not able to validate this issue on an OpenStack deployment (I tried to setup microstack but was unable to connect to the VMs ...) VLAN 0 or priority tagging allow to add 802.1p class of service information to a packet. When received by a linux machine (I haven't checked Windows or other OS behavior) the VLAN header with VID=0 is removed and the packet processed as if there was no VLAN header (It actually loop until there is no VLAN 0 headers left). Now Linux bridge firewall (net.bridge.bridge-nf-call-*tables) handles the packets normally, ie a packet with a VLAN header will not match any ip*tables rules on the forward path, which is expected. When enabling net.bridge.bridge-nf-filter-vlan-tagged=1, it will go look into the first VLAN header, but not deeper. Using this simple scapy script: ``` ra = Ether()/Dot1Q(vlan=0)/Dot1Q(vlan=0) ra /= IPv6(dst='ff02::1') ra /= ICMPv6ND_RA(chlim=64, prf='High', routerlifetime=1800) ra /= ICMPv6NDOptSrcLLAddr(lladdr=get_if_hwaddr('enp1s0')) ra /= ICMPv6NDOptPrefixInfo(prefix="2001:db8:1::", prefixlen=64, validlifetime=1810, preferredlifetime=1800) sendp(ra) ``` We send an IPv6 router advertisement stacked on top of 2 VLAN 0 headers This bypass any ip6tables rules, and looking at the usage of ebtables in neutron it should go thru as it's not ARP (I only see ebtables used in arp_protect.py and matching ARP protocol) When received by a neighboor Linux VMs it's accepted. This same attack should allow DHCP, ARP or any traffic spoofing. (We might be able to use NFQUEUE to had VLAN 0 headers to all our egress packets to bypass MAC/IP checks) I've seen some system actually use VLAN 0 tagged packets by default (Cisco UCS) so a possible fix is to allow 1 level of VLAN 0 and enable net.bridge.bridge-nf-filter-vlan-tagged=1 In my tests Linux 'removes' both Dot1Q(vlan=0) and Dot1AD(vlan=0). (for example this is accepted by Linux: 'Ether()/Dot1Q(vlan=0)/Dot1Q(vlan=0)/Dot1AD(vlan=0)/Dot1Q(vlan=0)') I wasn't able to find any reference to VLAN 0 attacks searching on Google, so this might affect other OSS projects (I need to check LXC at least, maybe some K8S CNI) All my tests were performed with a Fedora 32 host (Linux 5.6) running 2 ubuntu 20.04 VM, and using scapy 2.4.3. Best Etienne Champetier
2020-08-20 14:28:28 Jeremy Stanley information type Private Security Public Security
2020-09-30 18:23:16 Nick Tait bug added subscriber Nick Tait
2021-04-19 07:18:44 Slawek Kaplonski tags linuxbridge
2023-01-28 14:57:37 Christian Rohmann bug added subscriber Christian Rohmann