Vulnerability Development mailing list archives
BSD chfn bug
From: wilder () HQ ALERT SK (Pavol Luptak)
Date: Mon, 20 Dec 1999 15:37:24 +0100
My friend a long time ago found a hole in BSD chfn/chsh/chpass vulnerable in all versions FreeBSD 2.x - 4.0. I don't
find any possibility how this exploit. I think, readers of this mailing list will appreciate this.
When you run chfn (chfn/chsh/chpass is the same binary on FreeBSD), temporary file in /etc/pw.???? will touch, external
editor will be execute (env.variable $EDITOR) with uid of user running chfn. Edit your parameters, delete all
characters on the last line in the editor (Other information: entry). After this,
chfn will crash. No core dumped.
I have no time for better analysis. But, problem is in edit.c (function verify ()). Program crash at line 238:
/* Build the gecos field. */
len = strlen(list[E_NAME].save) + strlen(list[E_BPHONE].save) +
strlen(list[E_HPHONE].save) + strlen(list[E_LOCATE].save) +
strlen(list[E_OTHER].save) + 4;
if (!(p = malloc(len)))
err(1, NULL);
(void)sprintf(pw->pw_gecos = p, "%s,%s,%s,%s,%s", list[E_NAME].save,
list[E_LOCATE].save, list[E_BPHONE].save, list[E_HPHONE].save,
list[E_OTHER].save);
Entry list[E_OTHER].save will be set to NULL and strlen (NULL) will crash.
I try to overflow pw->gecos variable, but no sucess, because size of each entry could be MAX_LEN (2048 bytes). I think,
it could be the same problem as in cfingerd 1.4.0 gecos overflow.
When temporary file /etc/pw.????? with uid of user is created and chpass crash, there is no possibility how to
delete/create/rename this temporary file from /etc (no o+w access on /etc), but you can edit content of this file.
Could be this exploitable? :)
--
w.
. . o O o . . o O o . . o O o . . o O o . . o O o . . o O o . . o O o . .
. .
. wilder () hq alert sk PGP key: .
o wilder () spirit liquid sk (0~0) finger wilder o
o wilder () tlis sk -ooO--(_)--Ooo- TTT Talker: o
. luptakpa () decef elf stuba sk hq.alert.sk 5678 .
. .
. . o O o . . o O o . . o O o . . o O o . . o O o . . o O o . . o O o . .
<HR NOSHADE>
<UL>
<LI>application/pgp-signature attachment: stored
</UL>
Current thread:
- Idiocy "exploit" Roy Wilson (Dec 01)
- Re: Idiocy "exploit" Blue Boar (Dec 01)
- Re: Idiocy "exploit" Joel Eriksson (Dec 03)
- Owning privileged processes under UnixWare Tellier, Brock (Dec 06)
- Re: Owning privileged processes under UnixWare Elias Levy (Dec 06)
- Re: Owning privileged processes under UnixWare Blue Boar (Dec 07)
- rpcclient 2.0.5a crashed services.exe Blue Boar (Dec 13)
- Wireless LANs ? Sebastian Andersson (Dec 14)
- [Fwd: rpcclient 2.0.5a crashed services.exe] Blue Boar (Dec 15)
- BSD chfn bug Pavol Luptak (Dec 20)
- Re: BSD chfn bug Przemyslaw Frasunek (Dec 21)
- Re: BSD chfn bug Warner Losh (Dec 21)
- Re: BSD chfn bug Tellier, Brock (Dec 23)
- Re: BSD chfn bug Stanislav N. Vardomskiy (Dec 25)
- Re: BSD chfn bug Michal Zalewski (Jul 21)
- ssh quirks... Scott D. Yelich (Dec 26)
- Re: ssh quirks... Ryan Permeh (Dec 27)
- Re: ssh quirks... Scott D. Yelich (Dec 27)
- Re: ssh quirks... C.J. Oster (Dec 27)
- Re: ssh quirks... Blue Boar (Dec 27)
- Re: Idiocy "exploit" Blue Boar (Dec 01)
