Bug 740926

Summary: awstats: multiple flaws in awredir.pl
Product: [Other] Security Response Reporter: Vincent Danen <vdanen>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: gauret, jlieskov, plautrba, rpm, tjackson
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard: impact=moderate,public=20110922,reported=20110922,source=full-disclosure,cvss2=4.3/AV:N/AC:M/Au:N/C:N/I:P/A:N,fedora-all/awstats=affected,epel-all/awstats=affected
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-19 14:57:42 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On: 740927, 740928    
Bug Blocks:    

Description Vincent Danen 2011-09-23 15:47:30 EDT
Multiple flaws were reported [1],[2] in current versions of AWStats' awredir.pl script:

URL redirection abuse:
    http://site/awredir.pl?key=0f3830803a70cc1636af3548b66ed978&url=http://websecurity.com.ua

SQL injection flaw (only if $TRACEBASE is enabled and DBI is included):
    http://site/awredir.pl?key=f38ed1cdb04c8bda5386f7755a4e1d3e&url='%20and%20benchmark(10000,md5(now()))/*

XSS flaws:
    http://site/awredir.pl?url=%3Cscript%3Ealert(document.cookie)%3C/script%3E
    http://site/awredir.pl?key=%3Cscript%3Ealert(document.cookie)%3C/script%3E

HTTP Response Splitting flaw:
    http://site/awredir.pl?key=04ed5362e853c72ca275818a7c0c5857&url=%0AHeader:1

CRLF Injection flaw (injection in logs is possible if $DEBUG and/or $TRACEFILE are enabled):
    http://site/awredir.pl?key=4b9faa91e2529400c4f3c70833b4e4a5&url=%0AText


Out of the above flaws, I believe that only the XSS flaws are feasible to abuse, as an attacker would need to know the value of $KEYFORMD5, which is defined in awredir.pl (the key generated is a md5_hash() of the $KEYFORMD5 and the URL to redirect to, although $KEYFORMD5 can be left blank (although there are notes in the script itself about a blank value being a security risk)).

Upstream does not yet have a fix available or in CVS [3].


[1] http://seclists.org/fulldisclosure/2011/Sep/234
[2] http://websecurity.com.ua/5380/
[3] http://awstats.cvs.sourceforge.net/viewvc/awstats/awstats/wwwroot/cgi-bin/
Comment 1 Vincent Danen 2011-09-23 15:48:34 EDT
Created awstats tracking bugs for this issue

Affects: fedora-all [bug 740927]
Affects: epel-all [bug 740928]
Comment 2 Tim Jackson 2011-09-27 03:02:09 EDT
There is possibly a fix (log: "Sanitize parameters" - looks like fix for the XSS flaws) in awredir.pl from 2011-09-24 :
http://awstats.cvs.sourceforge.net/viewvc/awstats/awstats/wwwroot/cgi-bin/awredir.pl?r1=1.13&r2=1.14
Comment 3 Jan Lieskovsky 2011-10-07 04:18:42 EDT
CVE Request:
[4] http://www.openwall.com/lists/oss-security/2011/10/07/1
Comment 4 Petr Lautrbach 2011-10-07 04:48:46 EDT
(In reply to comment #0)
> URL redirection abuse:
>    
> http://site/awredir.pl?key=0f3830803a70cc1636af3548b66ed978&url=http://websecurity.com.ua

awredir.pl is url redirector so this is its main/only feature and it is/can be secured by $KEYFORMD5. So I don't think this is flaw.
Comment 5 Fedora Update System 2011-10-18 18:11:32 EDT
awstats-7.0-4.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 6 Fedora Update System 2011-10-18 18:16:43 EDT
awstats-7.0-5.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 7 Fedora Update System 2011-10-19 00:27:23 EDT
awstats-7.0-5.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 8 Fedora Update System 2011-10-27 15:06:41 EDT
awstats-7.0-2.el6 has been pushed to the Fedora EPEL 6 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 9 Fedora Update System 2011-12-12 14:27:13 EST
awstats-6.95-3.el5 has been pushed to the Fedora EPEL 5 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 10 Tim Jackson 2012-08-18 13:22:28 EDT
Since all branches got a fix, looks like this bug should be closed now