On July 30, 2014, the Tor Project published a security advisory with an unusually direct title: "Tor security advisory: relay early traffic confirmation attack". It said that a group of relays had joined the network on January 30 of that year, and that until they were removed on July 4 they had been trying to deanonymize people who ran or visited onion services. Anyone who had operated or used an onion service during those five months, the advisory said, should assume they were affected.
The relays were never officially attributed in that advisory. Within a year and a half, though, it became fairly clear whose they were and where the data went.
The relays
There were about 115 of them, all running from a narrow range of IP addresses and all advertising themselves as fast, stable relays suitable for use as guards and as HSDirs, the relays that store and serve onion service descriptors. That's a Sybil attack in its plainest form: one operator posing as many independent relays to get a large share of a particular role in the network. Together they made up something over six percent of the guard capacity at the time.
Having many relays isn't itself an attack. What made these different was what they did with a little-used feature of the Tor protocol.
What a RELAY_EARLY cell is
Tor traffic moves in fixed-size cells. One cell type, RELAY_EARLY, exists for a narrow defensive reason: when a client extends a circuit through additional hops, it uses RELAY_EARLY, and relays limit how many of them a circuit can carry. That stops an attacker from building absurdly long circuits through the network to amplify load. In normal operation, RELAY_EARLY cells only travel outward, from the client toward the circuit's far end.
The attacking relays broke that assumption. When one of them was acting as an HSDir and a client came to fetch an onion service's descriptor, the relay would send back a sequence of RELAY_EARLY and RELAY cells along the circuit, toward the client. The pattern of the two cell types encoded the name of the onion service being looked up. Relays in the middle passed the cells along, because nothing in the protocol at the time told them not to.
If the same attacker also controlled the client's guard relay, the guard would see this pattern arriving on a circuit from a known IP address. Now the attacker knew that this particular IP address had looked up that particular onion service. The same trick could be used against onion services themselves, linking a service to the IP address of the machine hosting it, when the service published its descriptor through one of the attacking relays and its guard was also malicious.
This is a variant of traffic confirmation, the broader family described in Traffic Correlation Attacks Against Tor. Tor has never claimed to defend fully against an adversary who sees both ends of a circuit. What made this case alarming was the active tagging: the attacker didn't need statistics, just one circuit, and other attackers watching the network could in principle have read the signal too.
The cancelled Black Hat talk
A couple of weeks before the advisory, the Black Hat USA conference quietly pulled a scheduled talk called "You Don't Have to be the NSA to Break Tor: Deanonymizing Users on a Budget". The speakers were Alexander Volynkin and Michael McCord, from the CERT division of Carnegie Mellon University's Software Engineering Institute. The abstract had said they could deanonymize hundreds of thousands of Tor clients and thousands of hidden services within a couple of months using an investment of under $3,000. Black Hat said CMU's lawyers had asked for the talk to be withdrawn because the materials hadn't been approved for public release.
The Tor Project's advisory pointed to that research as the likely source of the attack, while stopping short of saying so outright. Roger Dingledine also made the point, more than once, that there were proper ways to do research on the live network, and this wasn't one of them. Users had been actually exposed, not simulated.
The data in court
In January 2015 the FBI arrested Brian Farrell in Seattle, alleging he was a senior staff member of Silk Road 2.0, which had been shut down in Operation Onymous. Court filings in his case said the FBI had identified his IP address through information from a "university-based research institute" obtained under subpoena.
In November 2015 the Tor Project publicly accused CMU of being that institute and said it had been told the FBI paid at least $1 million for the work. CMU issued a statement saying it had received a subpoena and that it was not paid for complying, without confirming or denying the details. In February 2016 a federal judge in Seattle, Richard Jones, ruled in the Farrell case that the source was in fact CMU's Software Engineering Institute, and also held that Farrell had no reasonable expectation of privacy in his IP address because he had disclosed it to strangers running Tor relays. Privacy groups criticised that reasoning heavily. Farrell pleaded guilty and was sentenced to eight years.
Fixes
The Tor releases issued with the advisory, 0.2.4.23 and 0.2.5.6-alpha, made clients close any circuit on which they received an inward RELAY_EARLY cell, which kills this particular signal. The project also moved to reduce how many guards each client used, from three to one, which shrinks the chance of picking a malicious one, and over time added detection for suspicious relay groups and a more formal process for removing them.
The episode also sharpened the research ethics debate around Tor. The project now publishes guidelines for researchers working on the live network, and there's a Tor Research Safety Board that reviews proposals. The underlying problem, that whoever controls enough relays can try things like this, hasn't gone away. That's a recurring theme in Sybil Attacks and Malicious Relays.