Skip to content
DoS Write-up Intermediate

Heap Based Buffer Over-Read Vulnerability in Rldns-1.3

A heap-based out-of-bounds read occurs in rldns-1.3 when a malformed DNS packet ending with a non-null byte causes strlen to read past the allocated buffer. An attacker could send such a packet to crash the DNS server.

medium.com

Published on medium.com

During a fuzzing session with rldns-1.3, I discovered a heap-based out-of-bounds read vulnerability. I used honggfuzz 2.6 for this session.

Antonius W1sdom, on medium.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 routines that build a name from a DNS query do not properly null-terminate the string, so a later strlen call reads past the heap buffer.

Impact

A remote attacker could send a malformed DNS packet to crash the rldns server, causing a denial of service.

What the attacker needed

Network access to DNS server; send malformed DNS packet

The fix

The vulnerability was fixed in rldns-1.4.

How it was found

  1. Compile rldns-1.3 with AddressSanitizer enabled.
  2. Run rldns as root using a script that sets ASAN_OPTIONS.
  3. Use honggfuzz with a DNS corpus to send malformed packets to the server.
  4. Observe the crash and ASan log showing a READ of size 16 in strlen.
  5. Hook recvfrom with a shared object to log the last received packet.
  6. Recompile without ASan, preload the logger, and rerun honggfuzz to capture the crashing packet.

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.

A DNS server reads incoming network packets and processes them. If a packet is malformed and lacks a proper string terminator, a function that measures string length keeps reading beyond the intended memory, which can crash the program. This is called an out-of-bounds read.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.