Skip to content
Cache bugs Write-up Advanced

Melting the DNS Iceberg: Taking over your infrastructure Kaminsky style

Many closed DNS resolvers use static UDP source ports, making them vulnerable to Kaminsky cache poisoning attacks. An attacker could manipulate DNS records to redirect email, leading to account takeovers and system compromise.

Timo Longin Follow

Published on sec-consult.com

This blog post describes the core problem of our research and how to find vulnerabilities in closed DNS resolvers. Furthermore, open-source tools such as the DNS Analysis Server, are introduced and provided.

Timo Longin (@timolongin), Clemens Stockenreitne, on sec-consult.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, the DNS resolvers used static UDP source ports instead of random ones, reducing the entropy needed to spoof DNS responses.

Impact

An attacker could redirect email and other network traffic, potentially leading to account takeovers and system compromise, though the attack requires guessing the DNS ID and source port.

What the attacker needed

Ability to send emails to victim domain; vulnerable closed DNS resolver with static source ports; attacker controls an authoritative nameserver

The fix

DNS resolvers should use random source ports and implement DNSSEC to prevent cache poisoning.

How it was found

  1. Send an email from a domain like [redacted] to a victim domain.
  2. The victim's email server queries its DNS resolver for SPF, DKIM, and DMARC records.
  3. The resolver contacts the analysis authoritative nameserver for the analysis domain.
  4. Analyze the DNS traffic to determine if the resolver uses static source ports.
  5. If static, perform a Kaminsky attack by racing spoofed DNS responses.
  6. Poison the DNS cache to redirect email or other services.

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.

DNS resolvers translate website names into IP addresses. If an attacker can trick a resolver into accepting fake DNS answers, they can redirect traffic to their own servers. This report found many such resolvers that were easy to trick because they used predictable source ports.

What is Cache bugs?

A cache and the origin disagree about a request, so a poisoned response is served to everyone or a private page is stored as public.

Similar reports

View all

Same bug class and techniques, clearest first.

Web cache poisoning and deception

The lesson behind this report.

A cache and the origin disagree about a request, so a poisoned response is served to everyone or a private page is stored as public.