OpenSSH Local Root Hole
maelstrom writes: "Looks like someone's found a local root exploit for OpenSSH versions between 2.0 and 3.0.2. Seems as though its a one-off error, there is no public exploit, but there is sure to be one shortly. They aren't ruling out remote exploit. Recommending patching and upgrading ASAP."
So when does 3.1p (portable -- for other OS's) become available?
Ummm, RTFP!
It's a LOCAL exploit. You have to be logged in to exploit it.
--- I wish I could hear the soundtrack to my life. That way I'd know when to duck.
One-off: Something done intentionally but with no intention of repeating; a custom product, sample, or prototype.
Off-by-one error: An error in enumeration, such as starting or ending a count at the wrong value (e.g. 0 vs. 1), counting the starting/ending value in a cycle twice or not at all (e.g. in counting a group of people which includes yourself), counting delimiters as opposed to the items delimited (e.g. the "fence post" problem), or any analogous error.
These are rather different! When I read the abstract my first thought was "how can they determine that?"
-- MarkusQ
Here is what can be found on their web site:
"OpenSSH 3.1 released March 7, 2002."
Hmmm... That was quick! Especially since the advisory reads:
Pine Internet Security Advisory
Advisory ID : PINE-CERT-20020301
Authors : Joost Pol
Issue date : 2002-03-07
Application : OpenSSH
Version(s) : All versions between 2.0 and 3.0.2
Pretty good job.
The right to offend is far more important than the right not to be offended. (Rowan Atkinson)
For you guys too lazy to read:t xt
http://www.pine.nl/advisories/pine-cert-20020301.
( I was going to post the patch here, it's really small, but apparently slashcode doesn't know what the blockquote tag is for, despite claiming it's supported)
But this isn't just an attempt at karma whoring, there is a point. When a single missing '=' can cause a root exploit in code that's generally considered well-written, who are these people that actually entertain the idea that Microsoft secured their software over the last month?
My God, it's Full of Source!
OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
You must be a troll, but for the benefit of others, OpenBSD doesn't install telnetd, named, or sendmail by default.
Now this is public knowledge, an exploit will be available within hours.
You do not know what you are talking about. Full disclosure has greatly improved security awareness and turn around time for fixes. If you want to turn your back on full disclosure, you are heading back into the middle-ages of computer security.
This should have been fixed before it was announced, and a period of time waited for people to upgrade.
The information was leaked by someone who jumped the gun. That is the reason why the relase and advisory happened today instead of Monday. Nothing to be done about it. Instead of bitching, fix a bug in your operating system and send a patch to the developers. Much more useful behaviour for all of us.
Of course, you should be running with ln -s AJ /etc/malloc.conf
anyway. It will fill freed memory with junk,
and quite often finds conditions where memory
is referenced after it has been freed.
In that case, there is no problem anyway. If your operating system of choice has not support for malloc debugging, looby
your developers, it is a very useful feature.
OpenSSH 3.1 was released this morning. The info and tarball for OpenBSD systems is available at:
http://www.openssh.com/openbsd.html
Mine's compiling now.
--saint
Help yourselves:
http://www.geniusweb.com/RPMS/
SSH 3.1p1 RPM's compiled without gnome-askpass, everything else is default vanilla.
My poetry site welcomes the unusual.
Unfortunately, I can't post the advisory here due to the lame lameness filter. But here are the patches:
S A- 02:13/openssh.patche eBSD/CERT/patches/SA- 02:13/openssh.patch.asc
/usr/src /path/to/sshd.patch /usr/src/secure/lib/libssh /usr/src/secure/usr.sbin/sshd /usr/src/secure/usr.bin/ssh
0 +c urrent/freebsd-announce
ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/
ftp://ftp.FreeBSD.org/pub/Fr
Execute the following commands as root:
# cd
# patch <
# cd
# make depend && make all
# cd
# make depend && make all install
# cd
# make depend && make all install
If you've got the ssh port installed, check out the advisory for details on what to do:
http://docs.freebsd.org/cgi/getmsg.cgi?fetch=0+
If you look further down in the patch, it then references an array with offset 'id'. In a language like Java this would throw an ArrayIndexOutOfBounds exception, NOT read random memory and possibly cause a crash.
So in fact a stricter language would fix this problem.
Two weeks ago my Mandrake box, connected to a cable modem, was rooted. The only port open to eth0 was ssh (openssh-3.0.2p1). I analyzed the logs and they indicated someone had spent an hour trying to exploit various SSH bugs that have been fixed in the past. Then there was an 8 minute pause before "linsniffer" was installed and eth0 went into "promiscuous mode".
I haven't been able to verify openssh-3.0.2p1 was truly the cause, but it seems likely. This may have been the remote root exploit which the advisory "does not rule out".
Known to work on Solaris, OpenBSD, and Linux. YMMV elsewhere, but it should work fine.
1) Use SSH to log into your server.
2) Install the new ssh version. Your old version is in memory, so replacing the binary won't have any adverse effect on your connection.
3) Run 'ps -ef | grep sshd' or 'ps auxw | grep sshd' (depending on your UNIX flavor)
4) find the sshd instance with a parent process ID of '1' -- this will be the actual daemon spawend by init. The other process will be the one spawned by sshd itself to handle your connection.
5) kill
6) the parent sshd process will terminate, but yours will stay running
7) start up the new sshd
8) from another workstation or window telnet to port 22 on your server and verify that the version number reflects the new version.
9) from another workstatino or window, ssh into your server to make sure you still have access.
10) close your original ssh session
I've used this exact process to upgrade many machines at remote locations. As long as you verify that the new sshd is running before you close your existing connection, you should have no problems.
A hell of a lot.
(I'm in the webhosting business myself...)
Vince.
I need a sig.
Think back to the recent /bin/login CERT advisory. Telnet and the R-services use /bin/login. Telnet was, therefore, exploitable on many boxes.
If the same error existed in Commercial SSH, someone stole some code.
Not nesessarly true: OpenSSH and Commercial SSH have the same roots - http://www.openssh.com/history.html
Moneyed corporations, non-working 'poor' and criminal prisoners are turning productive citizens into tax-slaves.
Did you build the *portable* version (not the *BSD version?)
The portable version built cleanly and ran on both my Intel-based Linux system and my ancient MIPS-based Linux system. The *BSD version will not compile on Linux. Make sure you have the right version!
Oolite: Elite-like game. For Mac, Linux and Windows
Check your openssl version. You need 0.9.6
Ahem. Wrong. Linux is nice, it will keep the old version of the binary accessible for the running image as long as there are any, but e.g. SunOS doesn't do that. Modifying the binary will cause wrong code to be read from the disk whenever the OS reads the binary file again. This will happen for example when the code has been paged out from the main memory after which the program becomes active again and the OS loads the code of the process from the original binary. Try this:
cp /bin/cat foo ; ./foo
Hit ctrl-z to suspend the copy of cat, truncate the file:
echo > foo
and type
fg
to resume the copy of cat -> boom, segfault most likely unless the machine is very idle and not having paged out the code section of "foo" out.
The buildpkg.sh script in contrib/solaris looks for the version number on the last line of that file and cannot find it.
I'd submit a bug but I can't seem to get on bugzilla right now.
(lines preceeded by ">" are command prompt lines)
;) )
:
/usr/src/redhat/RPMS/i386
: /usr/lib/libcrypto.so.0 /usr/lib/libssl.so.0 /usr/lib/libcrypto.so /usr/lib/libcrypto.so.0 /usr/lib/libssl.so /usr/lib/libssl.so.0
;)
Get the latest source rpm for openssl (I used : openssl-0.9.6-3.src.rpm). It can be obtained from rpmfind.net
Get the latest source rpm for openssh (3.1p1
as root, do
> rpm --rebuilbd openssl-0.9.6-3.src.rpm
and let the system build
> cd
> rpm -Uvh --nodeps openssl-*
the nodeps is because two files called
"/usr/lib/libcrypto.so.0" and "/usr/lib/libssl.so.0" (not owned by any
RPMs) need to be properly relinked.
In order to do so, please do
> rm -f
> rm -f
> ln -s
> ln -s
note that until you do the next line, you can not use "ssh"
anymore (mismatch between the openssl version used by the previous
openssh installation). Now to upgrade to the latest version of openssh
> rpm -Uvh openssh-*
note that files called "/etc/ssh/ssh_config.rpmnew" as well as
"/etc/ssh/sshd_config.rpmnew" will be created. They are the default
configuration files and will not replace your modified configuration
files
Hope this helps
-- Martial MICHEL