apache2/apache2-start_apache2
David Anes 7a70b52ac1 Accepting request 1185778 from home:adkorte:branches:Apache
- 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
2024-07-08 10:21:09 +00:00

184 lines
5.3 KiB
Bash

#!/bin/sh
#
# Copyright (c) 1996, 1997, 1998 S.u.S.E. GmbH
# Copyright (c) 1998, 1999, 2000, 2001 SuSE GmbH
# Copyright (c) 2002, 2003, (2004?) SuSE Linux AG
# Copyright (c) 2004(?), 2005, 2006, 2007, 2008 SUSE Linux Products GmbH
#
# Authors: Rolf Haberrecker <apache@suse.de>, 2001
# Peter Poeml <apache@suse.de>, 2002, 2003, 2004, 2005, 2006, 2007,
# 2008, 2009, 2010
#
#
. /usr/share/apache2/script-helpers
#
# which instance should we will run, comes from
# apache2@ service file
#
unset instance_suffix
if [ -n "$START_APACHE_INSTANCE" ]; then
instance_suffix="@$START_APACHE_INSTANCE"
fi
#
# load sysconfig variables APACHE_* from instance sysconfig
# file; START_APACHE_SYSCONFIG_FILE can be used for change the system
# default (e. g. for testing purposes)
#
export HTTPD_SYSCONFIG_FILE=${START_APACHE_SYSCONFIG_FILE:-/etc/sysconfig/apache2${instance_suffix}}
load_sysconfig
#
# dir to locate pid file into; START_APACHE_RUN_DIR can be used
# to change the system default (e. g. for testing purposes)
#
run_dir="${START_APACHE_RUN_DIR:-/run}"
unset server_flags
#
# server_flags: -DSYSCONFIG
#
if [ -f "$HTTPD_SYSCONFIG_FILE" ]; then
server_flags="$server_flags -DSYSCONFIG"
fi
#
# figure out correct apache2 binary (/usr/sbin/httpd-prefork,
# /usr/sbin/httpd-worker, etc.) and serverflags
#
find_mpm
if [ -n "$HTTPD_MPM" ]; then
apache_bin="$HTTPD_SBIN_BASE-$HTTPD_MPM"
if ! [ -x $apache_bin ]; then
echo >&2 "$apache_bin-$APACHE_MPM is not a valid httpd binary."
echo >&2 "Check your APACHE_MPM setting in /etc/sysconfig/apache2."
exit 1
fi
else
# take /usr/sbin/httpd, which will
# exist thanks to update alternatives
apache_bin="$HTTPD_SBIN_BASE"
fi
# server flags from APACHE_SERVER_FLAGS
for i in $APACHE_SERVER_FLAGS; do
case $i in
-D) ;;
-D*) server_flags="$server_flags $i";;
*) server_flags="$server_flags -D$i";;
esac
done
#
# head configuration file
#
httpd_conf=${APACHE_HTTPD_CONF:-/etc/apache2${instance_suffix}/httpd.conf}
#
# where to write configuration depending on sysconfig variables
#
sysconfd_dir=$(dirname $httpd_conf)/sysconfig${instance_suffix}.d/
#
# set PidFile to this file name; PidFile should not
# be used in the configuration to change this, otherwise
# stopping will not work
#
pid_file=$run_dir/httpd${instance_suffix}.pid
#
# involve the sysconfig variables
#
[ -d ${sysconfd_dir} ] || mkdir -p ${sysconfd_dir} || exit 1
for c in global.conf include.conf loadmodule.conf; do
echo "# File generated from $HTTPD_SYSCONFIG_FILE, do not edit. Edit the sysconfig file instead." > ${sysconfd_dir}/$c
done
# APACHE_ACCESS_LOG -> global.conf
if [ -n "$APACHE_ACCESS_LOG" ]; then
echo "CustomLog $APACHE_ACCESS_LOG" | sed 's:,:\nCustomLog :' >> ${sysconfd_dir}/global.conf
fi
# APACHE_CONF_INCLUDE_FILES -> include.conf
for file in $APACHE_CONF_INCLUDE_FILES; do
test ${file:0:1} = / || file=/etc/apache2/$file
if [ ! -e $file ]; then
continue
fi
echo "Include $file" >> ${sysconfd_dir}/include.conf
done
# APACHE_CONF_INCLUDE_DIRS -> include.conf
for dir in $APACHE_CONF_INCLUDE_DIRS; do
test ${dir:0:1} = / || dir=/etc/apache2/$dir
if ! ( [ -e $dir ] || [ -e ${dir%/*} ] ); then
continue
fi
echo "Include $dir" >> ${sysconfd_dir}/include.conf
done
# APACHE_SERVERADMIN -> global.conf
if [ -n "$APACHE_SERVERADMIN" ]; then
echo "ServerAdmin $APACHE_SERVERADMIN" >> ${sysconfd_dir}/global.conf
fi
# APACHE_SERVERNAME -> global.conf
if [ -n "$APACHE_SERVERNAME" ]; then
echo "ServerName $APACHE_SERVERNAME" >> ${sysconfd_dir}/global.conf
fi
# APACHE_START_TIMEOUT
# not used nowadays
# APACHE_SERVERSIGNATURE -> global.conf
if [ -n "$APACHE_SERVERSIGNATURE" ]; then
echo "ServerSignature $APACHE_SERVERSIGNATURE" >> ${sysconfd_dir}/global.conf
fi
# APACHE_LOGLEVEL -> global.conf
if [ -n "$APACHE_LOGLEVEL" ]; then
echo "LogLevel $APACHE_LOGLEVEL" >> ${sysconfd_dir}/global.conf
fi
# APACHE_USE_CANONICAL_NAME -> global.conf
if [ -n "$APACHE_USE_CANONICAL_NAME" ]; then
echo "UseCanonicalName $APACHE_USE_CANONICAL_NAME" >> ${sysconfd_dir}/global.conf
fi
# APACHE_SERVERTOKENS -> global.conf
if [ -n "$APACHE_SERVERTOKENS" ]; then
echo "ServerTokens $APACHE_SERVERTOKENS" >> ${sysconfd_dir}/global.conf
fi
# APACHE_TACEENABLE -> global.conf
if [ -n "$APACHE_TRACEENABLE" ]; then
echo "TraceEnable $APACHE_TRACEENABLE" >> ${sysconfd_dir}/global.conf
fi
# APACHE_EXTENDED_STATUS -> global.conf
if [ -n "$APACHE_EXTENDED_STATUS" ]; then
if [ "$APACHE_EXTENDED_STATUS" == "lua" ]; then
server_flags="$server_flags -DLUA_STATUS"
elif [ "$APACHE_EXTENDED_STATUS" == "on" ]; then
server_flags="$server_flags -DEXTENDED_STATUS"
fi
fi
# APACHE_MODULES -> loadmodule.conf
get_module_list
module_ids=($HTTPD_MODULE_IDS)
module_paths=($HTTPD_MODULE_PATHS)
for i in "${!module_ids[@]}"; do
echo "LoadModule ${module_ids[$i]} ${module_paths[$i]}" >> ${sysconfd_dir}/loadmodule.conf
done
#
# a proper home should be set, otherwise the server might end up
# with HOME=/root and some script might try to use that
#
HOME=/var/lib/apache2${instance_suffix}
#
# run Apache
#
exec $apache_bin $server_flags \
-C "PidFile $pid_file" \
-C "Include $sysconfd_dir/loadmodule.conf" \
-C "Include $sysconfd_dir/global.conf" \
-f $httpd_conf \
-c "Include $sysconfd_dir/include.conf" \
$@
exit 0