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

Filename Description Type Creator Created Size Actions
ssl-cert.eclass.diff Proposed patch for docert() patch Ulrich Müller 2007-12-01 23:50 0000 1.70 KB Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 174759 depends on: 201671 201672 201673 201675 201677 201678 201682 201684 201686 201687 201689 201690 201691 201896 201897 Show dependency tree
Bug 174759 blocks: 197881

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: 2007-04-16 08:27 0000
In the ssl-cert.eclass, the docert function generates an SSL key, along with an
SSL certificate.

If the docert function is used inside src_compile or src_install (see
openldap-2.3.3[45]* for example), the SSL key is then included inside the
binpkg, where it is NOT protected - anybody with access to the system can
extract the tarball to recover the key.

Additionally, if the binpkg is used on multiple machines, they will be
configured with the same SSL key and cert, and this may prevent correct
functioning of some SSL applications.

------- Comment #1 From Sune Kloppenborg Jeppesen 2007-04-16 08:46:59 0000 -------
vapier/agriffis please advise.

------- Comment #2 From Sune Kloppenborg Jeppesen 2007-05-02 11:17:05 0000 -------
vapier/agriffis please advise.

------- Comment #3 From Sune Kloppenborg Jeppesen 2007-05-20 07:22:28 0000 -------
vapier/agriffis please advise.

------- Comment #4 From SpanKY 2007-05-20 09:05:29 0000 -------
Robin's analysis of the situation is correct ... this is the same reason we
stopped managing things like /etc/shadow in baselayout's src_install function
...

docert() should be rewritten to only allow it to be run inside of pkg_preinst()

ive never touched that eclass before, so ...

------- Comment #5 From SpanKY 2007-07-23 01:01:53 0000 -------
i'd say with the recent changes portage has seen, this should be fixed now

------- Comment #6 From Robin Johnson 2007-07-24 07:49:33 0000 -------
spanky: could you clarify which changes you are talking about?

------- Comment #7 From Pierre-Yves Rofes 2007-08-21 14:32:13 0000 -------
someone just posted on this issue on the -dev mailing-list, maybe we should
make it public now. Any opinions?

------- Comment #8 From Robin Johnson 2007-08-21 20:33:22 0000 -------
As the original reporter, I say open it, so that we can get some traction in
getting it fixed all over the tree.

The only things needing nuking are public tinderboxes.

------- Comment #9 From Sune Kloppenborg Jeppesen 2007-08-21 20:42:11 0000 -------
Opening.

------- Comment #10 From SpanKY 2007-08-21 23:04:36 0000 -------
sorry, i was thinking in terms of "binpkgs being world readable" and "portage
doesnt consume /etc by default with quickpkg and friends" ... but the use case
here doesnt fully apply (packages generating unique keys on each host), so the
proposed route of pkg_postinst() is the only one i think

easy enough to add to the top of the docert() function:
case ${EBUILD_PHASE} in
    unpack|compile|test|install)  die "BOO";;
esac

------- Comment #11 From Ulrich Müller 2007-11-03 11:05:42 0000 -------
"docert" doesn't work inside pkg_postinst at the moment, probably related to
bug #197942.

------- Comment #12 From Ulrich Müller 2007-12-01 23:50:08 0000 -------
Created an attachment (id=137516) [details]
Proposed patch for docert()

- Check for ebuild phase as suggested in comment #10
- Install relative to ${ROOT} instead of ${D}${INSDESTTREE}
- Arguments must be a full path now

Maybe the function should also be renamed, since it's no longer similar to
other do* functions?

------- Comment #13 From Robin Johnson 2007-12-01 23:58:35 0000 -------
Patch looks good to me.

------- Comment #14 From Ulrich Müller 2007-12-02 00:19:25 0000 -------
The following packages will have to be changed then. They either call docert in
src_install and suffer from the security issue of this bug, or they call it in
pkg_postinst where it doesn't work at all (that is bug #197942).

src_install usage:
  app-admin/conserver
  mail-mta/postfix
  net-analyzer/sguil-server
  net-firewall/nufw
  net-ftp/netkit-ftpd
  net-im/ejabberd
  net-irc/ptlink-ircd
  net-irc/unrealircd
  net-mail/cyrus-imapd
  net-mail/dovecot
  net-misc/stunnel
  net-nntp/inn

pkg_postinst usage:
  net-mail/cyrus-imspd
  net-nds/openldap
  www-servers/nginx

------- Comment #15 From Robert Buchholz 2007-12-04 01:02:21 0000 -------
Ulrich, how do you propose we proceed now? The commit can only be done if all
ebuilds (stable and unstable) are fixed for this?

Just open bugs and bug maintainers? Or would it be advisable to announce this
migration and change the ebuilds by ourselves?

------- Comment #16 From Robin Johnson 2007-12-04 01:13:37 0000 -------
unless I'm mistaken, the ones in pkg_postinst should just start to work after
applying this patch? And all the ebuilds should be converted to use the
functions in either postinst or config phases?

One patch review comment, in the loop commented with "# Check for previous
existence of generated files", we should probably check all 4 file suffixes
(.csr is not checked).

------- Comment #17 From Ulrich Müller 2007-12-04 07:12:33 0000 -------
(In reply to comment #15)
> Ulrich, how do you propose we proceed now? The commit can only be done if all
> ebuilds (stable and unstable) are fixed for this?

If we rename the function ("install_cert"?) we could add the new one, fix all
ebuilds and finally replace docert by a dummy (or remove it completely).

> Just open bugs and bug maintainers?

I would say yes.

(In reply to comment #16)
> unless I'm mistaken, the ones in pkg_postinst should just start to work after
> applying this patch?

Unfortunately they must be changed, too, since they rely on INSDESTTREE.

> we should probably check all 4 file suffixes (.csr is not checked).

It did not check for .csr before. I don't see a reason why it shouldn't,
though.

------- Comment #18 From Ulrich Müller 2007-12-07 22:58:26 0000 -------
Updated ssl-cert.eclass committed. Function "docert" has been copied to a new
function "install_cert", modified according to comment #12.

Adding package maintainers to CC, please fix your packages mentioned in comment
#14 to use "install_cert" in pkg_postinst or pkg_config. Since it is a security
issue, and we also want to get rid of the duplicate code in the eclass, I will
fix any remaining packages after 14 days.

"docert" will then be replaced by a dummy function that forcibly fails.

------- Comment #19 From Ulrich Müller 2007-12-08 10:42:50 0000 -------
net-misc/stunnel fixed, bug #197881.

------- Comment #20 From Ulrich Müller 2007-12-08 11:17:38 0000 -------
app-admin/conserver fixed (and bumped to 8.1.16) since it's maintainer-needed.

------- Comment #21 From Robert Buchholz 2007-12-08 14:35:19 0000 -------
Creating seperate bugs.

------- Comment #22 From Konstantin Arkhipov 2007-12-09 14:28:58 0000 -------
www-servers/nginx fixed.

------- Comment #23 From Ulrich Müller 2008-03-14 13:33:17 0000 -------
All packages on all supported arches are done.

Only mail-mta/postfix keywording on mips and stabilisation on arm/s390/sh (bug
201671) are still missing. After that, we can replace the docert function in
the eclass by a dummy.

------- Comment #24 From Robert Buchholz 2008-03-20 01:22:34 0000 -------
This was sent as GLSA 200803-30.

I'll leave this bug open until all packages are fixed and the eclass corrected.

------- Comment #25 From Ulrich Müller 2008-04-14 06:44:24 0000 -------
Eclass corrected: "docert" replaced by a dummy function.
All ebuilds that were affected by this issue have been removed from the tree.

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