OpenBSD – sshd(8) split into multiple binaries
undeadly.org
undeadly.org
There is only one OpenSSH, and it is developed by the OpenBSD folks and used by everyone else.
But there surely are some features in either that are intentionally kept out of the other?
But the notification mechanism isn't really systemd specific, so maybe they can make use of it somehow for something, dunno.
* https://github.com/openssh/openssh-portable
Perhaps see specifically the "openbsd-compat" directory, otherwise I think the source tree is very close the the 'OpenBSD version':
* https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/
And from the article, looks like more to come.
(Presumably it reduces attack surface by getting exploits in the session out of the listener but does it have greater significance?)
OpenBSD appears to be taking a safe/conservative approach based on linking. More aggressive approaches have also been researched, where the pruning is driven by dynamic analysis, and applied using binary rewriting.
[1] https://en.wikipedia.org/wiki/Return-oriented_programming
Any place(s) one can read more about this research?
The best source for the history of the work are probably the OpenBSD mailing list archives and commit logs, but digging through that is slow and requires context.
[1] https://bibbase.org/network/publication/kroes-altinay-nash-n...
The idea appears something like this:
You have a very small TCP listener that probably that forks+execs per accepted connection. The reduced complexity of this piece makes it both easier to audit and harder to exploit.
* The per session binary only contains the code to handle authentication and authorization (and accounting) of a single connection and fork/exec() into the next stage.
* The listener could also re-exec() itself every so-and-so number of connection attempts to replace its image with a newly randomised instance of the same executable. This would limit the number of attempts an attacker has to reuse any information learned about the current listener process's memory layout should such a leak be found.
The goal is to provide defense in depth instead of a single "magic bullet" e.g. rewriting it a "safe language" (trading new logic bugs in new code against memory safety bugs not yet found in old code). Splitting the OpenSSH server into multiple smaller processes also allows existing mitigations (some of them OpenBSD specific) to become more effective.