First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 78256
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Gentoo Security <security@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Florian Westphal <westphal@foo.fh-furtwangen.de>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:
Flags: Requestee:
 
 
  ()

Filename Description Type Creator Created Size Actions
cmd5checkpw-0.22-seteuid.patch cmd5checkpw: set euid to uid of calling user patch Florian Westphal 2005-01-16 11:37 0000 931 bytes Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 78256 depends on: Show dependency tree
Bug 78256 blocks:

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2005-01-16 11:34 0000
net-mail/cmd5checkpw is installed setuid cmd5checkpw, but it does not drop
privileges before calling execvp(), i.e. the invoked program retains the
cmd5checkpw euid. Local users that know at least one valid
/etc/poppasswd user/password combination can read the /etc/poppasswd file.

Reproducible: Always
Steps to Reproduce:
1. emerge net-mail/cmd5checkwp
2. create /etc/poppasswd to contain:
user:pass
secret:secret
3:
$ id
uid=1001(fw) gid=100(users) groups=5(tty),10(wheel),16(cron),100(users)
$ perl -e 'print("user\0pass\0\pass\0");' > test
$ 3<test
$ /bin/cmd5checkpw id
uid=1001(fw) gid=100(users) euid=1000(cmd5checkpw) 
[..]

Actual Results:  
user obtains euid=1000(cmd5checkpw).

Expected Results:  
Drop euid before execvp().

If cmd5checkpw really needs to be setuid, it should set its effective uid to
that the real uid of the calling process. I'll add a patch to do this, but
i'd prefer cmd5checkpw to not be setuid (this might break things though)

------- Comment #1 From Florian Westphal 2005-01-16 11:37:10 0000 -------
Created an attachment (id=48674) [details]
cmd5checkpw: set euid to uid of calling user

------- Comment #2 From Thierry Carrez (RETIRED) 2005-01-16 11:48:16 0000 -------
net-mail herd, please comment (on the need to be SUID and on the patch)
Florian: did you try to contact upstream yet ?

------- Comment #3 From Florian Westphal 2005-01-16 11:58:40 0000 -------
I emailed brush@elysium.pl about this a few minutes ago. (same Bugreport +
patch)
(I thought this was a Gentoo specific bug at first before seeing that upstream
docs suggest making cmd5checkpw setuid)

------- Comment #4 From Thierry Carrez (RETIRED) 2005-01-27 07:12:34 0000 -------
Reassigning this as a vulnerability, since it's a clear local information leak.
Florian: any answer from upstream ?

------- Comment #5 From Florian Westphal 2005-01-27 08:55:35 0000 -------
No reply from upstream until now.
The last 'news' item on the project homepage is dated 09.10.2000...

------- Comment #6 From Thierry Carrez (RETIRED) 2005-01-27 08:59:48 0000 -------
net-mail: please comment.
Can cmd5checkwp not be setuid ? If not, what do you think of the patch ?

------- Comment #7 From Michael Hanselmann (hansmi) (RETIRED) 2005-01-27 10:55:24 0000 -------
langthang asked me to comment on this bug. There we go.

Quoting the manpage of cmd5checkpw:
FILES
    /etc/poppasswd - this file contains pairs  of  logins  and  clear  text
    passwords separated by ":". It looks like this:

    login1:password1
    login2:password2

    Best  way  to  protect  it is to make it readable only for one specific
    user different than you normal system users and make  cmd5checkpw  suid
    that user.

Therefore, I would say that cmd5checkpw has to be setuid if /etc/poppasswd is only readable by a specific user. But I also think that dropping the effective uid wouldn't hurt. If nobody else (robbat2?) sees a problem in here, we should apply the patch.

------- Comment #8 From Michael Hanselmann (hansmi) (RETIRED) 2005-01-27 11:12:57 0000 -------
Robin, what do you think about this patch? Can we apply it?

------- Comment #9 From Thierry Carrez (RETIRED) 2005-02-04 06:02:00 0000 -------
Upstream looks dead...
net-mail: please apply the patch or drop the package.

------- Comment #10 From Michael Hanselmann (hansmi) (RETIRED) 2005-02-13 04:24:50 0000 -------
The patch is now applied to cmd5checkpw-0.22-r2. The ebuild is currently in
~ARCH for testing. Please test it and comment on this bug again. Then we'll
make a stabilization request to all affected architectures.

------- Comment #11 From Sune Kloppenborg Jeppesen 2005-02-13 04:46:05 0000 -------
Thx Micheal, reopening for stable marking.

Arches please test and mark cmd5checkpw-0.22-r2 stable.

------- Comment #12 From Olivier Crete 2005-02-13 12:49:52 0000 -------
x86 stable

------- Comment #13 From Michael Hanselmann (hansmi) (RETIRED) 2005-02-13 14:26:11 0000 -------
Stable on ppc and hppa.

------- Comment #14 From Bryan Østergaard (RETIRED) 2005-02-13 14:57:50 0000 -------
Stable on alpha.

------- Comment #15 From Gustavo Zacarias (RETIRED) 2005-02-14 05:47:36 0000 -------
sparc stable.

------- Comment #16 From Mike Doty 2005-02-14 06:53:44 0000 -------
how is this being tested?(noone on amd64 apparently uses it)

------- Comment #17 From Thierry Carrez (RETIRED) 2005-02-15 01:30:14 0000 -------
Mike: I am not a cmd5checkpw user but it looks like a password changing system
that will access a /etc/poppasswd (owned by the cmd5checkpw user and
-rw-------). 

Try creating a /etc/poppasswd file with pairs of logins and clear text
passwords like this :

    login1:password1

And validate you can change the password as a regular user. You can also
vamidate that the exploit in bug description is no longer working.

------- Comment #18 From Hardave Riar (RETIRED) 2005-02-18 10:59:51 0000 -------
Stable on mips.

------- Comment #19 From Mike Doty 2005-02-19 08:01:35 0000 -------
stable on amd64

------- Comment #20 From Matthias Geerdsen 2005-02-21 02:09:38 0000 -------
security, pls vote on GLSA need

------- Comment #21 From Luke Macken (RETIRED) 2005-02-23 18:39:15 0000 -------
I vote no glsa, please feel free to disagree ;)

------- Comment #22 From Thierry Carrez (RETIRED) 2005-02-24 02:05:04 0000 -------
Local users can get plaintext POP passwords for their coworkers... I vote yes.

------- Comment #23 From Matthias Geerdsen 2005-02-24 03:25:48 0000 -------
not absolutely necessary, but a GLSA on this might be a good idea

voting for one

------- Comment #24 From Thierry Carrez (RETIRED) 2005-02-25 13:32:50 0000 -------
GLSA 200502-30
arm should park stable to benefit from GLSA

First Last Prev Next    No search results available      Search page      Enter new bug