How to defuse XZ Backdoor (or alike) in SSH Daemon
XZ Backdoor in SSH
Background
Someone planted a backdoor in XZ compression, which is believed to affect SSH. More details can be found. Although it was never shipped to production version of any distro. Even if you are using unaffected version I suggest you defuse any similar backdoors.
- https://www.openwall.com/lists/oss-security/2024/03/29/4
- https://news.ycombinator.com/item?id=39865810
- https://gist.github.com/thesamesam/223949d5a074ebc3dce9ee78baad9e27
- https://www.redhat.com/en/blog/urgent-security-alert-fedora-41-and-rawhide-users
The Kill Switch
The backdoor has a kill switch, it does not activate if it detects that someone is observing it (debugger attached...etc). An easy way to defuse the backdoor is to just define TERM environment variable causing the backdoor to think it's being observed and it would disable itself hopefully this is not specific to this backdoor but any similar one.
mkdir /etc/systemd/system/sshd.service.d/ echo -e "[Service]\nEnvironment=TERM=xterm" > /etc/systemd/system/sshd.service.d/10-xz-kill-switch.conf
Then you can restart your sshd
systemctl cat sshd systemctl restart sshd
NOTE: replace "sshd.service" with "ssh.service" for Debian/Ubuntu systems.
Why?
We got lucky and caught this one. We don't know all similar backdoors. The suspect have been contributing to many projects for more than 2.5+ years.
Quote
While not scaremongering, it is important to be clear that at this stage, we got lucky, and there may well be other effects of the infected liblzma.
Quote
There are concerns some other projects are affected (either by themselves or changes to other projects were made to facilitate the xz backdoor). I want to avoid a witch-hunt but listing some examples here which are already been linked widely to give some commentary.
Comments
Post a Comment