Trustwave SpiderLabs Uncovers Critical Cybersecurity Vulnerabilities Exposing Manufacturers to Costly Attacks. Learn More

Trustwave SpiderLabs Uncovers Critical Cybersecurity Vulnerabilities Exposing Manufacturers to Costly Attacks. Learn More

Managed Detection & Response

Eradicate cyberthreats with world-class intel and expertise

Managed Security Services

Expand your team’s capabilities and strengthen your security posture

Consulting & Professional Services

Tap into our global team of tenured cybersecurity specialists

Penetration Testing

Subscription- or project-based testing, delivered by global experts

Database Security

Get ahead of database risk, protect data and exceed compliance requirements

Email Security & Management

Catch email threats others miss with layered security & maximum control

Co-Managed SOC (SIEM)

Eliminate alert fatigue, focus your SecOps team, stop threats fast, and reduce cyber risk

Microsoft Exchange Server Attacks
Stay protected against emerging threats
Rapidly Secure New Environments
Security for rapid response situations
Securing the Cloud
Safely navigate and stay protected
Securing the IoT Landscape
Test, monitor and secure network objects
Why Trustwave
The Trustwave Approach
Awards and Accolades
Trustwave SpiderLabs Team
Trustwave Fusion Platform
SpiderLabs Fusion Center
Security Operations Centers
Technology Alliance Partners
Key alliances who align and support our ecosystem of security offerings
Trustwave PartnerOne Program
Join forces with Trustwave to protect against the most advance cybersecurity threats
SpiderLabs Blog

Bad Neighbors Can Break Windows (CVE-2020-16898)

On October 13th, 2020, Microsoft released a patch for a critical vulnerability (CVE-2020-16898) in the IPv6 stack, capable of causing BSOD (Blue Screen of Death). The vulnerability, codenamed “Bad Neighbor”, is a bug in the IPv6 Neighbor Discovery Protocol, particularly it’s improper handling of ICMPv6 Router Advertisement Packets. While publicly available proof of concept (PoC) code results in a denial of service, attackers can exploit this bug to perform remote code execution (RCE). This combined with ease of exploitation has earned this vulnerability a CVSS v3 score of 8.8.

Vulnerability Details and Analysis

This vulnerability results from improper handling of ICMPv6 Router Advertisements with Recursive DNS Server options (RDNSS) and an even length field value. According to RFC 8106 the length option for RDNSS is in units of 8 octets with a minimum value of 3 for one IPv6 address and every additional RDNSS address increases the length by 2. This field is used to determine the number of IPv6 addresses in the option (See Figure 1 below). The addresses field is a variable field that determines the number addresses which is equal to (Length-1)/2. Each IPv6 address is 16 bytes in length and each requires the length field to be greater than 3 and an odd number.

      0                   1                   2                   3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
| Type | Length | Reserved |
| Lifetime |
| |
: Addresses of IPv6 Recursive DNS Servers :
| |

Figure 1: RDNSS Option Format


The Exploit

By Sending an RDNSS option with an even length, we send an IPv6 address value which is 8 bytes short of the required 16 bytes leading the TCP/IP stack to believe it is the start of a second option leading to buffer overflow or a potential RCE. The Windows driver tcpip.sys fails to parse this type of request with an even option resulting in a denial of service or a BSOD. Tcpip.sys is a windows driver that is used to communicate amongst devices by setting the properties of TCP/IP.

McAfee Labs has a great write up explaining the vulnerability, which we recommend reading. This link also has a detailed explanation of how the exploit works as well as a proof of concept that we used for showing exploitation in the video below.

As we know Bad Neighbor lets the last 8 bytes of the RDNSS option to be interpreted as the first bytes of a new option. The PoC makes use of this misinterpretation and includes Routing Information Option (type = 24) with max length as the new option. As these 8 bytes are initially subjected to be part of the IPv6 address of the RDNSS option it does not undergo validation that includes a size of length check. Finally, the packet is fragmented (See Figure 2 below) to make sure NdisGetDataBuffer will write everything into the storage buffer. The storage buffer is a static buffer of 0x20 bytes is unable to handle all the packets causing buffer overflow leading to BSOD.

Figure 2: Exploit Packet Fragmentation


This vulnerability cannot be exploited over the Internet and the /GS(Buffer Security Check) Buffer security exploit mitigation makes it extremely hard to perform code execution on modern Windows operating systems. Weaponizing this to make it wormable will not be trivial. However, it is still potent for denial of service.


The best way to protect your system currently is by applying Microsoft’s October Patch Tuesday updates. If you are unable to patch you should disable ICMPV6 RDNSS with the following Powershell command.

netsh int ipv6 set int *INTERFACENUMBER* rabaseddnsconfig=disable

This workaround is only available for Windows 1709 and above and does not require a reboot. It should be noted that this disables RA-based DNS configuration. Please refer to Microsoft Security Advisory for more details.

Detection guidance

Trustwave Security Testing Services customers can detect if this vulnerability is patched via authenticated scans. Additionally, Trustwave IDPS customers are also covered with new alert signatures for this exploit.

To identify potential exploit attempts, look out for Router Advertisement (RA) packets (type =134) with the RDNSS option (option type = 25) (See Figure 3 below). Flag those that have an even value in its length field. Also, make sure the length is at least 3. In cases that try to exploit the buffer overflow watch out for fragmented IPv6 packets followed by the Router Advertisement (See Figure 2 above). Additionally, a payload size greater than 100 bytes can be a good indication of exploitation. A Windows loader shellcode can be quite small but will most likely push the payload past 100 bytes. As always, monitor your own networks to baseline what is normal to best implement this sort of detection.

Image003Figure 3: Bad Neighbor exploit packet



Latest SpiderLabs Blogs

Trustwave SpiderLabs Report: LockBit 3.0 Ransomware Vs. the Manufacturing Sector

As the manufacturing sector continues its digital transformation, Operational Technology (OT), Industrial Control Systems (ICS), and Supervisory Control and Data Acquisition (SCADA) are becoming...

Read More

Overview of the Cyberwarfare used in Israel – Hamas War

On October 7, 2023, the Palestinian organization Hamas launched the biggest attack on Israel in years, resulting in numerous casualties and hostages taken. Israel responded with a large-scale ground...

Read More

The 2023 Retail Services Sector Threat Landscape: A Trustwave Threat Intelligence Briefing

The annual holiday shopping season is poised for a surge in spending, a fact well-known to retailers, consumers, and cybercriminals alike. The latter group, however, is poised to exploit any...

Read More