Skip to content
RCE Write-up Advanced

CVE-2026-42511 Breakdown: RCE in FreeBSD

FreeBSD's dhclient wrote attacker-controlled BOOTP filename and server-name fields into the lease file without escaping, allowing a malicious DHCP server to inject a medium directive. That directive was later passed to eval in the root-run dhclient-script, giving command execution as root.

aisle.com

Published on aisle.com

FreeBSD is often described as one of the most secure operating systems in the world, with its reputation arising from its high-quality networking stack, deliberate engineering, and a philosophy of security through simplicity. FreeBSD's history and usage are remarkable: it powers Netflix's Open Connect infrastructure…

The author, on aisle.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

Likely unescaped serialisation of attacker-controlled BOOTP fields into the lease file, combined with shell eval of the recovered medium value in a root script.

Impact

An attacker on the same local network could gain root on any FreeBSD system using DHCP, including laptops on public Wi-Fi and locked-down consoles.

What the attacker needed

Attacker on same broadcast domain; ability to run or spoof a DHCP server; victim uses DHCP

The fix

FreeBSD released a fix in advisory FreeBSD-SA-26:12.dhclient.

How it was found

  1. A malicious DHCP server replies with a BOOTP file field containing embedded quotes and a crafted medium directive.
  2. dhclient writes that value into the lease database without escaping embedded quotes.
  3. The poisoned lease is later reparsed and the injected medium directive becomes trusted lease state.
  4. dhclient invokes /sbin/dhclient-script with the medium value set.
  5. dhclient-script runs eval on the medium value, executing the attacker's shell metacharacters as root.

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.

DHCP is how a computer automatically gets an IP address when it joins a network. FreeBSD's DHCP client saved some text from the network's reply into a file without cleaning it, and later ran part of that text as a command with full system rights. Anyone who could pretend to be the network's DHCP server could therefore run their own commands on the victim's machine.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.