Skip to content
Memory corruption Write-up Advanced

Bad Neighbor on FreeBSD: IPv6 Router Advertisement Vulnerabilities in rtsold (CVE-2020-25577)

Four vulnerabilities were found in FreeBSD's rtsold daemon when parsing IPv6 Router Advertisement messages, including an infinite loop, out-of-bounds read, out-of-bounds write, and a stack buffer overflow. The most severe could allow an attacker on the same physical link to execute code as root.

blog.quarkslab.com

Published on blog.quarkslab.com

Posted Thu 28 January 2021 Author Francisco Falcon Category Vulnerability Tags FreeBSD, IPv6, Bad Neighbor, rtsold, CVE-2020-25577, vulnerability, CVE, 2021

Francisco Falcon, on blog.quarkslab.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

The code did not properly validate length fields in Router Advertisement options, leading to an infinite loop, out-of-bounds reads/writes, and a stack buffer overflow.

Impact

The most severe vulnerability could allow an attacker on the same physical link to gain remote code execution as root; in FreeBSD 12.2, rtsold runs in a Capsicum sandbox, limiting the impact.

What the attacker needed

Attacker on same physical link; target runs vulnerable rtsold

The fix

FreeBSD issued fixes for these vulnerabilities on December 1st, 2020.

How it was found

  1. Wait for a Router Solicitation (RS) packet from the target.
  2. Send a crafted Router Advertisement message to the target to trigger the chosen vulnerability.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

IPv6 devices use Router Advertisement messages to configure network settings. FreeBSD's rtsold program processes these messages but had bugs that could crash or take over the system when it received a malformed message. An attacker on the same local network could send such a message to exploit the bugs.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.