Date: Mon, 9 Oct 2006 12:33:05 +0200 (CEST)
From: Marco Ivaldi <raptor@0xdeadbeef.info.>
To: [email protected]Subject: yet another OpenSSH timing leak?
Message-ID: <Pine.BSO.4.63.0609301537050.27887@shinobi.blackhats.it.>
MIME-Version: 1.0
Content-Type: MULTIPART/MIXED; BOUNDARY="0-1802798359-1160125053=:32486"
Content-ID: <Pine.BSO.4.63.0610061558220.3691@shinobi.blackhats.it.>
X-Virus-Scanned: antivirus-gw at tyumen.ru
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
--0-1802798359-1160125053=:32486
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII; FORMAT=flowed
Content-ID: <Pine.BSO.4.63.0610061558221.3691@shinobi.blackhats.it.>
Hello Bugtraq,
Here we are again... During a recent penetration test i stumbled upon yet
another OpenSSH timing leak, leading to remote disclosure of valid
usernames. It's not as big as the one i found in the past (CVE-2003-0190),
but it can indeed be exploited over the Internet, nevertheless.
This time, OpenSSH-portable apparently introduces a small delay (see
attached transcript for details) when verifying access credentials for
users with a password set: it doesn't matter if they don't have a valid
shell or login has been disabled through an sshd_config directive.
So far, i've not been able to determine the root cause of this exposure
and i've reproduced it only on some fully-patched SUSE Linux 10.0 boxes
(OpenSSH_4.1 + SUSE patches, both protocols 1 and 2 are affected, with or
without PAM authentication), therefore it may be a SUSE-specific and/or a
configuration-dependant flaw (latest tests on some freshly installed SUSE
systems didn't show the flawed behaviour).
That said, there are probably other timing leaks involving third-party
patches (x509 certs, LDAP, and so on), logging, and custom configurations,
as well as other ways in which valid usernames may be probed for (i.e.,
with RSA/DSA authentication) -- thus i decided to release a small script
for testing timing patterns in sshd replies:
http://www.0xdeadbeef.info/code/sshtime
It needs expect, and target ssh hostkey must be already added. I'd be very
interested in knowing the results of tests performed on other distros and
configurations.
Thanks to Solar Designer and Andrea Barisani for the interesting
discussion on this topic.
Cheers,
--
Marco Ivaldi
Antifork Research, Inc. http://0xdeadbeef.info/
3B05 C9C5 A2DE C3D7 4233 0394 EF85 2008 DBFD B707
--0-1802798359-1160125053=:32486
Content-Type: TEXT/PLAIN; CHARSET=US-ASCII; NAME=yet-another-openssh-timing-leak.txt
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.BSO.4.63.0610061602300.3691@shinobi.blackhats.it.>
Content-Description:
Content-Disposition: ATTACHMENT; FILENAME=yet-another-openssh-timing-leak.txt
cmFwdG9yQHBhbmRvcmE6fiQgIw0KcmFwdG9yQHBhbmRvcmE6fiQgIyBPdmVy
IDEwMCBNYnBzIExBTiAoc2xvdyBjb21wdXRlcikNCnJhcHRvckBwYW5kb3Jh
On4kICMNCnJhcHRvckBwYW5kb3JhOn4kIC4vc3NodGltZSAyLm1lZGlhc2Vy
dmljZS5uZXQgc21hbGxkaWN0IA0KDQpzc2h0aW1lIHYwLjEgLSBTaW1wbGUg
T3BlblNTSCByZW1vdGUgdGltaW5nIGF0dGFjayB0b29sDQpDb3B5cmlnaHQg
KGMpIDIwMDYgTWFyY28gSXZhbGRpIDxyYXB0b3JAMHhkZWFkYmVlZi5pbmZv
Pg0KDQphZG1pbkAyLm1lZGlhc2VydmljZS5uZXQgICAgICAgICAgICAgIHJl
YWwgMC4xMw0KZnRwQDIubWVkaWFzZXJ2aWNlLm5ldCAgICAgICAgICAgICAg
ICByZWFsIDAuMTMNCm1lZGlhQDIubWVkaWFzZXJ2aWNlLm5ldCAgICAgICAg
ICAgICAgcmVhbCAwLjgwCTwtIHZhbGlkIHVzZXIgd2l0aCBzaGVsbA0Kbm9i
b2R5QDIubWVkaWFzZXJ2aWNlLm5ldCAgICAgICAgICAgICByZWFsIDAuMTMN
CnJhcHRvckAyLm1lZGlhc2VydmljZS5uZXQgICAgICAgICAgICAgcmVhbCAw
LjEzDQpyb290QDIubWVkaWFzZXJ2aWNlLm5ldCAgICAgICAgICAgICAgIHJl
YWwgMC43OQk8LSB2YWxpZCB1c2VyIHdpdGggc2hlbGwNCnRlc3RAMi5tZWRp
YXNlcnZp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