In legacy/trac#6252 (moved) we noted that a client can send sendme cells preemptively to the exit relay, thus cheating on her circuit window (and getting more than her fair share of throughput). We fixed it at the exit relay (now it checks if the window is higher than it's allowed to be), but we didn't fix it at other relays in the circuit -- so she can still send a sendme after the cells have been packaged by the exit relay, but before they've made it all the way to the client, and do a more subtle version of cheating. This one's trickier to execute, but still worth fixing because it opens up all the issues that we thought we'd closed in legacy/trac#6252 (moved).
Reported by Rob Jansen and Florian Tschorsch.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items ...
Show closed items
Linked items 0
Link issues together to show that they're related.
Learn more.
Simple answer is for intermediate nodes, especially the entry guard, to check if they ever see a set of cells that's bigger than the circuit window should allow. If so, kill the circuit.
(We might want to check a slightly higher number, like 1100, to leave some allowance for future design changes, and to leave some tolerance in case there are bugs -- we see (infrequent) warnings in relay logs about the legacy/trac#6252 (moved) fix, perhaps by non-conformant relays but who knows.)
Damon suggested an "authenticated sendme" design -- the sendme payload has to prove receipt of all the cells in the window, else it's not accepted. That would be a good way to avoid the third version of this bug, whatever it will turn out to be.
But it also requires some more design work, since you'd need to put randomness into the flow somewhere so the client can't just preemptively come up with the answer. Or some other smart idea.
(We might want to check a slightly higher number, like 1100, to leave some allowance for future design changes, and to leave some tolerance in case there are bugs -- we see (infrequent) warnings in relay logs about the legacy/trac#6252 (moved) fix, perhaps by non-conformant relays but who knows.)
Oops -- we forgot about the leaky pipe topology. We should probably raise this number to 2000, to let us do things like 'adding padding cells from intermediate hops'. And we'll want a spec change, since we're disallowing behaviors that our spec used to allow.
Branch "bug9063_redux_023" in my public repository has a sketch implementation of "algorithm 1" from legacy/trac#9072 (moved). It's not ideal, but it could work. Please review?
(I'm not suggesting this as a permanent fix, but as a "good enough for now" fix for 0.2.3 and 0.2.4.)
Trac: Milestone: Tor: 0.2.5.x-final to Tor: 0.2.4.x-final Status: new to needs_review Keywords: N/Adeleted, tor-relay 023-backport added
I've added more to that branch, to make it more production ready. It's still "good enough for now", and at least as good as we thought the previous legacy/trac#9063 (moved) patch was, I think.
The bug9063_redux_023 branch looks okay; recommend testing it by running it as a relay for a while with an unnaturally low MaxMemInCellQueues setting to force some OOMs to occur.
Am I reading this right, that Tor 0.2.5.1-alpha is going to include commit 459aada4, and that the commit will cause intermediate relays to kill any circuit that has more than 1100 cells queued?