search menu icon-carat-right cmu-wordmark

CERT Coordination Center

Apache mod_rewrite vulnerable to buffer overflow via crafted regular expression

Vulnerability Note VU#434566

Original Release Date: 2004-02-03 | Last Revised: 2004-03-19

Overview

A vulnerability in a supplementary module to the Apache HTTP server could allow an attacker to execute arbitrary code on an affected web server under certain circumstances.

Description

The Apache HTTP server distribution includes a number of supplemental modules that provide additional functionality to the web server. One of these modules, mod_rewrite, provides a rule-based rewriting engine to rewrite requested URLs "on the fly" based regular expressions. A buffer overflow has been discovered in the way that mod_rewrite handles regular expressions containing more than 9 captures (stored strings matching a particular pattern). This flaw results in a remotely exploitable vulnerability on web servers that specify such a regular expression to the mod_rewrite module in their configuration files.

Impact

An attacker may be able to execute arbitrary code in the context of the web server user (e.g., "apache", "httpd", "nobody", etc.). The attacker would have to have the ability to supply a specially crafted configuration file (e.g., .htaccess or httpd.conf) to the Apache server in order to mount this attack.

Solution

Apply a patch from the vendor

Patches have been released to address this vulnerability. Please see the Systems Affected section of this document for more details.

Workarounds


Disable mod_rewrite if it is not required in your web server configuration. Instructions for doing this can be found in the Apache HTTP server documentation. Sites, particularly those that are not able to apply the patches, are encouraged to consider implementing this workaround.

Vendor Information

434566
 

View all 13 vendors View less vendors


CVSS Metrics

Group Score Vector
Base
Temporal
Environmental

References

Acknowledgements

The Apache Software Foundation credits André Malo with the discovery of this vulnerability.

This document was written by Chad R Dougherty.

Other Information

CVE IDs: CVE-2003-0542
Severity Metric: 0.61
Date Public: 2003-10-30
Date First Published: 2004-02-03
Date Last Updated: 2004-03-19 19:59 UTC
Document Revision: 29

Sponsored by CISA.