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 1349546 - comments no longer allowed at the end of Allow from statements and maybe other statements from mod_authz*
Summary: comments no longer allowed at the end of Allow from statements and maybe othe...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: httpd
Version: 6.7
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: rc
: ---
Assignee: Luboš Uhliarik
QA Contact: Sushma
Lenka Špačková
URL:
Whiteboard:
Depends On:
Blocks: 1269194 1359263 1448367
TreeView+ depends on / blocked
 
Reported: 2016-06-23 16:14 UTC by Sven Hoexter
Modified: 2021-01-14 09:36 UTC (History)
7 users (show)

Fixed In Version: httpd-2.2.15-58.el6
Doc Type: Release Note
Doc Text:
*httpd* no longer fails to start if there is a comment in the `Allow` directive Comments had been disallowed at the end of the `Allow` directive in the Apache *mod_authz_host* module. Consequently, the *httpd* daemon failed to start with a syntax error if such a comment was included. With this update, it is possible to insert comments starting with the `#` (hash) sign, where `#` is interpreted as an end of line, in `Allow` or `Deny` directives.
Clone Of:
: 1448367 1489849 (view as bug list)
Environment:
Last Closed: 2017-03-21 11:50:21 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:0784 0 normal SHIPPED_LIVE httpd bug fix update 2017-03-21 12:49:39 UTC

Internal Links: 1506544 1507403

Description Sven Hoexter 2016-06-23 16:14:35 UTC
Description of problem:
After an upgrade to httpd-2.2.15-53 apachectl reports the following syntax
error:
# apachectl configtest
Syntax error on line 35 of XXX/blahblahsome.conf:
No comments are allowed here

The block in question looks like this:
<Location /server-info>
    SetHandler server-info
    Order deny,allow
    Deny from all
    Allow from 1.2.3.4 # test me
</Location>

Removing the end of line comment "# test me" remediates the issue.

Version-Release number of selected component (if applicable):
httpd-2.2.15-53
The configuration is valid with httpd-2.2.15-47, I did not check the releases
in between (yet).


How reproducible:
Create a config block like the one quoted above.


Actual results:
restart of httpd fails with a syntax error


Expected results:
it should parse the config that was valid before and start :)

Or a note in the tech release notes, well I could not spot one, maybe I missed it.

Comment 1 Joe Orton 2016-06-23 17:12:52 UTC
Yes, that may have missed the release notes, sorry!  This change is expected.

1) To be super-pedantic, it's not a valid configuration in the old version, because '#' is treated as a hostname and '#' is not a valid DNS character.

2) It would allow any host with reverse-DNS of "test" or "me", which is not (presumably) expected.

Comment 2 Sven Hoexter 2016-06-23 18:20:11 UTC
I expected something like that. :) As far as I can follow back the history of this configuration file someone put it into this configuration a very long time ago.
Not sure if it maybe was valid in Apache 1.3/2.0 times. Anyway I'll fix our configurations but it might be worth a note for other people with similar odd and old configurations.

Comment 4 Rich Armstrong 2016-07-08 11:51:55 UTC
This seems to be a rather simplified fix for a serious issue. 
It will stop HTTPD from starting, after reboot (since the syntax will not validate). 

Since "#" is not a valid DNS name, it would make more sense to interpret "#" as EOL in the Allow/Deny lines.

Comment 5 Joe Orton 2016-07-28 12:47:38 UTC
To be fair, "# as EOL" is the approach used in 2.4.x mod_authz_host; I'll propose the same upstream for Allow/Deny, and we should be able to backport that without any risk.

Comment 14 Sushma 2016-11-30 10:31:25 UTC
Bug reproduced on two previous versions : httpd-2.2.15-57.el6.x86_64.rpm, httpd-2.2.15-55.el6_8.2.x86_64
Test case for this bug was run and completed successfully on all archs. Link to beaker job - https://beaker.engineering.redhat.com/jobs/1612311

Comment 17 errata-xmlrpc 2017-03-21 11:50:21 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2017-0784.html


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