Bug 1560614 (CVE-2017-15715)

Summary: CVE-2017-15715 httpd: <FilesMatch> bypass with a trailing newline in the file name
Product: [Other] Security Response Reporter: Adam Mariš <amaris>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: adam.schmitz, apmukher, bnater, b.prins, csutherl, dffrench, drusso, gandavar, gzaronik, hhorak, jclere, jdoyle, jkaluza, jmadigan, jorton, jshepherd, kbost, lgao, lgriffin, luhliari, mbabacek, mturk, myarboro, ngough, pahan, pslavice, pwright, rrajasek, rsvoboda, sardella, security-response-team, tcrider, trepel, twalsh, weli, yozone
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: httpd 2.4.30 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-06-10 10:18:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1560615, 1560618, 1565491, 1565492, 1565493    
Bug Blocks: 1560402    

Description Adam Mariš 2018-03-26 15:02:01 UTC
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 externally blocked, but only by matching the trailing portion of the filename.

Versions Affected:
httpd 2.4.0 to 2.4.29

External References:

https://httpd.apache.org/security/vulnerabilities_24.html

Comment 2 Adam Mariš 2018-03-26 15:04:38 UTC
Created httpd tracking bugs for this issue:

Affects: fedora-all [bug 1560618]

Comment 4 Huzaifa S. Sidhpurwala 2018-04-10 06:43:03 UTC
Upstream patch:

https://svn.apache.org/viewvc?view=revision&revision=1824339

As per the upstream changelog, the following change was made for this flaw:

Configure the regular expression engine to match '$' to the end of
the input string only, excluding matching the end of any embedded 
newline characters. Behavior can be changed with new directive 
'RegexDefaultOptions'.

Comment 12 errata-xmlrpc 2018-11-13 08:36:04 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 6
  Red Hat Software Collections for Red Hat Enterprise Linux 7
  Red Hat Software Collections for Red Hat Enterprise Linux 7.4 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.5 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.6 EUS

Via RHSA-2018:3558 https://access.redhat.com/errata/RHSA-2018:3558

Comment 13 errata-xmlrpc 2019-02-18 16:55:43 UTC
This issue has been addressed in the following products:

  Red Hat JBoss Core Services

Via RHSA-2019:0366 https://access.redhat.com/errata/RHSA-2019:0366

Comment 14 errata-xmlrpc 2019-02-18 16:58:23 UTC
This issue has been addressed in the following products:

  JBoss Core Services on RHEL 6
  JBoss Core Services on RHEL 7

Via RHSA-2019:0367 https://access.redhat.com/errata/RHSA-2019:0367

Comment 20 Cedric Buissart 2020-02-11 16:54:54 UTC
Statement:

The "FilesMatch" directive is not enabled in the default httpd configuration as shipped with Red Hat Enterprise Linux, and needs to be explicitly enabled. Therefore this flaw has no impact on the default versions of the httpd package as shipped with Red Hat Enterprise Linux.

Red Hat Satellite 6 uses Red Hat Enterprise Linux 7's httpd package, and enables the "FilesMatch" directive. However, this is not believed to have an impact on security, as, in the context of a Satellite, no one is expected to have the ability to modify file names in the concerned directories. This is not considered as a vector for attack.

Comment 21 errata-xmlrpc 2020-09-29 20:07:19 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2020:3958 https://access.redhat.com/errata/RHSA-2020:3958