Bug 1233687 (CVE-2015-4806)

Summary: CVE-2015-4806 OpenJDK: HttpURLConnection header restriction bypass (Libraries, 8130193)
Product: [Other] Security Response Reporter: Tomas Hoger <thoger>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: aazores, aph, dbhole, jvanek, omajid, security-response-team
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-26 15:23: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:
Bug Depends On:    
Bug Blocks: 1257667    

Description Tomas Hoger 2015-06-19 12:23:01 UTC
Andrea Palazzo reported the following problem affecting IcedTea-Web:

"""
Using HTTPUrlConnection it is possible to set custom values for blacklisted headers, even if allowRestrictedHeaders is false, by supplying "Name:value" as name.

Also, if needed, trailing ":" could be stripped off using an array as header value.
"""

Acknowledgement:

Red Hat would like to thank Andrea Palazzo of Truel IT for reporting this issue.

Comment 2 jiri vanek 2015-06-20 19:10:48 UTC
I'm litle bit hesitating what fix can be. To disable exactly header param? To verify it do not contain ":" or to pass only known params to url connection (or filter some known params out of it...) Thoughts?

Comment 3 jiri vanek 2015-06-23 09:33:57 UTC
Hello!

I'm unable to reproduce. Nowhere in ITW is called addRequestProperty with different then Accept-Encoding  param.

Comment 4 Tomas Hoger 2015-06-23 22:14:47 UTC
HttpURLConnection already defines a set of "restricted headers", which can not be set for HTTP connection.  This header restriction is enforced for sandboxed code.  The feature was added via:

http://hg.openjdk.java.net/jdk7u/jdk7u/jdk/rev/e0806d924a42

which is a fix for CVE-2010-3541 and CVE-2010-3573 (bug 642202).

Reported attack vector is blocked in JDK8 in URLPermission, where header name containing colon triggers error.

Related changes in JDK8:

http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/rev/93a268759ec3
https://bugs.openjdk.java.net/browse/JDK-8010464
https://bugs.openjdk.java.net/browse/JDK-8046174
http://openjdk.java.net/jeps/184

http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/rev/dd0deeb04933
https://bugs.openjdk.java.net/browse/JDK-8014719

Backporting whole JEP 184 to JDK7 and earlier is probably not an option.  Alternative to that may be performing following checks when header restrictions are enforced:

- ensure header name does not contain colon
- ensure header value is not null

Comment 6 Tomas Hoger 2015-07-02 12:44:37 UTC
This issue was reported upstream (Oracle) and got tracking id S0586943.  Issue is expected to be corrected in future updates.

Comment 7 Tomas Hoger 2015-10-18 21:13:31 UTC
The issue is being fixed in Oct 2015 CPU.

Comment 8 Tomas Hoger 2015-10-21 08:48:56 UTC
Public now via Oracle Critical Patch Update - October 2015.  Fixed in Oracle Java SE 6u105, 7u91, and 8u65.

External References:

http://www.oracle.com/technetwork/topics/security/cpuoct2015-2367953.html#AppendixJAVA

Comment 9 Tomas Hoger 2015-10-21 11:46:08 UTC
OpenJDK 8 upstream commit:

http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/rev/c00bcb8d4596

Comment 10 errata-xmlrpc 2015-10-21 18:47:27 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 5

Via RHSA-2015:1921 https://rhn.redhat.com/errata/RHSA-2015-1921.html

Comment 11 errata-xmlrpc 2015-10-21 20:58:57 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 6
  Red Hat Enterprise Linux 7

Via RHSA-2015:1920 https://rhn.redhat.com/errata/RHSA-2015-1920.html

Comment 12 errata-xmlrpc 2015-10-21 21:08:16 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 6
  Red Hat Enterprise Linux 7

Via RHSA-2015:1919 https://rhn.redhat.com/errata/RHSA-2015-1919.html

Comment 13 errata-xmlrpc 2015-10-22 18:34:46 UTC
This issue has been addressed in the following products:

  Oracle Java for Red Hat Enterprise Linux 7
  Oracle Java for Red Hat Enterprise Linux 5
  Oracle Java for Red Hat Enterprise Linux 6

Via RHSA-2015:1928 https://rhn.redhat.com/errata/RHSA-2015-1928.html

Comment 14 errata-xmlrpc 2015-10-22 18:36:11 UTC
This issue has been addressed in the following products:

  Oracle Java for Red Hat Enterprise Linux 7
  Oracle Java for Red Hat Enterprise Linux 6

Via RHSA-2015:1926 https://rhn.redhat.com/errata/RHSA-2015-1926.html

Comment 15 errata-xmlrpc 2015-10-22 18:45:00 UTC
This issue has been addressed in the following products:

  Oracle Java for Red Hat Enterprise Linux 7
  Oracle Java for Red Hat Enterprise Linux 5
  Oracle Java for Red Hat Enterprise Linux 6

Via RHSA-2015:1927 https://rhn.redhat.com/errata/RHSA-2015-1927.html

Comment 16 errata-xmlrpc 2015-11-18 16:40:48 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 5
  Red Hat Enterprise Linux 6
  Red Hat Enterprise Linux 7

Via RHSA-2015:2086 https://rhn.redhat.com/errata/RHSA-2015-2086.html

Comment 17 errata-xmlrpc 2015-11-23 12:40:58 UTC
This issue has been addressed in the following products:

  Supplementary for Red Hat Enterprise Linux 6
  Supplementary for Red Hat Enterprise Linux 5

Via RHSA-2015:2508 https://rhn.redhat.com/errata/RHSA-2015-2508.html

Comment 18 errata-xmlrpc 2015-11-23 12:42:55 UTC
This issue has been addressed in the following products:

  Supplementary for Red Hat Enterprise Linux 5

Via RHSA-2015:2507 https://rhn.redhat.com/errata/RHSA-2015-2507.html

Comment 19 errata-xmlrpc 2015-11-23 12:56:49 UTC
This issue has been addressed in the following products:

  Supplementary for Red Hat Enterprise Linux 7

Via RHSA-2015:2509 https://rhn.redhat.com/errata/RHSA-2015-2509.html

Comment 20 errata-xmlrpc 2015-11-23 13:00:48 UTC
This issue has been addressed in the following products:

  Supplementary for Red Hat Enterprise Linux 6
  Supplementary for Red Hat Enterprise Linux 7

Via RHSA-2015:2506 https://rhn.redhat.com/errata/RHSA-2015-2506.html

Comment 21 errata-xmlrpc 2015-11-25 21:16:36 UTC
This issue has been addressed in the following products:

  Supplementary for Red Hat Enterprise Linux 5
  Supplementary for Red Hat Enterprise Linux 6

Via RHSA-2015:2518 https://rhn.redhat.com/errata/RHSA-2015-2518.html

Comment 22 errata-xmlrpc 2016-07-18 13:53:35 UTC
This issue has been addressed in the following products:

  Red Hat Satellite 5.6
  Red Hat Satellite 5.7

Via RHSA-2016:1430 https://access.redhat.com/errata/RHSA-2016:1430