Bug 176324 - Logwatch http regex period escaping
Logwatch http regex period escaping
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: logwatch (Show other bugs)
4.0
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Ivana Varekova
:
Depends On:
Blocks: 189992 FAST4.5APPROVED
  Show dependency treegraph
 
Reported: 2005-12-21 09:20 EST by Dan Collis-Puro
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version: RHBA-2006-0631
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-09-06 09:54:04 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Dan Collis-Puro 2005-12-21 09:20:14 EST
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 04:31:38 EST
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 09:12:26 EST
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 03:45:01 EST
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 09:54:04 EDT
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.