BugTraq
SEC Consult SA-20180503-0 :: Authentication Bypass in Oracle Access Manager (OAM) May 03 2018 11:15AM
SEC Consult Vulnerability Lab (research sec-consult com)
We have published an accompanying blog post to this technical advisory with
further information:

Blog:
https://www.sec-consult.com/en/blog/2018/05/oracle-access-managers-ident
ity-crisis/

Demo video: https://www.youtube.com/watch?v=YK7_1NozAwQ

SEC Consult Vulnerability Lab Security Advisory < 20180503-0 >
=======================================================================
title: Authentication Bypass
product: Oracle Access Manager
vulnerable version: 11.1.2.3.0, 12.2.1.3.0
fixed version: April 2018 CPU
CVE number: CVE-2018-2879
impact: Critical
homepage: https://www.oracle.com/
found: 2017-11
by: W. Ettlinger (Office Vienna)
SEC Consult Vulnerability Lab

An integrated part of SEC Consult
Europe | Asia | North America

https://www.sec-consult.com

=======================================================================

Vendor description:
-------------------
"Oracle Access Management provides innovative new services that complement
traditional access management capabilities. It not only provides Web SSO with
MFA, coarse grained authorization and session management but also provides
standard SAML Federation and OAuth capabilities to enable secure access to
external cloud and mobile applications. It can be easily integrated with the
Oracle Identity Cloud Service to support hybrid access management capabilities
that can help customers to seamlessly protect on-premise and cloud applications
and workloads."

URL: http://www.oracle.com/technetwork/middleware/id-mgmt/index-090417.html

Business recommendation:
------------------------
SEC Consult did not conduct a full security audit as only a cryptographic
implementation was analyzed. However, since the vulnerability was found in such
a central component of the OAM, we suspect that an insufficient amount of
attention has been given to information security.

Given the central position in an organization's security infrastructure, we
recommend Oracle's customers to either conduct a full audit of the component
or to request the results of such audits from Oracle.

The security patches from the Oracle CPU April 2018 have to be applied
immediately!

Vulnerability overview/description:
-----------------------------------
Due to an improper usage of the CBC encryption mode, Oracle Access Manager (OAM)
is vulnerable to an authentication bypass vulnerability. An attacker can abuse
this vulnerability to log in to any resource protected by the OAM using any user
account, even administrative accounts! This security vulnerability completely
breaks the main functionality of the OAM product.

An attacker can create a scenario in which the OAM replies differently depending
on whether the PKCS#7 padding of an encrypted message is valid or invalid. This
behavior can be used to mount a padding oracle attack. An attacker can decrypt
and encrypt several messages used to communicate between the OAM and web
servers. The attack described here allows an attacker to create arbitrary
authentication cookies which are accepted by the OAM.

Proof of concept:
-----------------
A successful user authentication with Oracle Access Manager (OAM) involves the
following steps:

1. The user accesses a protected resource.
2. A component in the web server (the Oracle Webgate) answers this request with
a redirect to the OAM. An encrypted message ("encquery") is passed to the OAM
in a URL parameter.
3. The user authenticates against the OAM (e.g. with username and password).
4. The OAM redirects the user back to the web server. Information about the
successful login is passed in the parameter "encreply".
5. The web server redirects the user to the resource that was initially
requested. An encrypted authentication token is stored in a cookie
(OAMAuthnCookie).
6. The authentication token in the OAMAuthnCookie cookie is used from now on
to authenticate the user.

All three encrypted messages (encquery, encreply, OAMAuthnCookie) are encrypted
with a CBC cipher using the same key. This key is shared between the OAM and the
web server.

The attack exploits step 2 of the authentication process: the attacker sends
manipulated "encquery" parameters and observes the server's response.

The following shows an example of a decrypted encquery:
salt=sF/vMVV0Gkr/k+IhbrXYWg== wh=agentid wu=%2F wo=1 rh=http://server:7777 ru=%2F
reqtime=1510000000 ctx=<some base64 data> validate=<base64 hash>

where
* the "salt" is a randomly generated value
* "validate" is a hash over certain parts of the message (MD5)

To conduct a padding oracle attack, an attacker would modify the second last
encrypted block of an encrypted message. Most of the time, this causes the
padding in the decrypted message to be invalid. In case the padding is accepted,
the attacker gains information about the plain text.

Therefore, a vulnerable application would leak whether the padding is correct.
However, the OAM responds to any simple modification of the cipher text with the
same error message. This even happens if the plain text can successfully be
decrypted but contains a message with valid syntax. This is due to the fact that
the "validate" parameter (i.e. the MD5 hash) becomes invalid.

Another approach is to send a valid unmodified "encquery" and append the message
to be checked for valid padding. The decryption would either fail due to
invalid padding or (if the padding is correct) the OAM would receive a plain
text like this:

... validate=<base64 hash><garbage>

If the OAM would ignore the garbage suffix, an attack would be possible, since
the attacker could distinguish between correctly padded messages (no error
message) and incorrectly padded messages (error message). This, however, is not
the case since the garbage data is considered to be part of the "validate"
parameter. The expected validate hash would therefore differ from the calculated
hash.

If the garbage message would contain a space character at the first position,
the parser would correctly recognize the end of the validate hash:

... validate=<base64 hash> <garbage>

In order to achieve this the following approach was chosen:
1. Induce the web server to encrypt a message the length of which is divisible
by the block length. This can be achieved by influencing one of the plain
text values that is encrypted (e.g. URL of the requested resource).
The last block would contain only padding bytes:

|---------------|---------------|
< valid msg ><padding bytes >

2. Brute-force the block after the valid message. When the server does not
respond with an error message, a block was found where the first byte of the
decryption is a space character. The last two blocks of the original message
are appended to always create a valid padding:

|---------------|---------------|---------------|---------------|
< valid msg >< brute force >< last 2 blocks of orig. msg >

3. The message found can then be used as a prefix for a padding oracle attack.
The only case in which the server would respond with an error message
is if the padding was invalid.

SEC Consult developed a simple Python script that allows an attacker to create
an arbitrary OAMAuthnCookie for any user. For now this script will not be
published.

Vulnerable / tested versions:
-----------------------------
The versions 11g (11.1.2.3.0) and 12c (12.2.1.3.0) of Oracle Access Manager were
found to be vulnerable. The authentication bypass scenario was only verified in
version 12c.

Vendor contact timeline:
------------------------
2017-11-20: Sending encrypted advisory to secalert_us (at) oracle (dot) com [email concealed];
communicating preliminary advisory release date 2018-01-09
2017-11-20: Initial response: Issue will be investigated
2017-12-14: Oracle: Patch will not be released in January CPU due to the
backporting, regression and integration testing process required;
asked for postponed release date
2017-12-15: Postponing release date to the April CPU
2017-12-24: Monthly status update from Oracle:
Under investigation / Being fixed in main codeline
2018-01-25: Monthly status update from Oracle:
Issue fixed in main codeline, scheduled for a future CPU
2018-02-22: Asking whether the release date can be held
2018-02-22: Oracle confirms April CPU date
2018-02-23: Monthly status update from Oracle:
Issue fixed in main codeline, scheduled for a future CPU
2018-03-12: Informing Oracle of second identified attack scenario (affecting
versions 11g and 12c); asking whether patch addresses this issue too
2018-03-13: Oracle: the patch addresses both issues
2018-03-23: Monthly status update from Oracle:
Issue fixed in main codeline, scheduled for a future CPU
2018-04-17: Oracle releases April 2018 CPU including the patch
2018-05-03: Release of the security advisory.

Solution:
---------
Apply the patch provided through the Oracle April 2018 Critical Patch Update:

http://www.oracle.com/technetwork/security-advisory/cpuapr2018-3678067.h
tml

Moreover, the configuration of the affected services must be adapted as well.
More information can be found in the My Oracle Support Note 1967316.1.

Workaround:
-----------
None

Advisory URL:
-------------
https://www.sec-consult.com/en/vulnerability-lab/advisories/index.html

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

SEC Consult Vulnerability Lab

SEC Consult
Europe | Asia | North America

About SEC Consult Vulnerability Lab
The SEC Consult Vulnerability Lab is an integrated part of SEC Consult. It
ensures the continued knowledge gain of SEC Consult in the field of network
and application security to stay ahead of the attacker. The SEC Consult
Vulnerability Lab supports high-quality penetration testing and the evaluation
of new offensive and defensive technologies for our customers. Hence our
customers obtain the most current information about vulnerabilities and valid
recommendation about the risk profile of new technologies.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Interested to work with the experts of SEC Consult?
Send us your application https://www.sec-consult.com/en/career/index.html

Interested in improving your cyber security with the experts of SEC Consult?
Contact our local offices https://www.sec-consult.com/en/contact/index.html
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Mail: research at sec-consult dot com
Web: https://www.sec-consult.com
Blog: https://blog.sec-consult.com
Twitter: https://twitter.com/sec_consult

EOF W. Ettlinger / @2018

0? *?H?÷
 ?0?10
 `?He0? *?H?÷
 ? 0?¯0?? à#Ë?S?­anzTgk!0
 *?H?÷
 0o1 0 USE10U
 AddTrust AB1&0$U AddTrust External TTP Network1"0 UAddTrust External CA Root0
141222000000Z
200530104838Z0?1 0 UGB10UGreater Manchester10USalford10U
COMODO CA Limited1A0?U8COMODO SHA-256 Client Authentication and Secure Email CA0?"0
 *?H?÷
?0?
??±
ÚzSNpR¼V¦&·¸Ià?çQ«ñðZI£´?`¼zQB§y?¤"ßaN?Õv#
ÓJ¶ ?n¥=Ùº»þ¡?©.CRC|¯2PȦOZéØÏ?%?{?è0dæ¤øV?ý*$3?¬Dåi?£FKÂ3Ôé@?°±¬?@¹
µ?:?*S£Û= a<U?ÙNv%!)ú£|qvOîá_éûT?ÛÃ{5R·?Þ"=,0-1Y½R7°3i-CëúÖ¥ñ?wgQ?Ùî'ë¼¥8v?¤©
8ÿß?õ¬I¾Ê÷s?:2«??:=F:WtaP¾Æ@?Ëäâ?¢!£?0?0U#0?­½?z4´&÷
úÄ&Tï½à$ËT0U?ak?ᢠªOìgñ£÷´?Áì0Uÿ?0Uÿ0
ÿ0U%0++0U 
00U 0DU=0;09 7 5?3http://crl.usertrust.com/AddTrustExternalCARoot.crl05
+)0'0%+0?http://ocsp.usertrust.com0
 *?H?÷
 ?*n¬UÁ:«?ÅØíÍUóªka+À #?Åfjo±õ´µw^aß}þ³¤??üû[jr
A¼ºÁXÕ&ÂêÕM?ûþ??ÏXã"c?Rø»6«}X¥Þ«;cåÚÕsïìàû{â£ÿðB#?ʶM>äK²¨-ÔØ»BKi
?Û¦74è{à¥?Ê:Ç?O?4n?eÐ?»©ÜÊÊ6ÑôüÂd)5¯Ö±§qÒC±>?ì?2Sôv?Ê?4¹,ÊæJØ?
Á?â?ûZBj#!éeÇõÕ»~ê?? bêÑ:,YÅ?3ò8?å¶ézyöJ&ú|?û?0?a0?I +?þ%³`??5T«´0
 *?H?÷
 0?1 0 UGB10UGreater Manchester10USalford10U
COMODO CA Limited1A0?U8COMODO SHA-256 Client Authentication and Secure Email CA0
170301000000Z
200229235959Z0?W1 0 UAT1
0 U270010UNiederoesterreich10U Wr. Neustadt10U Komarigasse 14/11.0,U
%SEC Consult Unternehmensberatung GmbH1I0GU @Issued through SEC Consult Unternehmensberatung GmbH E-PKI Manag10U Corporate Secure Email1&0$USEC Consult Vulnerability Lab1'0% *?H?÷
 research (at) sec-consult (dot) com0 [email concealed]?"0
 *?H?÷
?0?
?çââ³×p¼¬ÉÓ#ëäoú=1X ÏsÍldhmþ·}jµ?ýySüx??¡%Vl´9«ÖHÍO½Ë Z|¢ò?q4äËg?7ò?ù?t¥Á±å1Pzò¦<*WÒj,?%x?? ä??F ¼ÜpF/*ÛЩk*TÅöb²??ÖӏñÏZ?QP´?wH;qf¢?r5·ÉyhXcü(#1~ ôYS"YÐ`U
?øô¤rP1u^ËØP.ëë?f}SÅäÖ[Hd¥ ¢áorà­ ÔB?{u·@J·²¨°×®6vL±
h:?i -V£?ËLBóa£?à0?Ü0U#0??ak?ᢠªOìgñ£÷´?Áì0U
G?gx.§~¢Òü¥El?%0Uÿ 0 Uÿ00U%0++0FU ?0=0; +²10+0)+https://secure.comodo.net/CPS0]UV0T0R P
 N?Lhttp://crl.comodoca.com/COMODOSHA256ClientAuthenticationandSecureEma
ilCA.crl0+?0?0X+0?Lhttp://crt.comodoca.com/COMODOS
HA256ClientAuthenticationandSecureEmailCA.crt0$+0?http://ocsp.c
omodoca.com0#U0research (at) sec-consult (dot) com0 [email concealed]
 *?H?÷
 ?CÑË×úpÿtR
ðH§Àz7!]J ºæû¼]¨µX i?òÉ£­©cwSÀ/?­?ÓOÑ:þ Úøw?P[óü¹ÁÒ&©ã?ü-6?L5Y?ù6àòÀõ$Äð?z¼.È?ïNþ±ñ?øK×ÈV ® ¯ä@nÞ9ó¹Rk«*Ò¶èDÞÞ
(D'I5Ëé
{Ë­à¦]FϨújRO^pº=õ ?æ?18!??¤q µa=c@2ÞTC?ïþ´4?~-?ø¿À?Hÿ¹¨r.ÁØ ØXW?YÊÆ?á:??ZÔûµ4àÒ2CSq3»?`Û?I?Ö²Ë3gj?ù»º x1?A0?=0°0?1 0 UGB10UGreater Manchester10USalford10U
COMODO CA Limited1A0?U8COMODO SHA-256 Client Authentication and Secure Email CA+?þ%³`??5T«´0
 `?He ?a0 *?H?÷
 1  *?H?÷
0 *?H?÷
 1
180503111544Z0/ *?H?÷
 1" äþµ5,·¯úøÙn;óóÞÐB?¬±(xºêp6xâ ê&0l *?H?÷
 1_0]0  `?He*0  `?He0
*?H?÷
0*?H?÷
?0
*?H?÷
@0+0
*?H?÷
(0Á +?71³0°0?1 0 UGB10UGreater Manchester10USalford10U
COMODO CA Limited1A0?U8COMODO SHA-256 Client Authentication and Secure Email CA+?þ%³`??5T«´0Ã *?H?÷
  1³ °0?1 0 UGB10UGreater Manchester10USalford10U
COMODO CA Limited1A0?U8COMODO SHA-256 Client Authentication and Secure Email CA+?þ%³`??5T«´0
 *?H?÷
?ͨj,É'õY­?¼?÷på}2Ø #À?ìd¨º&½í/iA??Ë#òEÅ? B©>/¶Õâv?»ü§ï6%:à¨?A7N" y;Í/<¼^S]
ULõ=Ý??/Ï?{ŧ?ãBdæ :]ÒE3H?j¿GÐSÍ(ôlåf¦eý÷ÉI%R'4Ä?^/Ï?áWý·ÃÎÐüS³
û?!õTþA×ÀKR9Ïbùí/u ?\¹m=?Mܵx?ôiÓÀa«4GD?óçQAdßw!þºF{'å¬ÛP5ýâÀRdÜ͵¼f?!ÿK,§tèB£$.
øP

[ reply ]


 

Privacy Statement
Copyright 2010, SecurityFocus