exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

apache2047.txt

apache2047.txt
Posted Jan 31, 2004
Authored by Trung - caothuvolam | Site security.com.vn

In the Apache httpd server version 2.0.47, a user can bypass a Deny directive by setting the ErrorDocument directive in their .htaccess file to access a php script which can then access the data they should be denied.

tags | exploit, php
SHA-256 | d2263f39b7545054db660f7e8f771995d42e67cdd3702d21ae045cec018945c0

apache2047.txt

Change Mirror Download


APACHE HTTPD SERVER (current version 2.0.47):
##########################################################
How to return files in a Apache Deny All directory.
The Directives controlling host access may be bypassed even
if they have not permission to be override.

11 Jan 2004


DESCRIPTION

Apache Web Server allows manage configurations via the main
httpd.conf file, and via the other configuration files placed
inside the children web trees, may owned by the user accounts,
named .htaccess by default. The server administrator further
controls what Directives may be placed in .htaccess files by
configuring the AllowOverride Directive in the main httpd.conf
files.

If the server admin sets the Deny Directive to All (for example),
and does not allow the user accounts to modify this Directive in
their .htaccess file by setting the AllowOverride values without
the Limit type, his/her users are still able to bypass the Deny
option by using the ErrorDocument Directive.

Tested in Apache 2.0.47/RH-Linux/WinXP.


EXAMPLE

##########################################################
# In the main httpd.conf file:
#
<Directory />
AllowOverride FileInfo
Deny From All
</Directory>
##########################################################

##########################################################
# In the user's .htaccess file placed in a child directory:

ErrorDocument 403 /child/dir/fetch.php

##########################################################

/********************************************************/
<?php
// In the fetch.php placed in the same directory:

$url = parse_url( $_SERVER['REQUEST_URI'] );
@include basename( $url['path'] );

?>
/********************************************************/


In this example, assuming the web server can execute PHP script
or some scripts/server-includes. By modifying some codes you can
return other mime file types such as image/gif etc.

Event if the server does not allow any file parsed (Deny From All),
the script file fetch.php will still be executed, and it includes
again and parses any other files in a same directory, which
indecated by the query variables, to the web client.

Looking in the source code, I think the missing auth checking is in
the function ap_process_request_internal() in the file request.c.
One of the major changes in Apache 2.0 is to the internal redirect
mechanism. To prevent the code from falling out of sync again in the
current directory, the configuration comparing between two config
directories may bypass the authentication checking again. That
explains why this vulnerability (if any?) can only done if the
redirect ErrorDocument file is placed in the same request directory.



FIX

Do not skip auth checker even if the per_dir_config member value
doesn't change in the ap_process_request_internal() function.


NOTE

I post this issue in the public mailing list, because I think this
vuln is not exploitable by a remote attacker. If something were
wrong, drop a line to me.


Vietnamese Security Group
Trung - caothuvolam - trungonly@yahoo.com
http://www.security.com.vn

31 Nui Truc st. Ba Dinh dist. Ha Noi . Vietnamese
Phone : 84.4.8465701 / Fax: 84.4.8465701
Login or Register to add favorites

File Archive:

July 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Jul 1st
    27 Files
  • 2
    Jul 2nd
    10 Files
  • 3
    Jul 3rd
    35 Files
  • 4
    Jul 4th
    27 Files
  • 5
    Jul 5th
    18 Files
  • 6
    Jul 6th
    0 Files
  • 7
    Jul 7th
    0 Files
  • 8
    Jul 8th
    28 Files
  • 9
    Jul 9th
    44 Files
  • 10
    Jul 10th
    24 Files
  • 11
    Jul 11th
    25 Files
  • 12
    Jul 12th
    11 Files
  • 13
    Jul 13th
    0 Files
  • 14
    Jul 14th
    0 Files
  • 15
    Jul 15th
    0 Files
  • 16
    Jul 16th
    0 Files
  • 17
    Jul 17th
    0 Files
  • 18
    Jul 18th
    0 Files
  • 19
    Jul 19th
    0 Files
  • 20
    Jul 20th
    0 Files
  • 21
    Jul 21st
    0 Files
  • 22
    Jul 22nd
    0 Files
  • 23
    Jul 23rd
    0 Files
  • 24
    Jul 24th
    0 Files
  • 25
    Jul 25th
    0 Files
  • 26
    Jul 26th
    0 Files
  • 27
    Jul 27th
    0 Files
  • 28
    Jul 28th
    0 Files
  • 29
    Jul 29th
    0 Files
  • 30
    Jul 30th
    0 Files
  • 31
    Jul 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close