Software Engineering Institute

Oracle JavaServer Faces contains multiple vulnerabilities

Vulnerability Note VU#526012

Original Release Date: 2013-10-18 | Last Revised: 2013-10-21

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.jsfPartial 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:com.sun.faces.ClientStateSavingPasswordjava.lang.String[SOME VALUE]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 fora 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 accessAs 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.

526012

Oracle Corporation Affected

Notified:  February 11, 2013 Updated: October 17, 2013

Affected

Vendor Statement

We have not received a statement from the vendor.

Vendor Information

We are not aware of further vendor information regarding this vulnerability.

CVSS Metrics

Group Score Vector
Base 5 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

Acknowledgements

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: 2013-10-15 Date First Published: 2013-10-18 Date Last Updated: 2013-10-21 11:28 UTC Document Revision: 17