forked from pool/apache2
- Update to 2.4.61 *) SECURITY: CVE-2024-39884: Apache HTTP Server: source code disclosure with handlers configured via AddType (cve.mitre.org) [boo#1227353] A regression in the core of Apache HTTP Server 2.4.60 ignores some use of the legacy content-type based configuration of handlers. "AddType" and similar configuration, under some circumstances where files are requested indirectly, result in source code disclosure of local content. For example, PHP scripts may be served instead of interpreted. Users are recommended to upgrade to version 2.4.61, which fixes this issue. - Update to 2.4.60 *) SECURITY: CVE-2024-39573: Apache HTTP Server: mod_rewrite proxy handler substitution (cve.mitre.org) [boo#1227271] Potential SSRF in mod_rewrite in Apache HTTP Server 2.4.59 and earlier allows an attacker to cause unsafe RewriteRules to unexpectedly setup URL's to be handled by mod_proxy. Credits: Orange Tsai (@orange_8361) from DEVCORE *) SECURITY: CVE-2024-38477: Apache HTTP Server: Crash resulting in Denial of Service in mod_proxy via a malicious request (cve.mitre.org) [boo#1227270] null pointer dereference in mod_proxy in Apache HTTP Server 2.4.59 and earlier allows an attacker to crash the server via a malicious request. Credits: Orange Tsai (@orange_8361) from DEVCORE *) SECURITY: CVE-2024-38476: Apache HTTP Server may use exploitable/malicious backend application output to run local handlers via internal redirect (cve.mitre.org) [boo#1227269] Vulnerability in core of Apache HTTP Server 2.4.59 and earlier are vulnerably to information disclosure, SSRF or local script execution via backend applications whose response headers are malicious or exploitable. Note: Some legacy uses of the 'AddType' directive to connect a request to a handler must be ported to 'AddHandler' after this fix. Credits: Orange Tsai (@orange_8361) from DEVCORE *) SECURITY: CVE-2024-38475: Apache HTTP Server weakness in mod_rewrite when first segment of substitution matches filesystem path. (cve.mitre.org) [boo#1227268] Improper escaping of output in mod_rewrite in Apache HTTP Server 2.4.59 and earlier allows an attacker to map URLs to filesystem locations that are permitted to be served by the server but are not intentionally/directly reachable by any URL, resulting in code execution or source code disclosure. Substitutions in server context that use a backreferences or variables as the first segment of the substitution are affected. Some unsafe RewiteRules will be broken by this change and the rewrite flag "UnsafePrefixStat" can be used to opt back in once ensuring the substitution is appropriately constrained. Credits: Orange Tsai (@orange_8361) from DEVCORE *) SECURITY: CVE-2024-38474: Apache HTTP Server weakness with encoded question marks in backreferences (cve.mitre.org) [boo#1227278] Substitution encoding issue in mod_rewrite in Apache HTTP Server 2.4.59 and earlier allows attacker to execute scripts in directories permitted by the configuration but not directly reachable by any URL or source disclosure of scripts meant to only to be executed as CGI. Note: Some RewriteRules that capture and substitute unsafely will now fail unless rewrite flag "UnsafeAllow3F" is specified. Credits: Orange Tsai (@orange_8361) from DEVCORE *) SECURITY: CVE-2024-38473: Apache HTTP Server proxy encoding problem (cve.mitre.org) [boo#1227276] Encoding problem in mod_proxy in Apache HTTP Server 2.4.59 and earlier allows request URLs with incorrect encoding to be sent to backend services, potentially bypassing authentication via crafted requests. Credits: Orange Tsai (@orange_8361) from DEVCORE *) SECURITY: CVE-2024-38472: Apache HTTP Server on WIndows UNC SSRF (cve.mitre.org) [boo#1227267] SSRF in Apache HTTP Server on Windows allows to potentially leak NTML hashes to a malicious server via SSRF and malicious requests or content Note: Existing configurations that access UNC paths will have to configure new directive "UNCList" to allow access during request processing. Credits: Orange Tsai (@orange_8361) from DEVCORE *) SECURITY: CVE-2024-36387: Apache HTTP Server: DoS by Null pointer in websocket over HTTP/2 (cve.mitre.org) [boo#1227272] Serving WebSocket protocol upgrades over a HTTP/2 connection could result in a Null Pointer dereference, leading to a crash of the server process, degrading performance. Credits: Marc Stern (<marc.stern AT approach-cyber.com>) OBS-URL: https://build.opensuse.org/request/show/1185778 OBS-URL: https://build.opensuse.org/package/show/Apache/apache2?expand=0&rev=704
152 lines
3.7 KiB
Bash
152 lines
3.7 KiB
Bash
#!/bin/bash
|
|
|
|
exit_code=1
|
|
|
|
function usage
|
|
{
|
|
echo "Check for directives in apache configuration (including"
|
|
echo "potentially reachable .htaccess files)"
|
|
echo ""
|
|
echo "Usage: $0 [options]"
|
|
echo ""
|
|
echo " options: "
|
|
echo " -s string system configuration root"
|
|
echo " [default: $system_conf_root]"
|
|
echo " -d string directives to search"
|
|
echo " [default: $check_directives]"
|
|
echo " -n string htaccess file name(s)"
|
|
echo " [default: $htaccess_names]"
|
|
echo " -q do not print where directive(s) was found"
|
|
echo " -v as -v plus trace and matched lines"
|
|
echo " -h this help"
|
|
echo ""
|
|
echo "Return Value: 0 at least one occurence found in apache config"
|
|
echo " 1 no occurence found"
|
|
echo " 2 wrong arguments"
|
|
echo ""
|
|
echo "Example: "
|
|
echo " $ $0 -s '/etc/apache2/default-server.conf' -n '.htaccess .htconfig' -d 'Require' -v"
|
|
echo " Checking /etc/apache2/default-server.conf .. FOUND"
|
|
echo " Checking /srv/www/htdocs/foo/.htaccess .. FOUND"
|
|
echo " Checking /etc/apache2/conf.d/gitweb.conf .. FOUND"
|
|
echo " $"
|
|
}
|
|
|
|
|
|
function find_directives_in_file
|
|
{
|
|
file=$1
|
|
|
|
pattern=$(echo $check_directives |
|
|
sed 's:\([^ \t]\+\):\\b\1\\b:g' |
|
|
sed 's:\s\+:\\|:g')
|
|
|
|
output=$(cat $file | sed 's:#.*::' | grep -i "$pattern")
|
|
if [ $? -eq 0 ]; then
|
|
[ $verbosity -ge 1 ] && echo " Checking $file .. FOUND"
|
|
[ $verbosity -ge 2 ] && echo " Output: [$output]"
|
|
exit_code=0
|
|
else
|
|
[ $verbosity -ge 2 ] && echo " Checking $file .. NOT FOUND"
|
|
fi
|
|
}
|
|
|
|
function check_conf_file
|
|
{
|
|
conf_file=$1
|
|
|
|
[ $verbosity -ge 2 ] && echo "CONFIG FILE: $conf_file"
|
|
|
|
find_directives_in_file $conf_file
|
|
|
|
# check all directories with AllowOverride not None
|
|
# for .htaccess files
|
|
directories=$(grep -i '<directory' $conf_file |
|
|
sed 's:#.*::' |
|
|
sed 's:.*<directory\s*\([^ \t]*\)\s*>:\1:I' |
|
|
tr -d '"')
|
|
|
|
find_names=$(echo $htaccess_names |
|
|
sed 's:^\s\+::' |
|
|
sed 's:\s\+$::' |
|
|
sed 's:\s\+: -o -name :g' |
|
|
sed 's:^:-name :')
|
|
|
|
for dir in $directories; do
|
|
[ $verbosity -ge 2 ] && echo " Directory: $dir"
|
|
|
|
allow_override=$(grep -i -Pzo "(?s)<directory[\s\"]*$dir.*?</directory>" $conf_file |
|
|
sed 's:#.*::'|
|
|
grep AllowOverride)
|
|
|
|
[ $verbosity -ge 2 ] && echo " override: $allow_override"
|
|
|
|
shopt -s nocasematch
|
|
if [[ ! $allow_override =~ allowoverride.*none ]]; then
|
|
for htfile in $(find $dir $find_names); do
|
|
find_directives_in_file $htfile
|
|
done
|
|
fi
|
|
shopt -u nocasematch
|
|
done
|
|
|
|
# check all Include or IncludeOptional files recursively
|
|
include_files=$(grep '^\s*Include' $conf_file |
|
|
sed 's:#.*::' |
|
|
sed 's:Include[^ ]*\s\+::' |
|
|
tr '\n' ' ')
|
|
[ $verbosity -ge 2 ] && echo " Include Files: [$include_files]"
|
|
|
|
for ifile in $include_files; do
|
|
if [ -f $ifile ]; then
|
|
check_conf_file $ifile
|
|
fi
|
|
done
|
|
}
|
|
|
|
system_conf_root="/etc/apache2/httpd.conf"
|
|
check_directives="allow deny order satisfy"
|
|
htaccess_names=".htaccess"
|
|
verbosity=1
|
|
|
|
while getopts ":hs:d:n:vq" opt; do
|
|
case $opt in
|
|
s)
|
|
system_conf_root=$OPTARG
|
|
;;
|
|
d)
|
|
check_directives=$OPTARG
|
|
;;
|
|
n)
|
|
htaccess_names=$OPTARG
|
|
;;
|
|
q)
|
|
verbosity=0
|
|
;;
|
|
v)
|
|
verbosity=2
|
|
;;
|
|
h)
|
|
usage
|
|
exit 0
|
|
;;
|
|
\?)
|
|
echo "ERROR: Invalid option: -$OPTARG" >&2
|
|
usage
|
|
exit 2
|
|
;;
|
|
:)
|
|
echo "ERROR: Option -$OPTARG requires an argument." >&2
|
|
usage
|
|
exit 2
|
|
;;
|
|
esac
|
|
done
|
|
|
|
check_conf_file $system_conf_root
|
|
|
|
exit $exit_code
|
|
|
|
|
|
|