You are viewing a plain text version of this content. The canonical link for it is here.
Posted to docs@httpd.apache.org by bu...@apache.org on 2026/05/29 17:32:29 UTC

[Bug 70099] New: AllowOverride Directive misleading about effect of “AllowOverride Options=…”

https://bz.apache.org/bugzilla/show_bug.cgi?id=70099

            Bug ID: 70099
           Summary: AllowOverride Directive misleading about effect of
                    “AllowOverride Options=…”
           Product: Apache httpd-2
           Version: 2.5-HEAD
          Hardware: All
               URL: https://httpd.apache.org/docs/trunk/en/mod/core.html#a
                    llowoverride
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: Documentation
          Assignee: docs@httpd.apache.org
          Reporter: chealer@gmail.com
  Target Milestone: ---

The Options case for AllowOverride is described as follows:
> Allow use of the directives controlling specific directory features (Options and XBitHack). To restrict which options may be overridden, specify an equal sign followed by a comma-separated list, without spaces, of options that may be set using the Options directive.
> 
> Implicit disabling of Options
> Even though the list of options that may be used in .htaccess files can be limited with this directive, as long as any Options directive is allowed any other inherited option can be disabled by using the non-relative syntax. In other words, this mechanism cannot force a specific option to remain set while allowing any others to be set.
After reading, re-reading and re-re-reading the note for at least 5 minutes, I
believe I managed to make sense of it. But if I did, that means the base
description is quite misleading. Readers who read that “AllowOverride
Options=x,y” allows to restrict which options may be overridden will infer that
it prevents overriding options other than x and y. Yet my understanding of the
note is that if the parent directory has option y enabled, it can be disabled
with “Options x”.

The description should specify the effect of any possible value. As this
problem has existed for a long time (since 2.2), the note should be made a
warning.

I did not test and apologize in advance if I misunderstood the note. In that
case, I highly recommend to clarify the note. One thing I assume is that “any
Options directive” means “at least 1 Options directive”.

🅭🄍: https://www.philippecloutier.com/Common+infrastructure+licensing#its

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org


[Bug 70099] AllowOverride Directive misleading about effect of “AllowOverride Options=…”

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=70099

Rich Bowen <rb...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Rich Bowen <rb...@apache.org> ---
Fixed in trunk and backported to 2.4.

The note has been rewritten as a warning with:
- A clear statement that AllowOverride Options= controls which options
  may be enabled, but cannot prevent implicit disabling
- An explanation of absolute vs relative (+/-) syntax behavior
- A concrete example demonstrating the gotcha

Tested manually — confirmed the described behavior with all five test
scenarios (see earlier comment for full test results).

Thank you for the report.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org


[Bug 70099] AllowOverride Directive misleading about effect of “AllowOverride Options=…”

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=70099

--- Comment #2 from Rich Bowen <rb...@apache.org> ---
Testing the before-and-after implied by the doc patch. (Test plan assisted by
my robot overlords.)

Overview
--------
Verified that "AllowOverride Options=X" does NOT prevent .htaccess from
implicitly disabling other inherited options when absolute syntax (without
+/- prefixes) is used.

Setup
-----
Configuration added to httpd.conf:

  <Directory "/usr/local/apache2/htdocs/testdir">
      Options Indexes FollowSymLinks ExecCGI
      AllowOverride Options=Indexes
  </Directory>

A symlink was created to test FollowSymLinks behavior:

  ln -s /etc/hostname /usr/local/apache2/htdocs/testdir/symlink-test

Test Results
------------

Test 1: Baseline (no .htaccess)
  .htaccess:  (none)
  Result:     curl /testdir/ => 200, directory listing displayed
              curl /testdir/symlink-test => 200, symlink followed
  PASS — all options active as expected.

Test 2: Absolute syntax — implicit disabling
  .htaccess:  Options Indexes
  Result:     curl /testdir/ => 200, directory listing displayed
              curl /testdir/symlink-test => 403 Forbidden
  Error log:
    [Thu Jun 04 11:14:34.151928 2026] [core:error] [pid 565575:tid 565603]
    [client 192.168.0.53:65418] AH00037: Symbolic link not allowed or link
    target not accessible: /usr/local/apache2/htdocs/testdir/symlink-test,
    referer: http://matrim/testdir/
  PASS — FollowSymLinks was implicitly disabled even though AllowOverride
  only permits setting Indexes. This confirms the reported behavior.

Test 3: Relative (additive) syntax — no implicit disabling
  .htaccess:  Options +Indexes
  Result:     curl /testdir/ => 200, directory listing displayed
              curl /testdir/symlink-test => 200, symlink followed
  PASS — relative syntax merges with inherited set; FollowSymLinks survives.

Test 4: Attempting to enable unpermitted option (absolute syntax)
  .htaccess:  Options Indexes ExecCGI
  Result:     curl /testdir/ => 500 Internal Server Error
  Error log:
    [Thu Jun 04 11:15:42.626503 2026] [core:alert] [pid 565573:tid 565591]
    [client 192.168.0.53:65475] /usr/local/apache2/htdocs/testdir/.htaccess:
    Option ExecCGI not allowed here
  PASS — restriction correctly blocks enabling unpermitted options.

Test 5: Attempting to enable unpermitted option (relative syntax)
  .htaccess:  Options +ExecCGI
  Result:     curl /testdir/ => 500 Internal Server Error
  Error log:
    [Thu Jun 04 11:16:06.502862 2026] [core:alert] [pid 565573:tid 565605]
    [client 192.168.0.53:65496] /usr/local/apache2/htdocs/testdir/.htaccess:
    Either all Options must start with + or -, or no Option may.
  PASS — relative syntax also subject to restriction.

Summary
-------
  Test 1: PASS  Baseline — all options active
  Test 2: PASS  Absolute syntax implicitly disables inherited options
  Test 3: PASS  Relative syntax does not cause implicit disabling
  Test 4: PASS  Restriction blocks enabling unpermitted options (absolute)
  Test 5: PASS  Restriction blocks enabling unpermitted options (relative)

Conclusion
----------
The behavior described in this bug is confirmed. "AllowOverride Options=X"
controls which options may be ENABLED by .htaccess, but cannot prevent
implicit DISABLING when absolute syntax replaces the entire option set.

The existing documentation note is technically correct but confusing. A patch
is in progress for trunk that rewrites it as a warning with a concrete example
demonstrating this behavior.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org


[Bug 70099] AllowOverride Directive misleading about effect of “AllowOverride Options=…”

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=70099

Rich Bowen <rb...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Rich Bowen <rb...@apache.org> ---
Confirmed. The reporter is correct - the subtlety this note describes is a
genuine security gotcha: an admin may believe AllowOverride Options=Indexes
prevents .htaccess from affecting other options, when in fact absolute-syntax
Options (without +/- prefixes) replaces the entire inherited set, implicitly
disabling options like FollowSymLinks or ExecCGI.

Working on a patch that rewrites the note as a warning with a concrete example.
Will commit after I've tested the example a little better.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org