Encrypted DNS -> Privacy? A Traffic Analysis Perspective

Sandra Deepthy Siby, Marc Juarez, Claudia Díaz, Narseo Vallina-Rodriguez, Carmela Troncoso

Introduction

DNS-over-TLS (DoT) and DNS-over-HTTPS (DoH) were introduced to secure the "phonebook of the internet" by encrypting queries that were previously sent in plaintext. While these protocols successfully hide the content of DNS requests from ISPs and third parties, they do not necessarily guarantee user privacy. This paper investigates whether the metadata of encrypted traffic—specifically packet sizes and timing—can be used to identify the websites a user visits.

DNS resolution architecture and the positioning of a passive adversary.

Methodology

Traditional website fingerprinting techniques often fail on DNS traffic due to its bursty and small-packet nature. To address this, the authors propose a novel approach using N-gram features derived from TLS record lengths and directional bursts (sequences of packets in the same direction). By capturing these specific request-response patterns, the researchers can create unique fingerprints for different websites.

These features are processed using a Random Forest classifier. The study assumes a passive adversary model: an eavesdropper positioned between the user and the DNS resolver who can observe the encrypted flow but cannot decrypt its contents.

Experimental Setup and Datasets

The researchers evaluated their approach using a massive, geographically diverse dataset. This included traces from Lausanne (LOC1), Leuven (LOC2), and Singapore (LOC3), as well as variations in infrastructure (Google vs. Cloudflare resolvers) and client platforms (Desktop vs. Raspberry Pi). The primary dataset consisted of 1,500 top-tier webpages, with 200 samples each, providing a robust baseline for testing classification accuracy.

Key Results

The n-gram classifier demonstrated remarkable efficacy in identifying user activity through encrypted DNS traffic.

Precision-Recall performance of the n-grams classifier compared to a random baseline.

Major Findings:

  • High Accuracy: In a closed-world scenario, the classifier achieved an F1-score of ~0.90. Even in a more realistic "open world" setting, it maintained a high Area Under the Curve (AUC) of 0.81.
  • The "4th Packet" Leak: Many DoH implementations leak information via the fourth packet of a stream, which often contains the initial DNS query. Without padding, the size of this packet correlates directly with the domain name length.
  • Scalability for Attackers: DNS traces are significantly smaller than full web traces (12KB vs 1.8MB). This allows an adversary to monitor millions of users with 124x less storage and processing power than traditional web traffic analysis requires.
  • Ineffectiveness of Standard Padding: Standardized EDNS0 padding (128 or 468 bytes) was found to be insufficient. While it reduced accuracy, the classifier still achieved an F1-score of 0.69 with 128-byte padding.

Discussion and Conclusion

The study reveals a significant privacy gap in current encrypted DNS implementations. Interestingly, the researchers found that Tor provides excellent defense against these attacks; because DNS packets are small, they fit into constant-size Tor cells, effectively erasing unique size-based fingerprints.

To truly achieve privacy, the authors suggest that DoH/DoT clients should adopt strategies similar to Tor—such as sending constant-size packets—to mitigate the risks of traffic analysis. This research has already begun influencing industry standards, prompting providers like Cloudflare to implement more robust padding schemes.

Summary updated

BibTeX
@inproceedings{siby2020encrypted,
  author = {Sandra Deepthy Siby and Marc Juarez and Claudia Díaz and Narseo Vallina-Rodriguez and Carmela Troncoso},
  title = {{Encrypted DNS -> Privacy? A Traffic Analysis Perspective}},
  booktitle = {NDSS},
  year = {2020},
}
Figure