CVE-2017-15715 in HTTP Serverinfo

Summary

by MITRE

In Apache httpd 2.4.0 to 2.4.29, the expression specified in <FilesMatch> could match '$' to a newline character in a malicious filename, rather than matching only the end of the filename. This could be exploited in environments where uploads of some files are are externally blocked, but only by matching the trailing portion of the filename.

Be aware that VulDB is the high quality source for vulnerability data.

Analysis

by VulDB Data Team • 02/24/2023

The vulnerability identified as CVE-2017-15715 represents a critical flaw in the Apache HTTP Server software affecting versions 2.4.0 through 2.4.29. This issue stems from an improper handling of regular expression patterns within the <FilesMatch> directive, which is commonly used for access control and file filtering in web server configurations. The flaw allows for unintended pattern matching behavior that can be exploited to bypass security controls designed to block malicious file uploads.

The technical root cause of this vulnerability lies in the regular expression engine's interpretation of the dollar sign ($) character within the FilesMatch directive. Normally, the dollar sign should match only the end of a string, but in this case, the Apache httpd server incorrectly processes the pattern such that the dollar sign can match newline characters within filenames. This misinterpretation occurs specifically when processing filenames that contain embedded newlines or special characters, allowing an attacker to craft filenames that appear to match the end of a pattern while actually containing malicious content in the middle of the filename.

From an operational perspective, this vulnerability creates a significant security risk for web applications that rely on filename-based access controls. When administrators configure security policies to block uploads of specific file types by matching the trailing portion of filenames, this flaw allows attackers to bypass those protections. For example, if a server blocks files ending with .php or .asp, an attacker could upload a file named "malicious.txt\n.php" where the newline character allows the pattern matching to succeed despite the file having a different extension. This behavior effectively undermines the security controls intended to prevent execution of potentially harmful scripts.

The impact of this vulnerability extends beyond simple file access control, as it can be leveraged to circumvent various security mechanisms including upload restrictions, access control lists, and content filtering systems. Attackers can exploit this weakness to upload and execute malicious code on web servers, particularly in environments where file uploads are permitted but restricted based on filename patterns. The vulnerability aligns with CWE-128, which deals with Regular Expression Denial of Service, though it specifically addresses improper pattern matching rather than denial of service. This flaw particularly affects systems where Apache httpd serves as the primary web server and where security policies rely on filename-based filtering.

Security professionals should consider this vulnerability in relation to ATT&CK technique T1190, which covers "Exploit Public-Facing Application," and T1059, which involves "Command and Scripting Interpreter." The vulnerability enables attackers to bypass security controls and potentially gain unauthorized access to server resources. Organizations should implement immediate mitigations including upgrading to Apache httpd version 2.4.30 or later, which contains the necessary patches to fix the regular expression handling. Additionally, administrators should review existing <FilesMatch> configurations to ensure that they properly escape special characters and consider implementing additional security controls beyond filename-based filtering, such as content-based inspection and file type validation. The vulnerability demonstrates the importance of proper input validation and regular security updates in maintaining web server security.

Reservation

10/21/2017

Disclosure

03/26/2018

Moderation

accepted

CPE

ready

EPSS

0.86006

KEV

no

Activities

very low

Sources

Want to know what is going to be exploited?

We predict KEV entries!