CVE-2011-3607: Buffer Overflow
Integer overflow in the appregsub function in server/util.c in the Apache HTTP Server 2.0.x through 2.0.64 and 2.2.x through 2.2.21, when the modsetenvif module is enabled, allows local users to gain privileges via a .htaccess file with a crafted SetEnvIf directive, in conjunction with a crafted HTTP request header, leading to a heap-based buffer overflow.
Other sources
Vincent Danen 2011-11-02 17:14:55 EDT
It was reported [1] that an integer overflow was found in Apache in the appregsub() function called from mod-setenvif. When a header field is mangled using SetEnvIf, the new environment variable data can be multiples of the size of the submitted header field. This would cause appregsub() to overflow the length value in buffer size calculations, leading to the subsequent allocation call of a too-small buffer. Filling this buffer with user-supplied data will lead to a buffer overflow.
Depending on the input data, this can lead to excessive allocation of server memory (resulting in killed processes due to out-of-memory conditions), invalid memory access when copying large amounts of data (which can lead to a termination of the httpd process), or possibly allowing the execution of arbitrary code.
To trigger this flaw, modsetenvif must be enabled (the default) and the attacker needs to be able to place a crafted .htaccess file on the server (which, in most cases, would require local access to the file system or some web interface that allows for writing arbitrary files to the local file system, such as for custom .htaccess files).
There is currently no upstream fix, however to work around the problem, disable modsetenvif.
[1] http://www.halfdog.net/Security/2011/ApacheModSetEnvIfIntegerOverflow/
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2011-3607?
CVE-2011-3607 is classified as a medium severity vulnerability.
How do I fix CVE-2011-3607?
To fix CVE-2011-3607, upgrade to Apache HTTP Server version 2.2.22 or later.
Who is affected by CVE-2011-3607?
CVE-2011-3607 affects users running Apache HTTP Server 2.0.x versions up to 2.0.64 and 2.2.x versions up to 2.2.21 with mod_setenvif enabled.
What causes CVE-2011-3607?
CVE-2011-3607 is caused by an integer overflow in the ap_pregsub function in the Apache HTTP Server.
Can local users exploit CVE-2011-3607?
Yes, local users can exploit CVE-2011-3607 to gain elevated privileges via a specially crafted .htaccess file.