Open Source · · 2 days

OpenSSH tarballs shipped trojan horse

OpenSSH 3.2.2p1, 3.4p1, and 3.4 source archives on the OpenBSD FTP server were trojanized between July 30 and August 1, 2002, with copies possibly spreading through mirrors.

At the end of July 2002, source archives for OpenSSH were replaced on the OpenBSD FTP server and potentially propagated by the normal mirror network. The affected files were openssh-3.4p1.tar.gz, openssh-3.4.tgz, and openssh-3.2.2p1.tar.gz; the project replaced them with clean originals at 13:00 UTC on August 1.

The attacker changed source distribution, not the SSH protocol. The tainted archives carried bf-test.c, and a line appended to the all: target of openbsd-compat/Makefile.in compiled and ran it, so the payload fired at make rather than at configure. A system could be compromised by building OpenSSH even if it never deployed the resulting daemon.

The payload lived in bf-test.c and executed during the build, not when a running SSH daemon handled traffic. Once compiled, it attempted hourly outbound connections to an IRC-style port and could execute attacker-supplied commands as the build user. OpenSSH's own advisory treated any host that built the trojaned source as compromised, and CERT told mirrors, redistributors, and administrators to verify signatures and checksums rather than trusting timestamps or file sizes. CERT also recorded that the trojaned tarballs were not correctly signed, so a signature check would have failed; Conectiva was unaffected because it always verified the detached signature before building.

The detection path was ordinary package hygiene. Isosceles notes that FreeBSD ports already had expected checksums, so a developer building the tainted archive saw a mismatch. The short exposure window prevented broader compromise, but the attack showed that replacing source archives on trusted infrastructure was enough to reach high-value Unix systems.