Counter-RAPTOR: Safeguarding Tor Against Active Routing Attacks

Yixin Sun, Anne Edmundson, Nick Feamster, Mung Chiang, Prateek Mittal

Abstract

Tor is vulnerable to network-level adversaries who can observe both ends of the communication to deanonymize users. Recent work has shown that Tor is susceptible to the previously unknown active BGP routing attacks, called RAPTOR attacks, which expose Tor users to more network-level adversaries. In this paper, we aim to mitigate and detect such active routing attacks against Tor. First, we present a new measurement study on the resilience of the Tor network to active BGP prefix attacks. We show that ASes with high Tor bandwidth can be less resilient to attacks than other ASes. Second, we present a new Tor guard relay selection algorithm that incorporates resilience of relays into consideration to proactively mitigate such attacks. We show that the algorithm successfully improves the security for Tor clients by up to 36% on average (up to 166% for certain clients). Finally, we build a live BGP monitoring system that can detect routing anomalies on the Tor network in real time by performing an AS origin check and novel detection analytics. Our monitoring system successfully detects simulated attacks that are modeled after multiple known attack types as well as a real-world hijack attack (performed by us), while having low false positive rates.

Introduction

The Tor network provides anonymity through layered encryption, but it faces a significant "network-level" challenge. If an adversary can observe both the entry point (guard relay) and the exit point of a Tor circuit, they can perform traffic correlation attacks—matching packet timing and sizes—to deanonymize the user. While early research focused on passive adversaries, the emergence of RAPTOR attacks demonstrated that malicious Autonomous Systems (ASes) can use active BGP hijacking or interception to intentionally pull Tor traffic through their infrastructure. Current Tor relay selection algorithms prioritize high bandwidth but largely ignore BGP-level vulnerabilities. This paper introduces Counter-RAPTOR, a framework designed to address this lack of BGP-awareness through proactive relay selection and reactive monitoring.

The Bandwidth-Resilience Paradox

A key contribution of this work is a measurement study on the resilience of the Tor network to active BGP prefix attacks. By adapting AS-resilience metrics to the Tor ecosystem, the researchers uncovered a critical "Bandwidth-Resilience Paradox."

ASes that contribute the most bandwidth to the Tor network, such as OVH, often exhibit lower hijack resilience. These networks are frequently "stub" or near-stub networks with numerous providers and peers but few customers. This topological position makes it easier for external attackers to hijack their prefixes compared to more centrally located, well-connected ASes.

Figure 2: Tor Bandwidth per AS vs. Hijack Resilience. High-bandwidth ASes like OVH (AS16276) show relatively low resilience scores (~0.4).

Proactive Defense: Counter-RAPTOR Guard Selection

To mitigate these risks, the authors proposed a new guard relay selection algorithm. Unlike the "Vanilla" Tor implementation that prioritizes bandwidth, Counter-RAPTOR incorporates a resilience score $R(i)$ for each relay.

The algorithm uses a tunable parameter ($\alpha$) to balance security and performance. To prevent "fingerprinting" attacks—where a client's unique relay preferences might reveal their location—the system employs Tille’s algorithm for unequal probability sampling. This ensures that while more resilient relays are preferred, the selection process remains sufficiently randomized.

Figure 4: CDF of Hijack Resilience from All Source ASes (a) and Top Client ASes (b). The Weighted Resilience (Counter-RAPTOR) significantly outperforms selecting the top Tor ASes by bandwidth.

Reactive Defense: Live BGP Monitoring

Complementing the proactive selection is a reactive monitoring system. This system ingests live BGP updates from BGPStream and applies three primary detection analytics:

  1. Origin AS Check: Verifying that the AS announcing a prefix is the legitimate owner.
  2. Frequency Analytic: Flagging ASes that rarely announce a specific prefix, which can indicate a hijack.
  3. Time Analytic: Identifying short-lived announcements typical of malicious routing changes.

Key Results and Evaluation

The Counter-RAPTOR framework was evaluated using Tor consensus data, CAIDA AS topologies, and the Shadow network emulator.

  • Security Gains: The selection algorithm improved hijack resilience by 36% on average, with some clients experiencing gains up to 166%.
  • Performance: Shadow emulator tests confirmed that the security improvements come with minimal performance loss for common download sizes (320KB and 5MB).
  • Detection Accuracy: The monitoring system achieved a false positive rate of only 0.19% and successfully detected 100% of simulated attacks, as well as a real-world hijack performed on the PEERING testbed.

Conclusion and Future Work

Counter-RAPTOR demonstrates that BGP-aware relay selection can significantly enhance Tor's security against active routing attacks without compromising performance. However, challenges remain. Resilience calculations currently rely on BGP path inference, which can be imprecise due to the opaque nature of real-world routing policies. Future work will focus on refining these path predictions and developing more robust monitoring analytics to counter strategic adversarial adaptations.

Summary updated

Abstract

Tor is vulnerable to network-level adversaries who can observe both ends of the communication to deanonymize users. Recent work has shown that Tor is susceptible to the previously unknown active BGP routing attacks, called RAPTOR attacks, which expose Tor users to more network-level adversaries. In this paper, we aim to mitigate and detect such active routing attacks against Tor. First, we present a new measurement study on the resilience of the Tor network to active BGP prefix attacks. We show that ASes with high Tor bandwidth can be less resilient to attacks than other ASes. Second, we present a new Tor guard relay selection algorithm that incorporates resilience of relays into consideration to proactively mitigate such attacks. We show that the algorithm successfully improves the security for Tor clients by up to 36% on average (up to 166% for certain clients). Finally, we build a live BGP monitoring system that can detect routing anomalies on the Tor network in real time by performing an AS origin check and novel detection analytics. Our monitoring system successfully detects simulated attacks that are modeled after multiple known attack types as well as a real-world hijack attack (performed by us), while having low false positive rates.
BibTeX
@inproceedings{sun2017counter,
  author = {Yixin Sun and Anne Edmundson and Nick Feamster and Mung Chiang and Prateek Mittal},
  title = {{Counter-RAPTOR: Safeguarding Tor Against Active Routing Attacks}},
  booktitle = {IEEE Symposium on Security and Privacy},
  year = {2017},
  url = {https://openreview.net/forum?id=sP_ashU1Fx},
}
Figure