Hide Forgot
Vincent Danen 2011-11-02 17:14:55 EDT It was reported [1] that an integer overflow was found in Apache in the ap_pregsub() 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 ap_pregsub() 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, mod_setenvif 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 mod_setenvif. [1] http://www.halfdog.net/Security/2011/ApacheModSetEnvIfIntegerOverflow/
This issue was originally tracked with CVE-2011-4415 via bug #750935. Patch for this issue was added upstream to trunk (future 2.4.x httpd versions) via following commit: http://svn.apache.org/viewvc?view=revision&revision=1198940 That fix is not applicable to older httpd versions, such as 2.2.x. There still on-going upstream discussion on how to address this in older httpd versions: http://thread.gmane.org/gmane.comp.apache.devel/46260
There are still no follow up on this discussion.
Following fix is already committed in upstream SVN for 2.2.x: http://svn.apache.org/viewvc?view=revision&revision=1227280
Theese are the only exploits/reproducers currently available/released for this: http://www.halfdog.net/Security/2011/ApacheModSetEnvIfIntegerOverflow/DemoExploit.html
This issue has been addressed in following products: Red Hat Enterprise Linux 6 Via RHSA-2012:0128 https://rhn.redhat.com/errata/RHSA-2012-0128.html
This issue has been addressed in following products: Red Hat Enterprise Linux 5 Via RHSA-2012:0323 https://rhn.redhat.com/errata/RHSA-2012-0323.html
This issue has been addressed in following products: JBoss Enterprise Web Server 1.0.2 Via RHSA-2012:0543 https://rhn.redhat.com/errata/RHSA-2012-0543.html
This issue has been addressed in following products: JBEWS 1.0 for RHEL 5 JBEWS 1.0 for RHEL 6 Via RHSA-2012:0542 https://rhn.redhat.com/errata/RHSA-2012-0542.html