<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>91426</bug_id>
          
          <creation_ts>2005-05-04 06:23 0000</creation_ts>
          <short_desc>mail-filter/amavisd-new insecure file permission</short_desc>
          <delta_ts>2005-05-12 05:46:52 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Security</product>
          <component>Vulnerabilities</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <status_whiteboard>B4 [noglsa] jaervosz</status_whiteboard>
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>zataz@zataz.net</reporter>
          <assigned_to>security@gentoo.org</assigned_to>
          <cc>antivirus@gentoo.org</cc>
    
    <cc>genone@gentoo.org</cc>
    
    <cc>net-mail@gentoo.org</cc>

      

      
          <long_desc isprivate="0">
            <who>zataz@zataz.net</who>
            <bug_when>2005-05-04 06:23:26 0000</bug_when>
            <thetext>Hello,

the file /etc/amavisd.conf has bad right.

If you use amavisd-new is compiled with mysql or postgresql this file shouldn&apos;t be other readable, they are sensitive informations in this file.

Maybe could be chown root:amavis amavisd.conf &amp;&amp; chmod 540 amavisd.conf

Also, this is possible that other importante file of amavis are readable or exectuble by all

Regards

Reproducible: Always
Steps to Reproduce:
1.
2.
3.

Actual Results:  
/etc/amavisd.conf readable by all

Expected Results:  
/etc/amavisd.conf shouldn&apos;t be readable by all

How to configure amavisd-new with mysql :

@lookup_sql_dsn =
   ( [&apos;DBI:mysql:maildb:host1&apos;, &apos;mail&apos;, &apos;very_secret_password&apos;]  );

(For clarity uncomment the default)
$sql_select_policy = &apos;SELECT *,users.id FROM users,policy&apos;.
   &apos; WHERE (users.policy_id=policy.id) AND (users.email IN (%k))&apos;.
   &apos; ORDER BY users.priority DESC&apos;;

(If you want sender white/blacklisting)
   $sql_select_white_black_list = &apos;SELECT wb FROM wblist,mailaddr&apos;.
     &apos; WHERE (wblist.rid=?) AND (wblist.sid=mailaddr.id)&apos;.
     &apos;   AND (mailaddr.email IN (%k))&apos;.
     &apos; ORDER BY mailaddr.priority DESC&apos;;</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ferdy@gentoo.org</who>
            <bug_when>2005-05-04 09:00:03 0000</bug_when>
            <thetext>Just in case you need net-mail advise, setting sane permissions on /etc/amavisd.conf shouldn&apos;t cause any problems. I don&apos;t know of other apps that need access to that file

Cheers,
Ferdy</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jaervosz@gentoo.org</who>
            <bug_when>2005-05-04 09:06:54 0000</bug_when>
            <thetext>Thx Ferdy, I don&apos;t need advise (this time), I need an updated ebuild:-)</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ticho@gentoo.org</who>
            <bug_when>2005-05-04 11:56:13 0000</bug_when>
            <thetext>Ok, 2.2.1-r2 (latest stable on multiple arches) has been committed to fix this - 0640 permissions are now being used for /etc/amavisd.conf, which is being owned by root:amavis.

I didn&apos;t bump unstable version (2.3.0), just modified it.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jaervosz@gentoo.org</who>
            <bug_when>2005-05-04 23:15:13 0000</bug_when>
            <thetext>Thx everyone, this is ready for GLSA decision.

I vote for NO GLSA.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>eromang@zataz.net</who>
            <bug_when>2005-05-06 14:52:06 0000</bug_when>
            <thetext>A message to warn sysadmin could be good, no need of GLSA i think</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ticho@gentoo.org</who>
            <bug_when>2005-05-06 15:29:47 0000</bug_when>
            <thetext>Right, as portage doesn&apos;t change the permissions of an existing file in /etc, we need to tell the admin to do it himself. Too bad.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ticho@gentoo.org</who>
            <bug_when>2005-05-06 15:51:44 0000</bug_when>
            <thetext>ewarn message added to both 2.2.1-r2 and 2.3.0.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jaervosz@gentoo.org</who>
            <bug_when>2005-05-07 01:42:39 0000</bug_when>
            <thetext>Adding Marius so he can comment.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>genone@gentoo.org</who>
            <bug_when>2005-05-07 03:11:47 0000</bug_when>
            <thetext>Well, you could change it in pkg_postinst. Just be minimal invaise there (so prefer `chmod o-rwx` over `chmod 640`), otherwise people might get pissed that you&apos;re grant permissions instead of removing them (in case they did a chmod 600 for example).</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jaervosz@gentoo.org</who>
            <bug_when>2005-05-07 10:25:36 0000</bug_when>
            <thetext>Thx Marius.

Ticho I believe this should be added as well, back to ebuild status.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ticho@gentoo.org</who>
            <bug_when>2005-05-08 02:05:47 0000</bug_when>
            <thetext>Ok, committed. Thanks, Marius.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jaervosz@gentoo.org</who>
            <bug_when>2005-05-08 05:00:15 0000</bug_when>
            <thetext>Thx Thico.

Back to glsa? One NO vote so far.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ticho@gentoo.org</who>
            <bug_when>2005-05-08 11:30:25 0000</bug_when>
            <thetext>NO from me as well.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jaervosz@gentoo.org</who>
            <bug_when>2005-05-11 07:21:31 0000</bug_when>
            <thetext>Sorry only Security Team members vote count officially. So please vote.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2005-05-12 05:46:52 0000</bug_when>
            <thetext>Voting NO and closing.</thetext>
          </long_desc>
      
    </bug>

</bugzilla>