Bug 1077871 (CVE-2014-0098)

Summary: CVE-2014-0098 httpd: mod_log_config does not properly handle logging certain cookies resulting in DoS
Product: [Other] Security Response Reporter: Vincent Danen <vdanen>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: aneelica, anil.saldhana, bdunne, cdewolf, chazlett, chuffman, dajohnso, drieden, fnasser, huwang, jawilson, jdoyle, jfrey, jkaluza, jkurik, jorton, jrafanie, jrusnack, kseifried, kshravag, lgao, mmaslano, mmcallis, mmcgrath, mstevens, mtessun, myarboro, nobody+bgollahe, obarenbo, pahan, pcheung, pfrields, pgier, pslavice, rmeggins, rsvoboda, tis, vtunka, webstack-team, weli, xlecauch
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: httpd 2.4.8 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-09-17 07:57:43 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On: 1077878, 1077885, 1077907, 1078174, 1078175, 1078176, 1078177, 1078686, 1078687, 1078688, 1078689, 1127227    
Bug Blocks: 1077876, 1078645, 1093890, 1105541, 1112035    

Description Vincent Danen 2014-03-18 18:20:19 UTC
Common Vulnerabilities and Exposures assigned an identifier CVE-2014-0098 to
the following vulnerability:

Name: CVE-2014-0098
URL: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-0098
Assigned: 20131203
Reference: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/loggers/mod_log_config.c
Reference: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/loggers/mod_log_config.c?r1=1575394&r2=1575400&diff_format=h
Reference: http://www.apache.org/dist/httpd/CHANGES_2.4.9

The log_cookie function in mod_log_config.c in the mod_log_config
module in the Apache HTTP Server before 2.4.8 allows remote attackers
to cause a denial of service (segmentation fault and daemon crash) via
a crafted cookie that is not properly handled during truncation.

Comment 1 Vincent Danen 2014-03-18 18:32:18 UTC
Created httpd tracking bugs for this issue:

Affects: fedora-all [bug 1077878]

Comment 3 Vincent Danen 2014-03-18 19:42:33 UTC
Upstream describes the problem as thus:

A flaw was found in mod_log_config. A remote attacker could send a specific truncated cookie causing a crash. This crash would only be a denial of service if using a threaded MPM.

Comment 10 Vincent Danen 2014-03-24 15:41:50 UTC
Also note that the upstream description of this flaw (from http://httpd.apache.org/security/vulnerabilities_24.html) is:

"A flaw was found in mod_log_config. A remote attacker could send a specific truncated cookie causing a crash. This crash would only be a denial of service if using a threaded MPM."

By default, Red Hat Enterprise Linux uses the Prefork MPM.

Comment 12 Tomas Hoger 2014-03-26 09:14:49 UTC
The problem here is buffer over read triggered by malformed Cookie header in the HTTP request header.  If httpd is configured to log values of a specific cookie (using %{Foobar}C format string in the LogFormat), remote attacker can cause httpd to read memory behind allocated buffer.

http://httpd.apache.org/docs/2.2/mod/mod_log_config.html#formats

String processing functions are used (strspn, strlen), hence reading stops on the first \0 byte encountered.  Depending on the memory layout, this may lead to a crash of httpd child process, which gets respawned by the httpd master process.

Cookie logging can be disabled to mitigate this issue.

Comment 13 Tomas Hoger 2014-03-26 12:33:24 UTC
While log_cookie() implementation in Red Hat Enterprise Linux 5 (and Red Hat Enterprise Linux 6 before 6.4) is different, similar buffer over read can happen there too.

Comment 19 Tomas Hoger 2014-03-28 08:13:05 UTC
(In reply to Tomas Hoger from comment #12)
> Cookie logging can be disabled to mitigate this issue.

The default httpd configuration in Red Hat Enterprise Linux does not enabled cookie logging.  Only configurations where the feature was enabled explicitly are affected by this issue.

Comment 20 Fedora Update System 2014-03-31 02:16:51 UTC
httpd-2.4.9-2.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 21 errata-xmlrpc 2014-04-03 21:00:54 UTC
This issue has been addressed in following products:

  Red Hat Enterprise Linux 5

Via RHSA-2014:0369 https://rhn.redhat.com/errata/RHSA-2014-0369.html

Comment 22 errata-xmlrpc 2014-04-03 21:01:26 UTC
This issue has been addressed in following products:

  Red Hat Enterprise Linux 6

Via RHSA-2014:0370 https://rhn.redhat.com/errata/RHSA-2014-0370.html

Comment 23 Morten Stevens 2014-04-05 18:23:25 UTC
I think it should also affect Fedora 19, but there are no updated packages for Fedora 19 available.

Fedora 19 httpd package: httpd-2.4.7-1

Comment 24 Jan Kalu┼ża 2014-04-09 08:50:51 UTC
I've just built https://admin.fedoraproject.org/updates/httpd-2.4.9-1.fc19

Comment 25 Fedora Update System 2014-04-23 04:33:22 UTC
httpd-2.4.9-1.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 26 errata-xmlrpc 2014-06-23 17:55:38 UTC
This issue has been addressed in following products:

  JBoss Enterprise Web Server 2.0.1

Via RHSA-2014:0784 https://rhn.redhat.com/errata/RHSA-2014-0784.html

Comment 27 errata-xmlrpc 2014-06-23 17:56:07 UTC
This issue has been addressed in following products:

  JBEWS 2 for RHEL 5
  JBEWS 2 for RHEL 6

Via RHSA-2014:0783 https://rhn.redhat.com/errata/RHSA-2014-0783.html

Comment 28 errata-xmlrpc 2014-07-01 15:05:05 UTC
This issue has been addressed in following products:

  JBEAP 6.2 for RHEL 5
  JBEAP 6.2 for RHEL 6

Via RHSA-2014:0826 https://rhn.redhat.com/errata/RHSA-2014-0826.html

Comment 29 errata-xmlrpc 2014-07-01 15:05:28 UTC
This issue has been addressed in following products:

  Red Hat JBoss Enterprise Application Platform 6.2

Via RHSA-2014:0825 https://rhn.redhat.com/errata/RHSA-2014-0825.html