3 ms·
I respectfully disagree. First, as an engineering matter, the attacker will almost always be able to run more requests. A difference of 2x, 5x, or 100x just m
by patio11 16y ago
I respectfully disagree. First, as an engineering matter, the attacker will almost always be able to run more requests. A difference of 2x, 5x, or 100x just means they have to add more bots to the botnet or another second, hour, day, week, whatever to their exploitation timetable. Computers count to big numbers. It is what they do best.
Second, the attacker can circumvent this by getting a better networking position to conduct their measurements from: your "added random noise" is almost certainly not bigger than the difference between local network access and Internet access.
Local access can be had trivially in many deployments for $20 paid with a prepaid or stolen credit card: "Hi Slicehost, I'd like to buy a slice. I was inspired by a company you host who I really admire and would like to learn more about."
More broadly, I think we have a communication challenge: as soon as we say "If you do X, this makes it safer", people who do not understand either the threat model or the proposed mitigation will hear "Doing X implies safe. Ops: do X. Great, issue averted, I can go to the golf course." What we should instead be saying is "No, X does not help. Burn it with fire.", because this will not compromise our ability to get actual solutions rather than just mostly ineffective palliatives.
P.S. Since you don't have an attacker's view of the situation, you cannot calculate how ineffective your palliative is until after they own you. That is not desirable.
- _delirium 16y agoOh, I'm perfectly fine with advising people not to do it. I just think it's incorrect to say "does not help", unless you have a very specific definition where "help" means "solve", as opposed to "makes it somewhat more difficult for attackers, which may stop some but probably not all or even most". Sort of like saying that changing your ssh port "doesn't help"; botnets can of course portscan too, but changing your ssh port increases the work they have to do, and in practice means that opportunistic attacks skip you (targeted attacks may still portscan you, of course). The multiples might be quite a bit larger than 100x, I think. For example, if as you suggest an attacker has managed to get themselves on your LAN with very low-noise access, say 1ms stddev, then adding random sleeps with a stddev of 500ms causes a 250,000x increase in the number of samples they need, at the cost of making your site a bit sluggish.
- tptacek 16y agoRead the Crosby & Wallach paper (after reading Nate's article) here: http://rdist.root.org/2010/01/07/timing-independent-array-comparison/ http://rdist.root.org/2010/01/07/timing-independent-array-co... I've been following your comments and I think you need to recalibrate your expectations about timing accuracy. That said: you're right: you can add random sleeps to increase the number of measurements attackers need to take. But I don't think you can reasonably add enough delay to make the attack infeasible (where "infeasible", as always, means "not worth conducting"). In Crosby & Wallach, you'll see that there's also an arms race brewing between defenders who hope to add noise to confound exploits, and attackers deploying signal processing techniques to see through that noise with fewer measurements. A more reasonable "half-assed" countermeasure would be to rig something up that notices invalid tokens, and re-key after a threshold.
- dev360 16y agoJust out of curiousity, I wanted to know what you think.. I realize that the problem is that the PKCS padding exception is timeable. Please correct me if this is naive, but what if I devised some code that did either of the following: 1. decrypt the string; if a padding exception occurs, then run a decrypt of a string the same size with correct padding. do not throw an error. 2. decrypt the string; if a padding exception does not occur, then run some instructions on a string with the same size and incorrect padding, forcing a padding error. In both 1 & 2, we do not throw any visible errors to the user. Wouldn't this at least shrink the measurable difference significantly by ensuring that the instruction set is always going to be the same, and hopefully average out closer to a constant time, regardless of whether an error "occurs"?