Vulnerability Note VU#526012

Oracle JavaServer Faces contains multiple vulnerabilities

Original Release date: 18 Oct 2013 | Last revised: 21 Oct 2013

Overview

Oracle JavaServer Faces contains multiple vulnerabilities which could allow an attacker to obtain sensitive information.

Description

Oracle JavaServer Faces contains multiple vulnerabilities which could allow an attacker to obtain sensitive information.

Alex Kouzemtchenko and Jon Passki of Coverity Security Research Labs vulnerability report states Oracle JavaServer Faces contains the following vulnerabilities:

  • Partial Directory Traversal Via Resource Identifier (CWE-22): A defect exists that allows for directory traversal within the application. The directory traversal is limited in that it cannot be used to escape from the application and access arbitrary files on the application server. The following URL will access the WEB-INF/web.xml file assuming the JSF suffix of ".jsf" is used and ".xml" is not excluded: http://www.example.com/someApp/javax.faces.resource.../WEB-INF/web.xml.jsf
  • Partial Directory Traversal Via Library Name (CWE-22). A defect exists that allows for directory traversal within the application. The directory traversal is limited in that it cannot be used to escape from the application and access arbitrary files on the application server. The following URL will access the ``WEB-INF/web.xml`` file assuming the JSF suffix of ".jsf" is used and ".xml" is not excluded: http://www.example.com/someApp/javax.faces.resource./WEB-INF/web.xml.jsf?ln=..
  • Encryption Context Parameter Incorrectly Documented (CWE-705). The [documented][ClientStateSavingPassword] mechanism to encrypt the ViewState parameter is to add the following JNDI environmental variable to web.xml:

    <env-entry>
    <env-entry-name>com.sun.faces.ClientStateSavingPassword</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>[SOME VALUE]</env-entry-value>
    </env-entry>

    During initialization, the ``ClientStateSavingPassword`` enum member uses the ``WebEnvironmentEntry(String qualifiedName)`` constructor, passing in the string "ClientStateSavingPassword". This results in a qualified name of ``java:comp/env/ClientStateSavingPassword``. Following the documentation results in a qualified name of ``java:comp/env/com.sun.faces.ClientStateSavingPassword``. The ``com.sun.faces.renderkit.ClientSideStateHelper.init()`` checks for the ``ClientStateSavingPassword`` web configuration value when determining if its ``guard`` field ought to be initialized via ``com.sun.faces.renderkit.ByteArrayGuard``. If no match is found, encryption and decryption is not used on the ViewState parameter.
  • ViewState HMAC Not Verified in Constant Time (CWE-367). When a proper ``ClientStateSavingPassword`` is set for the application, the ``com.sun.faces.renderkit.ByteArrayGuard.decrypt(byte[])`` method is eventually called to decipher the supplied value. An Hashed-Based Message Authentication Code (HMAC) is obtained from the decoded byte array, stored in the ``macBytes`` variable. A new HMAC is generated on the supplied ciphertext and its value is stored in the ``macBytesCalculated`` variable. These variables are then compared in a non-constant time fashion via the following:

    if (Arrays.equals(macBytes, macBytesCalculated)) {
    // continue only if the MAC was valid
    // System.out.println("Valid MAC found!");
    byte[] plaindata = decryptCipher.doFinal(encdata);
    return plaindata;

    Arrays.equals has been show to have measurable timing delays when checking byte values. This may allow an attacker on a LAN to measure these delays, obtain a timing side channel, and subsequently generate an HMAC value that is valid for
    a given ciphertext, bypassing the control.

For additional information see Oracle Critical Patch Update Advisory - October 2013.

Impact

A remote unauthenticated attacker may obtain sensitive information.

Solution

These vulnerabilities have been addressed in Oracle Critical Patch Update Advisory - October 2013. Affected users are advised to apply the recommended Critical Path updates listed in the Oracle Critical Patch Update Advisory - October 2013 for CVE-2013-3827.

Restrict access

As a general good security practice, only allow connections from trusted hosts and networks. Restricting access would prevent an attacker from accessing JavaServer Faces using stolen credentials from a blocked network location.

Vendor Information (Learn More)

VendorStatusDate NotifiedDate Updated
Oracle CorporationAffected11 Feb 201317 Oct 2013
If you are a vendor and your product is affected, let us know.

CVSS Metrics (Learn More)

Group Score Vector
Base 5.0 AV:N/AC:L/Au:N/C:P/I:N/A:N
Temporal 4.1 E:F/RL:OF/RC:C
Environmental 3.5 CDP:L/TD:M/CR:ND/IR:ND/AR:ND

References

Credit

Thanks to Alex Kouzemtchenko and Jon Passki of Coverity Security Research Labs for reporting this vulnerability.

This document was written by Michael Orlando.

Other Information

  • CVE IDs: CVE-2013-3827
  • Date Public: 15 Oct 2013
  • Date First Published: 18 Oct 2013
  • Date Last Updated: 21 Oct 2013
  • Document Revision: 16

Feedback

If you have feedback, comments, or additional information about this vulnerability, please send us email.