OpenSSH Keystroke Obfuscation Bypass
crzphil.github.io
crzphil.github.io
https://www.openssh.com/releasenotes.html#9.8p1When the feature is missing, you're not safe from keystroke interception at all, which is what this bug is all about, so any 8.9 version would be actually considered "unsafe" until the whole feature is backported, which seems unlikely to happen?
On the openssh-unix-dev mailing list, someone recently pointed out[0] that just periodically (without jitter) sending out packets may be problematic due to subtle differences in clock timing. Aside, they also link to a presentation[1] [PDF] that shows influence of temperature on clock skew (especially page 18) and that this gives a possibility for fingerprinting.
Then there's the challenge of keeping SSH interactive enough that people do not experience too much input lag while typing. What if the user typed a character, but due to such a timing side-channel preventive measure, that character needs to be sent in the next packet, adding latency to the user experience? Surely it improves security, but it may add too much frustration for regular usage.
[0] https://marc.info/?l=openssh-unix-dev&m=169402700622936&w=2 [1] https://murdoch.is/talks/ccs06hotornot.pdf ([2006] Hot or Not: Revealing hidden services by their clock skew, see also https://doi.org/10.1145/1180405.1180410 and an HN thread from 2014: https://news.ycombinator.com/item?id=7694612)
If we're just focused on removing all traces of keystroke timing from the channel, then I think a decoupled SSH transport layer which is providing say 1kB of zero-pad every 20ms to the the shell to fill up, along with a FIFO to spread that out, and maybe some logic to ramp up and down the channel bandwidth based on queue length, you would go a long way to mitigating this specific attack.
Not exactly encouraging, to see a system so integral to security seemingly shipping code without even a minor test of intended function.
Or if you think it’s not important enough to do those assertions in CI, then it might be better to just reject the obfuscation attempts.
There’s no middleground: doing the implementation without checks, means you added complexity, you dont know if security improved (or worsened!), and the the release note might come down to a false sense of security.
All they need to do is retain the "chaff mode" but when they have a keystroke ready to be sent they should suppress the chaff that would otherwise go in the same packet.
No need for "basic jitter" or "dynamic payload size" that I can see, with this change the packets are indistinguishable in terms of size or (encrypted) content, and they have no more or less jitter than would be normal for the network they're traversing.
[Various small edits to clarify]
I did find it interesting that the return keystroke was of a differing size to other characters; on unix systems it should just send a ^J.
Edit: wanted to add that I recognize that the people working on OpenSSH know a lot more about this than I do, and I had assumed they wouldn't bother implementing this if it wasn't a good idea, so willing to accept that "proven correct" may be an overstatement or even flat-out wrong.
Actually it works perfectly and it's called a one-time pad!
In this case, as said above, it seems like there's an implementation issue with actually doing those obfuscations, allowing the signal to be identified.
EDIT: @tedunangst is right, wouldn't have helped. Even so, switch to keys!