<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Mudança em sistemas de arquivos põe Postfix em risco</title>
	<atom:link href="http://br-linux.org/2008/erro-em-sistemas-de-arquivos-poe-postfix-em-risco/feed/" rel="self" type="application/rss+xml" />
	<link>http://br-linux.org/2008/erro-em-sistemas-de-arquivos-poe-postfix-em-risco/</link>
	<description>Linux levado a sério desde 1996</description>
	<lastBuildDate>Sun, 27 May 2012 04:34:30 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: henry</title>
		<link>http://br-linux.org/2008/erro-em-sistemas-de-arquivos-poe-postfix-em-risco/comment-page-1/#comment-21231</link>
		<dc:creator>henry</dc:creator>
		<pubDate>Mon, 18 Aug 2008 01:49:08 +0000</pubDate>
		<guid isPermaLink="false">http://br-linux.org/2008/erro-em-sistemas-de-arquivos-poe-postfix-em-risco/#comment-21231</guid>
		<description>Grande coisa usar isso ou aquilo em servidores. Se prestar atenção a noticia, kerneis posteriores a 2.0 são afetados. Ou seja, não importa o quão vc se acha seguro, sempre existe a possibilidade de alguém ir lá com atenção e provar o contrário. 

(e pelo que eu me lembre, um especialista, a não muito tempo atrás, varreu o openbsd em algumas horas e encontrou umas duas duzias de vulnerabilidades sérias....Realmente, openbsd é Muito seguro, aliás, como toda obra feita pelos seres humanos.. 
:) 
)</description>
		<content:encoded><![CDATA[<p>Grande coisa usar isso ou aquilo em servidores. Se prestar atenção a noticia, kerneis posteriores a 2.0 são afetados. Ou seja, não importa o quão vc se acha seguro, sempre existe a possibilidade de alguém ir lá com atenção e provar o contrário. </p>
<p>(e pelo que eu me lembre, um especialista, a não muito tempo atrás, varreu o openbsd em algumas horas e encontrou umas duas duzias de vulnerabilidades sérias&#8230;.Realmente, openbsd é Muito seguro, aliás, como toda obra feita pelos seres humanos..<br />
:)<br />
)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Padrão</title>
		<link>http://br-linux.org/2008/erro-em-sistemas-de-arquivos-poe-postfix-em-risco/comment-page-1/#comment-21221</link>
		<dc:creator>Padrão</dc:creator>
		<pubDate>Mon, 18 Aug 2008 00:29:46 +0000</pubDate>
		<guid isPermaLink="false">http://br-linux.org/2008/erro-em-sistemas-de-arquivos-poe-postfix-em-risco/#comment-21221</guid>
		<description>Ainda bem que não uso Linux nos meus servidores (OpenBSD). Isso é o que dá quando se faz o que quer e decidem não seguir os padrões.</description>
		<content:encoded><![CDATA[<p>Ainda bem que não uso Linux nos meus servidores (OpenBSD). Isso é o que dá quando se faz o que quer e decidem não seguir os padrões.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andre</title>
		<link>http://br-linux.org/2008/erro-em-sistemas-de-arquivos-poe-postfix-em-risco/comment-page-1/#comment-21152</link>
		<dc:creator>Andre</dc:creator>
		<pubDate>Sun, 17 Aug 2008 18:06:06 +0000</pubDate>
		<guid isPermaLink="false">http://br-linux.org/2008/erro-em-sistemas-de-arquivos-poe-postfix-em-risco/#comment-21152</guid>
		<description>Estou postando o email que eu recebi pela lista postfix-announce, não consegui encontrar o arquivo online da lista.
Aparentemente o problema afeta apenas usuários utilizando o formato mailbox, quem estiver usando maildir não é afetado.

----

Subject: Postfix local privilege escalation via hardlinked symlinks
To: Postfix announce 
Date: Thu, 14 Aug 2008 08:05:28 -0400 (EDT)
CC: Postfix users 
X-Time-Zone:  USA EST, 6 hours behind central European time
X-Mailer: ELM [version 2.4ME+ PL82 (25)]
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII
Message-Id: 
From: wietse@porcupine.org (Wietse Venema)
Sender: owner-postfix-announce@postfix.org
Precedence: bulk
List-Post: 
List-Help: 
List-Unsubscribe: 
List-Subscribe: 

Summary: Solaris and Linux file system behavior has changed over
time, breaking one of the assumptions in Postfix. See below for a
description of the behavior and how it disagrees with standards.

Postfix is not affected on systems with standard (POSIX, X/Open)
file system behavior, i.e. *BSD, AIX, MacOS, HP-UX, and very old
Sun/Linux systems.  The fix and workarounds are simple.

There are efforts to get the non-standard behavior approved by
standards (a function called llink). Today&#039;s fix for Solaris, Linux
etc. also makes Postfix future-proof for such changes.

	Wietse

1. Postfix local privilege escalation via hardlinked symlinks
=============================================================
Sebastian Krahmer of SuSE has found a privilege escalation problem.
On some systems an attacker can hardlink a root-owned symlink to
for example /var/mail, and cause Postfix to append mail to existing
files that are owned by root or non-root accounts. This can happen
on operating systems with specific non-standard behavior.

Symlinks (symbolic links) implement aliasing for UNIX pathnames.
They were introduced with 4.2BSD UNIX in 1983, and were adopted by
other UNIX systems in the course of time.  Hardlinks are older and
implement the primary mechanism for accessing file system objects.

In some UNIX systems, the link(symlink, newpath) operation has
changed over time: instead of recursively following the symlink and
creating a hardlink to the file thus found, it creates a hardlink
to the symlink itself.  This behavior disagrees with, for example,
the POSIX.1-2001 and X/Open XPG4v2 standards, and is the default
on current Solaris, IRIX and Linux systems. On systems with this
non-standard behavior, Postfix may be vulnerable depending on how
it is configured.

Postfix allows a root-owned symlink as a local mail destination,
so that mail can be delivered to e.g. /dev/null which is a symlink
on Solaris.

2. What configurations are (not) affected
=========================================
A configuration is considered affected when an attacker with local
access to a system can make Postfix append mail to an existing file
of a different user.  Appendix A gives a procedure to determine if
a system is affected.

The following configurations are NOT affected: Postfix on FreeBSD
7.0, OpenBSD 4.3, NetBSD 4.0, MacOS X 10.5, AIX 5.3, HP-UX 11.11,
Solaris 1.x, Linux kernel 1.2.13, and other systems with standard
hardlink behavior. However, these systems may become affected when
they share file systems with hosts where users can create hardlinks
to symlinks.

Also not affected are the following configurations: a) maildir-style
delivery with the Postfix built-in local or virtual delivery agents;
b) mail delivery with non-Postfix local or virtual delivery agents;
c) mailbox-style delivery with the Postfix built-in virtual delivery
agent when virtual mailbox parent directories have no &quot;group&quot; or
other write permissions.

The following configurations are known to be affected on Linux
kernel &gt;= 2.0, Solaris &gt;= 2.0, OpenSolaris 11-2008.5, IRIX 6.5, and
other systems where users can create hardlinks to symlinks: a)
mailbox-style delivery with the Postfix built-in local delivery
agent; b) mailbox-style delivery with the Postfix built-in virtual
delivery agent when virtual mailbox parent directories have &quot;group&quot;
or other write permissions.

3. Solution
===========
If your system is affected, upgrade Postfix, apply the patch in
Appendix C, or apply one of the countermeasures in section 4.

Updated versions will be made available via http://www.postfix.org/
for Postfix versions 2.3, 2.4, 2.5, and 2.6. Individual vendors
will provide updates depending on their support policy.

4. Countermeasures
==================
Each of the following countermeasures will prevent privilege
escalation through Postfix via hardlinked symlinks:

1) Protect mailbox files (maildir files are not affected). The
script in Appendix B makes sure that the system mail spool directory
is owned by root, that the sticky bit is turned on, and that each
UNIX account has a mailbox file; it also has suggestions for virtual
mailbox file deliveries (again, maildir files are not affected).

2) Don&#039;t allow non-root users to create hardlinks to objects of
other users.  This behavior is configurable on some systems.

Appendix A: Procedure to find out if a system is affected
=========================================================
As mentioned in section 2, not affected are maildir-style delivery
with the Postfix built-in local or virtual delivery agents, mail
delivery with non-Postfix local or virtual delivery agents, and
mailbox-style delivery with the built-in Postfix virtual delivery
agent when virtual mailbox parent directories have no &quot;group&quot; or
other write permissions.

To find out if a system may be affected, execute the following
commands as non-root user on a local file system:

    $ PATH=/bin:/usr/bin:$PATH
    $ mkdir test
    $ cd test
    $ touch src
    $ ln -s src dst1
    $ ln dst1 dst2
    $ ls -l

For the test to be valid, all commands should complete without error.

The system is NOT affected when &quot;ls -l&quot; output shows one symlink
(dst1 -&gt; src) and two files (dst2, src) as in example A.1.

Example A.1:
lrwxr-xr-x  1 user users 3 Mmm dd hh:mm dst1 -&gt; src
-rw-r--r--  2 user users 0 Mmm dd hh:mm dst2
-rw-r--r--  2 user users 0 Mmm dd hh:mm src

However, the system may become affected when it shares file systems
with hosts where users can create hardlinks to symlinks as described
next.

The system is affected when &quot;ls -l&quot; output shows two symlinks and
one file as in example A.2, with the following Postfix configurations:
a) mailbox-style delivery with the Postfix built-in local delivery
agent; b) mailbox-style delivery with the Postfix built-in virtual
delivery agent when virtual mailbox parent directories have &quot;group&quot;
or other write permission.

Example A.2:
lrwxrwxrwx  2 user users 3 Mmm dd hh:mm dst1 -&gt; src
lrwxrwxrwx  2 user users 3 Mmm dd hh:mm dst2 -&gt; src
-rw-r--r--  1 user users 0 Mmm dd hh:mm src

Appendix B: Procedure to protect mailbox files
==============================================
This section describes one of the countermeasures (see section 4)
that eliminate the problem without updating Postfix.

The Perl script below hardens systems that use mailbox-style
deliveries with the Postfix built-in local delivery agent; it makes
sure that the system mailspool directory is root-owned and sticky,
and that every UNIX account has a mailbox file. The script assumes
that mailbox files are stored under /var/mail.

Similar actions would be needed for systems that use mailbox-style
delivery with the Postfix built-in virtual delivery agent, but this
is needed only when Postfix virtual mailbox parent directories have
&quot;group&quot; or other write permissions.  Unfortunately, an automated
script for this cannot be made available due to the large variation
between Postfix configurations.

#!/usr/bin/perl

# fix-mailspool - Make sure the mailspool directory is root-owned
# and sticky, and that every UNIX account has a mailbox file.

use Fcntl;

$debug = 0;

# Follow compatibility symlink.
$mailspool=&quot;/var/mail/&quot;;

chown(0, -1, $mailspool) 
    &#124;&#124; die(&quot;can&#039;t set root ownership for $mailspool: $!\n&quot;);

chmod((stat($mailspool))[2] &#124; 01000, $mailspool)
    &#124;&#124; die(&quot;can&#039;t set sticky bit for $mailspool: $!\n&quot;);

while(($name, $passwd, $uid, $gid, $quota,
    $comment, $gcos, $dir, $shell) = getpwent()) {
    print &quot;user $name\n&quot; if $debug;
    $mailbox = ($mailspool . $name);
    if (! -e $mailbox) {
	print &quot;create $mailbox\n&quot; if $debug;
	if (!sysopen(MAILBOX, $mailbox, (O_CREAT &#124; O_RDWR &#124; O_EXCL), 0600)) {
	    warn(&quot;can&#039;t create $mailbox: $!\n&quot;);
	} else {
	    # XXX fchown() is not portable.
	    chown($uid, $gid, $mailbox) &#124;&#124; warn(&quot;chown $mailbox: $!\n&quot;);
	    close(MAILBOX);
	}
    } elsif (! -f $mailbox) {
	warn(&quot;$mailbox is not a regular file\n&quot;);
    } elsif ((stat($mailbox))[4] != $uid) {
	warn(&quot;$mailbox is not owned by $name\n&quot;);
    }
}

Appendix C: Source code patch
=============================
This patch is suitable for Postfix 2.0 and later. It presents the
least invasive change that eliminates the problem. Future Postfix
releases may adopt a different strategy.

The solution introduces the following change: when the target of
mail delivery is a symlink, the parent directory of that symlink
must now be writable by root only (in addition to the already
existing requirement that the symlink itself is owned by root).
This change will break legitimate configurations that deliver mail
to a symbolic link in a directory with less restrictive permissions.

*** src/util/safe_open.c.orig	Sun Jun  4 19:04:49 2006
--- src/util/safe_open.c	Mon Aug  4 16:47:18 2008
***************
*** 83,88 ****
--- 83,89 ----
  #include 
  #include 
  #include 
+ #include 
  #include 
  
  /* safe_open_exist - open existing file */
***************
*** 138,150 ****
       * for symlinks owned by root. NEVER, NEVER, make exceptions for symlinks
       * owned by a non-root user. This would open a security hole when
       * delivering mail to a world-writable mailbox directory.
       */
      else if (lstat(path, &amp;lstat_st) st_dev != lstat_st.st_dev
--- 139,167 ----
       * for symlinks owned by root. NEVER, NEVER, make exceptions for symlinks
       * owned by a non-root user. This would open a security hole when
       * delivering mail to a world-writable mailbox directory.
+      * 
+      * Sebastian Krahmer of SuSE brought to my attention that some systems have
+      * changed their semantics of link(symlink, newpath), such that the
+      * result is a hardlink to the symlink. For this reason, we now also
+      * require that the symlink&#039;s parent directory is writable only by root.
       */
      else if (lstat(path, &amp;lstat_st) st_dev != lstat_st.st_dev</description>
		<content:encoded><![CDATA[<p>Estou postando o email que eu recebi pela lista postfix-announce, não consegui encontrar o arquivo online da lista.<br />
Aparentemente o problema afeta apenas usuários utilizando o formato mailbox, quem estiver usando maildir não é afetado.</p>
<p>&#8212;-</p>
<p>Subject: Postfix local privilege escalation via hardlinked symlinks<br />
To: Postfix announce<br />
Date: Thu, 14 Aug 2008 08:05:28 -0400 (EDT)<br />
CC: Postfix users<br />
X-Time-Zone:  USA EST, 6 hours behind central European time<br />
X-Mailer: ELM [version 2.4ME+ PL82 (25)]<br />
MIME-Version: 1.0<br />
Content-Transfer-Encoding: 7bit<br />
Content-Type: text/plain; charset=US-ASCII<br />
Message-Id:<br />
From: <a href="mailto:wietse@porcupine.org">wietse@porcupine.org</a> (Wietse Venema)<br />
Sender: <a href="mailto:owner-postfix-announce@postfix.org">owner-postfix-announce@postfix.org</a><br />
Precedence: bulk<br />
List-Post:<br />
List-Help:<br />
List-Unsubscribe:<br />
List-Subscribe: </p>
<p>Summary: Solaris and Linux file system behavior has changed over<br />
time, breaking one of the assumptions in Postfix. See below for a<br />
description of the behavior and how it disagrees with standards.</p>
<p>Postfix is not affected on systems with standard (POSIX, X/Open)<br />
file system behavior, i.e. *BSD, AIX, MacOS, HP-UX, and very old<br />
Sun/Linux systems.  The fix and workarounds are simple.</p>
<p>There are efforts to get the non-standard behavior approved by<br />
standards (a function called llink). Today&#8217;s fix for Solaris, Linux<br />
etc. also makes Postfix future-proof for such changes.</p>
<p>	Wietse</p>
<p>1. Postfix local privilege escalation via hardlinked symlinks<br />
=============================================================<br />
Sebastian Krahmer of SuSE has found a privilege escalation problem.<br />
On some systems an attacker can hardlink a root-owned symlink to<br />
for example /var/mail, and cause Postfix to append mail to existing<br />
files that are owned by root or non-root accounts. This can happen<br />
on operating systems with specific non-standard behavior.</p>
<p>Symlinks (symbolic links) implement aliasing for UNIX pathnames.<br />
They were introduced with 4.2BSD UNIX in 1983, and were adopted by<br />
other UNIX systems in the course of time.  Hardlinks are older and<br />
implement the primary mechanism for accessing file system objects.</p>
<p>In some UNIX systems, the link(symlink, newpath) operation has<br />
changed over time: instead of recursively following the symlink and<br />
creating a hardlink to the file thus found, it creates a hardlink<br />
to the symlink itself.  This behavior disagrees with, for example,<br />
the POSIX.1-2001 and X/Open XPG4v2 standards, and is the default<br />
on current Solaris, IRIX and Linux systems. On systems with this<br />
non-standard behavior, Postfix may be vulnerable depending on how<br />
it is configured.</p>
<p>Postfix allows a root-owned symlink as a local mail destination,<br />
so that mail can be delivered to e.g. /dev/null which is a symlink<br />
on Solaris.</p>
<p>2. What configurations are (not) affected<br />
=========================================<br />
A configuration is considered affected when an attacker with local<br />
access to a system can make Postfix append mail to an existing file<br />
of a different user.  Appendix A gives a procedure to determine if<br />
a system is affected.</p>
<p>The following configurations are NOT affected: Postfix on FreeBSD<br />
7.0, OpenBSD 4.3, NetBSD 4.0, MacOS X 10.5, AIX 5.3, HP-UX 11.11,<br />
Solaris 1.x, Linux kernel 1.2.13, and other systems with standard<br />
hardlink behavior. However, these systems may become affected when<br />
they share file systems with hosts where users can create hardlinks<br />
to symlinks.</p>
<p>Also not affected are the following configurations: a) maildir-style<br />
delivery with the Postfix built-in local or virtual delivery agents;<br />
b) mail delivery with non-Postfix local or virtual delivery agents;<br />
c) mailbox-style delivery with the Postfix built-in virtual delivery<br />
agent when virtual mailbox parent directories have no &#8220;group&#8221; or<br />
other write permissions.</p>
<p>The following configurations are known to be affected on Linux<br />
kernel &gt;= 2.0, Solaris &gt;= 2.0, OpenSolaris 11-2008.5, IRIX 6.5, and<br />
other systems where users can create hardlinks to symlinks: a)<br />
mailbox-style delivery with the Postfix built-in local delivery<br />
agent; b) mailbox-style delivery with the Postfix built-in virtual<br />
delivery agent when virtual mailbox parent directories have &#8220;group&#8221;<br />
or other write permissions.</p>
<p>3. Solution<br />
===========<br />
If your system is affected, upgrade Postfix, apply the patch in<br />
Appendix C, or apply one of the countermeasures in section 4.</p>
<p>Updated versions will be made available via <a href="http://www.postfix.org/" rel="nofollow">http://www.postfix.org/</a><br />
for Postfix versions 2.3, 2.4, 2.5, and 2.6. Individual vendors<br />
will provide updates depending on their support policy.</p>
<p>4. Countermeasures<br />
==================<br />
Each of the following countermeasures will prevent privilege<br />
escalation through Postfix via hardlinked symlinks:</p>
<p>1) Protect mailbox files (maildir files are not affected). The<br />
script in Appendix B makes sure that the system mail spool directory<br />
is owned by root, that the sticky bit is turned on, and that each<br />
UNIX account has a mailbox file; it also has suggestions for virtual<br />
mailbox file deliveries (again, maildir files are not affected).</p>
<p>2) Don&#8217;t allow non-root users to create hardlinks to objects of<br />
other users.  This behavior is configurable on some systems.</p>
<p>Appendix A: Procedure to find out if a system is affected<br />
=========================================================<br />
As mentioned in section 2, not affected are maildir-style delivery<br />
with the Postfix built-in local or virtual delivery agents, mail<br />
delivery with non-Postfix local or virtual delivery agents, and<br />
mailbox-style delivery with the built-in Postfix virtual delivery<br />
agent when virtual mailbox parent directories have no &#8220;group&#8221; or<br />
other write permissions.</p>
<p>To find out if a system may be affected, execute the following<br />
commands as non-root user on a local file system:</p>
<p>    $ PATH=/bin:/usr/bin:$PATH<br />
    $ mkdir test<br />
    $ cd test<br />
    $ touch src<br />
    $ ln -s src dst1<br />
    $ ln dst1 dst2<br />
    $ ls -l</p>
<p>For the test to be valid, all commands should complete without error.</p>
<p>The system is NOT affected when &#8220;ls -l&#8221; output shows one symlink<br />
(dst1 -&gt; src) and two files (dst2, src) as in example A.1.</p>
<p>Example A.1:<br />
lrwxr-xr-x  1 user users 3 Mmm dd hh:mm dst1 -&gt; src<br />
-rw-r&#8211;r&#8211;  2 user users 0 Mmm dd hh:mm dst2<br />
-rw-r&#8211;r&#8211;  2 user users 0 Mmm dd hh:mm src</p>
<p>However, the system may become affected when it shares file systems<br />
with hosts where users can create hardlinks to symlinks as described<br />
next.</p>
<p>The system is affected when &#8220;ls -l&#8221; output shows two symlinks and<br />
one file as in example A.2, with the following Postfix configurations:<br />
a) mailbox-style delivery with the Postfix built-in local delivery<br />
agent; b) mailbox-style delivery with the Postfix built-in virtual<br />
delivery agent when virtual mailbox parent directories have &#8220;group&#8221;<br />
or other write permission.</p>
<p>Example A.2:<br />
lrwxrwxrwx  2 user users 3 Mmm dd hh:mm dst1 -&gt; src<br />
lrwxrwxrwx  2 user users 3 Mmm dd hh:mm dst2 -&gt; src<br />
-rw-r&#8211;r&#8211;  1 user users 0 Mmm dd hh:mm src</p>
<p>Appendix B: Procedure to protect mailbox files<br />
==============================================<br />
This section describes one of the countermeasures (see section 4)<br />
that eliminate the problem without updating Postfix.</p>
<p>The Perl script below hardens systems that use mailbox-style<br />
deliveries with the Postfix built-in local delivery agent; it makes<br />
sure that the system mailspool directory is root-owned and sticky,<br />
and that every UNIX account has a mailbox file. The script assumes<br />
that mailbox files are stored under /var/mail.</p>
<p>Similar actions would be needed for systems that use mailbox-style<br />
delivery with the Postfix built-in virtual delivery agent, but this<br />
is needed only when Postfix virtual mailbox parent directories have<br />
&#8220;group&#8221; or other write permissions.  Unfortunately, an automated<br />
script for this cannot be made available due to the large variation<br />
between Postfix configurations.</p>
<p>#!/usr/bin/perl</p>
<p># fix-mailspool &#8211; Make sure the mailspool directory is root-owned<br />
# and sticky, and that every UNIX account has a mailbox file.</p>
<p>use Fcntl;</p>
<p>$debug = 0;</p>
<p># Follow compatibility symlink.<br />
$mailspool=&#8221;/var/mail/&#8221;;</p>
<p>chown(0, -1, $mailspool)<br />
    || die(&#8220;can&#8217;t set root ownership for $mailspool: $!\n&#8221;);</p>
<p>chmod((stat($mailspool))[2] | 01000, $mailspool)<br />
    || die(&#8220;can&#8217;t set sticky bit for $mailspool: $!\n&#8221;);</p>
<p>while(($name, $passwd, $uid, $gid, $quota,<br />
    $comment, $gcos, $dir, $shell) = getpwent()) {<br />
    print &#8220;user $name\n&#8221; if $debug;<br />
    $mailbox = ($mailspool . $name);<br />
    if (! -e $mailbox) {<br />
	print &#8220;create $mailbox\n&#8221; if $debug;<br />
	if (!sysopen(MAILBOX, $mailbox, (O_CREAT | O_RDWR | O_EXCL), 0600)) {<br />
	    warn(&#8220;can&#8217;t create $mailbox: $!\n&#8221;);<br />
	} else {<br />
	    # XXX fchown() is not portable.<br />
	    chown($uid, $gid, $mailbox) || warn(&#8220;chown $mailbox: $!\n&#8221;);<br />
	    close(MAILBOX);<br />
	}<br />
    } elsif (! -f $mailbox) {<br />
	warn(&#8220;$mailbox is not a regular file\n&#8221;);<br />
    } elsif ((stat($mailbox))[4] != $uid) {<br />
	warn(&#8220;$mailbox is not owned by $name\n&#8221;);<br />
    }<br />
}</p>
<p>Appendix C: Source code patch<br />
=============================<br />
This patch is suitable for Postfix 2.0 and later. It presents the<br />
least invasive change that eliminates the problem. Future Postfix<br />
releases may adopt a different strategy.</p>
<p>The solution introduces the following change: when the target of<br />
mail delivery is a symlink, the parent directory of that symlink<br />
must now be writable by root only (in addition to the already<br />
existing requirement that the symlink itself is owned by root).<br />
This change will break legitimate configurations that deliver mail<br />
to a symbolic link in a directory with less restrictive permissions.</p>
<p>*** src/util/safe_open.c.orig	Sun Jun  4 19:04:49 2006<br />
&#8212; src/util/safe_open.c	Mon Aug  4 16:47:18 2008<br />
***************<br />
*** 83,88 ****<br />
&#8212; 83,89 &#8212;-<br />
  #include<br />
  #include<br />
  #include<br />
+ #include<br />
  #include </p>
<p>  /* safe_open_exist &#8211; open existing file */<br />
***************<br />
*** 138,150 ****<br />
       * for symlinks owned by root. NEVER, NEVER, make exceptions for symlinks<br />
       * owned by a non-root user. This would open a security hole when<br />
       * delivering mail to a world-writable mailbox directory.<br />
       */<br />
      else if (lstat(path, &amp;lstat_st) st_dev != lstat_st.st_dev<br />
&#8212; 139,167 &#8212;-<br />
       * for symlinks owned by root. NEVER, NEVER, make exceptions for symlinks<br />
       * owned by a non-root user. This would open a security hole when<br />
       * delivering mail to a world-writable mailbox directory.<br />
+      *<br />
+      * Sebastian Krahmer of SuSE brought to my attention that some systems have<br />
+      * changed their semantics of link(symlink, newpath), such that the<br />
+      * result is a hardlink to the symlink. For this reason, we now also<br />
+      * require that the symlink&#8217;s parent directory is writable only by root.<br />
       */<br />
      else if (lstat(path, &amp;lstat_st) st_dev != lstat_st.st_dev</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: amg1127</title>
		<link>http://br-linux.org/2008/erro-em-sistemas-de-arquivos-poe-postfix-em-risco/comment-page-1/#comment-21128</link>
		<dc:creator>amg1127</dc:creator>
		<pubDate>Sun, 17 Aug 2008 17:42:31 +0000</pubDate>
		<guid isPermaLink="false">http://br-linux.org/2008/erro-em-sistemas-de-arquivos-poe-postfix-em-risco/#comment-21128</guid>
		<description>Embora o meu servidor de e-mails pareça não ser afetado pelo problema (devido à utilização conjunta do Cyrus IMAP e da proibição de acesso local ou via SSH), gostaria de investigar melhor o problema.

Alguém tem um link para o anúncio original do Wietse Venema?</description>
		<content:encoded><![CDATA[<p>Embora o meu servidor de e-mails pareça não ser afetado pelo problema (devido à utilização conjunta do Cyrus IMAP e da proibição de acesso local ou via SSH), gostaria de investigar melhor o problema.</p>
<p>Alguém tem um link para o anúncio original do Wietse Venema?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: NÃO SOMOS APENAS ROSTINHOS BONIT...</title>
		<link>http://br-linux.org/2008/erro-em-sistemas-de-arquivos-poe-postfix-em-risco/comment-page-1/#comment-21032</link>
		<dc:creator>NÃO SOMOS APENAS ROSTINHOS BONIT...</dc:creator>
		<pubDate>Sun, 17 Aug 2008 15:42:32 +0000</pubDate>
		<guid isPermaLink="false">http://br-linux.org/2008/erro-em-sistemas-de-arquivos-poe-postfix-em-risco/#comment-21032</guid>
		<description>Será?</description>
		<content:encoded><![CDATA[<p>Será?</p>
]]></content:encoded>
	</item>
</channel>
</rss>



 

