RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1506544 - Comments on Allow from break access restrictions
Summary: Comments on Allow from break access restrictions
Keywords:
Status: CLOSED DUPLICATE of bug 1489849
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: httpd
Version: 6.9
Hardware: All
OS: Linux
unspecified
high
Target Milestone: rc
: ---
Assignee: Luboš Uhliarik
QA Contact: BaseOS QE - Apps
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-10-26 09:53 UTC by Heinrich Mislik
Modified: 2017-10-30 15:45 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-10-26 10:22:14 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Allow comments in allow/deny (2.03 KB, patch)
2017-10-30 15:43 UTC, Heinrich Mislik
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1349546 0 unspecified CLOSED comments no longer allowed at the end of Allow from statements and maybe other statements from mod_authz* 2021-02-22 00:41:40 UTC

Description Heinrich Mislik 2017-10-26 09:53:14 UTC
The Patch for #1349546 breaks "Allow from" in httpd-2.2.15-60

Having the following Lines allows access for ANY ip:

allow from 10.0.0.1 # 10.0.0.2
deny from all

Actual results:

Access from ANY IP is granted.

Expected results:

Access should only be granted for 10.0.0.1

Additional info:

apache iterates over the allow line so that allow_cmd() in mod_authz_host gets called three times with values:

"10.0.0.1"
"#"
"10.0.0.2"

Simply overwriting '#' with '\0' results in an empty string for the following processing. The emtpy string gets passed to apr_ipsubnet_create(). Unfortunatly in version 1.3 of libapr an emtpy string passes looks_like_ip() (fixed in later versions) and gets parsed by parse_network() resulting in the equivalent of network 0/0. Thus access is granted for ANY ip.

I consider this a serious security bug. It can lead to unintentional exposure  of restricted content.

Cheers

Heinrich

Comment 2 Luboš Uhliarik 2017-10-26 10:22:14 UTC

*** This bug has been marked as a duplicate of bug 1489849 ***

Comment 3 Heinrich Mislik 2017-10-30 15:43:44 UTC
Created attachment 1345523 [details]
Allow comments in  allow/deny

patch for mod_authz_host.c that discards anything after '#' in allow/deny

Comment 4 Heinrich Mislik 2017-10-30 15:45:56 UTC
Since the proposed solution (disallowing comments at all) may again break existing configs, I came up with my own patch. In case anyone ist interrested: see attachment.

Cheers

Heinrich


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