<?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>77963</bug_id>
          
          <creation_ts>2005-01-14 05:19 0000</creation_ts>
          <short_desc>net-www/awstats Remote code execution</short_desc>
          <delta_ts>2005-01-25 12:13:30 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>
          <bug_file_loc>http://awstats.sourceforge.net/docs/awstats_changelog.txt</bug_file_loc>
          <status_whiteboard>B1 [glsa] jaervosz</status_whiteboard>
          
          <priority>P2</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>correo@sevein.com</reporter>
          <assigned_to>security@gentoo.org</assigned_to>
          <cc>apache-bugs@gentoo.org</cc>
    
    <cc>compnerd@gentoo.org</cc>
    
    <cc>ka0ttic@gentoo.org</cc>
    
    <cc>marek.wiecek@gmail.com</cc>

      

      
          <long_desc isprivate="0">
            <who>correo@sevein.com</who>
            <bug_when>2005-01-14 05:19:56 0000</bug_when>
            <thetext>AWStats Changelog
-----------------

***** 6.3 *****

New features/improvements:
- Added the geoip_isp_maxmind and geoip_org_maxmind plugin.

Fixes:
- The geoip_city_maxmind plugin was sometimes bind.
- Removed an unknown security hole.
- Removed an other unknown security hole (found by iDEFENSE).

Other/Documentation:
- Updated documentation
- Updated language files

Reproducible: Always
Steps to Reproduce:
1.
2.
3.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>carlo@gentoo.org</who>
            <bug_when>2005-01-14 06:29:59 0000</bug_when>
            <thetext>Jes</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>carlo@gentoo.org</who>
            <bug_when>2005-01-14 06:29:59 0000</bug_when>
            <thetext>Jesús: Please use New -&gt; Gentoo Security -&gt; Component: Vulnerabilites for such reports in future. Also a comment about the impact of the issue and links to the relevant advisories would be fine.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jaervosz@gentoo.org</who>
            <bug_when>2005-01-14 06:32:58 0000</bug_when>
            <thetext>Apache please verify and advise.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2005-01-14 10:29:42 0000</bug_when>
            <thetext>http://ns3744.ovh.net/~ldestail/awstats/cvschangelogbuilder_awstats.html leaks:

Issue #1 (&quot;allows a user to run perl code with web server permissions&quot;) 
http://cvs.sourceforge.net/viewcvs.py/awstats/awstats/wwwroot/cgi-bin/awstats.pl.diff?r1=1.786&amp;r2=1.788

Issue #2 (&quot;other unknown security hole (found by iDEFENSE)&quot;)
http://cvs.sourceforge.net/viewcvs.py/awstats/awstats/wwwroot/cgi-bin/awstats.pl.diff?r1=1.795&amp;r2=1.796

Someone with time should look into those and tell us what it&apos;s really about.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2005-01-17 06:26:15 0000</bug_when>
            <thetext>I looked at it and apparently awstats is using untrusted input in plugin handling that may end up executing user-supplied perl code. Looks like a local attack to me, allowing a local user which would have access to awstats to execute code as the web server user.

Downgrading severity. Apache herd, this is yours, please bump.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2005-01-18 05:37:55 0000</bug_when>
            <thetext>iDEFENSE advisory @
http://www.idefense.com/application/poi/display?id=185&amp;type=vulnerabilities

excerpts:
======================================================================
DESCRIPTION

Remote exploitation of an input validation vulnerability in AWStats
allows attackers to execute arbitrary commands under the privileges of
the web server.
The problem specifically exists when the application is running as a
CGI script on a web server. The &quot;configdir&quot; parameter contains
unfiltered user-supplied data that is utilized in a call to the Perl
routine open() as can be seen here on line 1082 of awstats.pl:

    if (open(CONFIG,&quot;$searchdir$PROG.$SiteConfig.conf&quot;))

The &quot;searchdir&quot; variables hold the value of the parameter provided by
the attacker from &quot;configdir.&quot; An attacker can cause arbitrary commands
to be executed by prefixing them with the &quot;|&quot; character.

ANALYSIS

Successful exploitation allows remote attackers to execute arbitrary
commands under the privileges of the web server. This can lead to
further compromise as it provides remote attackers with local access.

WORKAROUND

Add a filter around the &quot;configdir&quot; parameter by replacing the following
line:

    if ($QueryString =~ /configdir=([^&amp;]+)/i)
    {
        $DirConfig=&amp;DecodeEncodedString(&quot;$1&quot;);
    }

With:

    if ($QueryString =~ /configdir=([^&amp;]+)/i)
    {
        $DirConfig=&amp;DecodeEncodedString(&quot;$1&quot;);
        $DirConfig=~tr/a-z0-9_\-\/\./a-z0-9_\-\/\./cd;
    }
=================================================================</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2005-01-20 01:20:12 0000</bug_when>
            <thetext>zul, I think it&apos;s your turf.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jaervosz@gentoo.org</who>
            <bug_when>2005-01-23 22:35:48 0000</bug_when>
            <thetext>Nothing yet. Stuart please fix/mask.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2005-01-24 02:33:33 0000</bug_when>
            <thetext>If it stays masked we should issue a Masking GLSA.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ka0ttic@gentoo.org</who>
            <bug_when>2005-01-24 06:47:45 0000</bug_when>
            <thetext>6.3 is in CVS and stable on x86.  6.1 is also currently marked stable on ppc.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>koon@gentoo.org</who>
            <bug_when>2005-01-24 08:48:57 0000</bug_when>
            <thetext>Thanks a lot for saving this package !</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>hansmi@gentoo.org</who>
            <bug_when>2005-01-25 10:31:09 0000</bug_when>
            <thetext>Stable on ppc.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>lewk@gentoo.org</who>
            <bug_when>2005-01-25 12:13:30 0000</bug_when>
            <thetext>GLSA 200501-36</thetext>
          </long_desc>
      
    </bug>

</bugzilla>