Bug 176324 - Logwatch http regex period escaping
Summary: Logwatch http regex period escaping
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: logwatch
Version: 4.0
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Ivana Varekova
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 189992 FAST4.5APPROVED
TreeView+ depends on / blocked
 
Reported: 2005-12-21 14:20 UTC by Dan Collis-Puro
Modified: 2007-11-30 22:07 UTC (History)
0 users

Fixed In Version: RHBA-2006-0631
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-09-06 13:54:04 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
proposed patch (545 bytes, text/plain)
2005-12-22 09:31 UTC, Ivana Varekova
no flags Details
proposed patch (including the patch against problem described in comment 2) (1.06 KB, patch)
2005-12-23 08:45 UTC, Ivana Varekova
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2006:0631 0 normal SHIPPED_LIVE logwatch bug fix update 2007-05-01 14:10:43 UTC

Description Dan Collis-Puro 2005-12-21 14:20:14 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20051010 Firefox/1.0.7 (Ubuntu package 1.0.7)

Description of problem:
In the @exploits array, patterns similar to "/../../../" do not have the periods escaped. I assume these patterns are to catch directory traversal attacks. 

Because the periods aren't escaped, the bare "." matches any single character, meaning perfectly valid URLs like "/4f/34/sd/" are getting caught as exploits.

All periods in @exploits should be escaped with a backslash.

Version-Release number of selected component (if applicable):
logwatch-5.2.2-1.EL4.1

How reproducible:
Always

Steps to Reproduce:
1. Request a url with characters like "/sf/34/sd/" (or others) in it.
2. Look at your logwatch http report.
  

Actual Results:  The valid url got caught as an exploit.

Expected Results:  Nothing. It's not an attempted exploit.

Additional info:

Comment 1 Ivana Varekova 2005-12-22 09:31:38 UTC
Created attachment 122518 [details]
proposed patch

Thank you for your notice. The attached patch fixes this problem.

Comment 2 Dan Collis-Puro 2005-12-22 14:12:26 UTC
Excellent, that fixes the directory traversal patterns. 

BUT- every period on every pattern in the @exploits array should be escaped to
be thorough- "cmd.exe" probably isn't meant to match "cmd4exe", "cmdtexe" or
"cmd/exe", all of which would get matched because the period on the "cmd.exe"
pattern isn't escaped.

Comment 3 Ivana Varekova 2005-12-23 08:45:01 UTC
Created attachment 122556 [details]
proposed patch (including the patch against problem described in comment 2)

Thank you. The attached patch fixes problem desrcibed in comment 2 too.

Comment 10 Red Hat Bugzilla 2006-09-06 13:54:04 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2006-0631.html



Note You need to log in before you can comment on or make changes to this bug.