Projects
New Ticket     Wiki     Browse Source     Timeline     Roadmap     Bug Reports     Search

Ticket #7277 (closed defect: fixed)

Opened 3 years ago

Last modified 4 weeks ago

Protect .ht* files case insensitively by default (apache2 port)

Reported by: ryandesign@… Owned by: imajes@…
Priority: High Milestone: Port Bugs
Component: ports Version:
Keywords: Cc: nox@…
Port: apache2, apache20, apache

Description (last modified by jmpp@…) (diff)

By default the apache2 port installs an httpd.conf containing this section which is supposed to prevent malicious users from reading the contents of .htaccess or .htpasswd files:

# The following lines prevent .htaccess and .htpasswd files from being 
# viewed by Web clients. 
#
<FilesMatch "^\.ht">
    Order allow,deny
    Deny from all
</FilesMatch>

This is insufficient on file systems which are case insensitive, such as Mac OS X's default HFS+ file system. Mac OS X also has other files and directories inside each directory which must not be made accessible to web visitors. See Apple's knowledge base article:

http://docs.info.apple.com/article.html?artnum=300422

The updated rules provided in that knowledge base article should be patched into the default httpd.conf file provided through darwinports so that users are by default protected from this problem.

Someone should also examine the apache 1 port to see if it suffers from the same problem, and patch it too if necessary (possibly creating a separate bug report if necessary).

This issue is related a bit to bug #803.

Attachments

apache2.diff (3.2 KB) - added by ryandesign@… 10 months ago.

Change History

Changed 16 months ago by nox@…

  • cc nox@… added
  • priority changed from Expected to High
  • version 1.2 deleted
  • milestone set to Port Bugs

As this is a security issue, I've set the priority to High

Changed 10 months ago by nox@…

  • cc ryandesign@… added
  • owner changed from james@… to imajes@…

Maybe we should fix it without James approval? That's a security issue.

Changed 10 months ago by jmpp@…

  • description modified (diff)

Changed 10 months ago by imajes@…

now that this has been bumped up a bit it's on my radar... i'll try attack it this weekend.

anyone who wants to submit a patch is welcome- i'll apply if i get one.

Changed 10 months ago by ryandesign@…

This patch fixes the issue like kbase article 300422 says we should and therefore also increases the port revision.

Also changing the fix for #7273 (r17933) from reinplaces to a patchfile. This is better because we get no notification if a reinplace ever fails, but we do if a patchfile fails.

Also making the changing of the user and group under which the server runs a patchfile again instead of a reinplace (undoing this change from r33568). It really has no business being a reinplace. This is a job for a patchfile. Also, this seems to be Mac OS X-specific, so it's going into the platform darwin section.

To apply this patch please do this:

cd `port dir apache2`
svn mkdir files
svn cp -r 33567 http://svn.macosforge.org/repository/macports/trunk/dports/www/apache2/files/patch-httpd-std.conf.in files/patch-httpd.conf.in.diff
patch -p0 < ~/Desktop/apache2.diff
svn add files/patch-httpd-userdir.conf.in.diff

Changed 10 months ago by ryandesign@…

Changed 8 weeks ago by nox@…

this ticket is a security issue and should be taken care of.

Changed 7 weeks ago by ryandesign@…

  • cc ryandesign@… removed
  • port set to apache2, apache20, apache
  • reporter changed from opendarwin-2006@… to ryandesign@…

Changed 4 weeks ago by nox@…

  • status changed from new to closed
  • resolution set to fixed

Fixed in r41709, see #17078.

Note: See TracTickets for help on using tickets.