[Paper Review] Spoiled Onions: Exposing Malicious Tor Exit Relays
This paper presents exitmap, a fast and modular scanner to detect malicious Tor exit relays conducting man-in-the-middle (MitM) attacks. Over four months, it identified 25 malicious or misconfigured relays, including coordinated attacks. The authors further propose a browser extension patch that verifies X.509 certificates across independent Tor circuits to detect HTTPS MitM attacks, significantly improving client security with open-source tools.
Several hundred Tor exit relays together push more than 1 GiB/s of network traffic. However, it is easy for exit relays to snoop and tamper with anonymised network traffic and as all relays are run by independent volunteers, not all of them are innocuous. In this paper, we seek to expose malicious exit relays and document their actions. First, we monitored the Tor network after developing a fast and modular exit relay scanner. We implemented several scanning modules for detecting common attacks and used them to probe all exit relays over a period of four months. We discovered numerous malicious exit relays engaging in different attacks. To reduce the attack surface users are exposed to, we further discuss the design and implementation of a browser extension patch which fetches and compares suspicious X.509 certificates over independent Tor circuits. Our work makes it possible to continuously monitor Tor exit relays. We are able to detect and thwart many man-in-the-middle attacks which makes the network safer for its users. All our code is available under a free license.
Motivation & Objective
- To detect and expose malicious Tor exit relays that perform man-in-the-middle (MitM) attacks on anonymized traffic.
- To reduce user exposure to MitM attacks by developing a tool to continuously monitor exit relays for common attack patterns.
- To design and implement a browser extension patch that verifies the authenticity of X.509 certificates by fetching them over multiple independent Tor circuits.
- To provide a practical, open-source solution that enhances end-user protection against HTTPS-based MitM attacks.
- To improve the overall security and trustworthiness of the Tor network through automated detection and user-level defense mechanisms.
Proposed method
- Developed exitmap, a flexible and fast scanner capable of probing all Tor exit relays for common MitM attacks.
- Implemented multiple scanning modules to detect traffic sniffing, DNS poisoning, and SSL-based attacks such as HTTPS MitM and sslstrip.
- Monitored all ~1,000 exit relays over a four-month period using exitmap to identify malicious behavior.
- Designed a browser extension patch that triggers when a self-signed certificate or certerror page is encountered.
- The patch re-fetches the X.509 certificate over a new, independent Tor circuit using SIGNAL NEWNYM to create a fresh circuit.
- Compares the SHA-1 fingerprint of the certificate from the original and independent circuits; if they differ, a potential MitM attack is flagged and the user is prompted to submit data anonymously to the Tor Project.
Experimental results
Research questions
- RQ1How prevalent are malicious or misconfigured Tor exit relays conducting active MitM attacks?
- RQ2Can a scalable and modular scanner detect a wide range of common MitM attacks on exit relays?
- RQ3To what extent can certificate comparison across independent Tor circuits detect HTTPS-based man-in-the-middle attacks?
- RQ4How effective is a client-side browser extension in identifying and alerting users to potential certificate-based MitM attacks?
- RQ5What are the limitations of such client-side detection in the presence of adversaries capable of controlling multiple exit relays or issuing valid certificates?
Key findings
- Over a four-month monitoring period, 25 exit relays were identified as either malicious or misconfigured, with the majority exhibiting coordinated attack behavior.
- The attackers actively attempted to remain undetected, suggesting deliberate obfuscation and stealth in their operations.
- The exitmap scanner successfully detected various MitM attacks, including traffic sniffing, DNS poisoning, and HTTPS-based attacks such as sslstrip.
- The browser extension patch was able to detect discrepancies in X.509 certificate fingerprints across independent Tor circuits, indicating potential HTTPS MitM attacks.
- False positives were rare, as the system only triggers on self-signed certificates or certerror pages, minimizing user noise.
- All source code, including exitmap and the browser extension patch, was released under a free license to enable community use and further development.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.