On the Security of Authentication Protocols on the Web Antoine Delignat-Lavaud

Total Page:16

File Type:pdf, Size:1020Kb

On the Security of Authentication Protocols on the Web Antoine Delignat-Lavaud On the security of authentication protocols on the web Antoine Delignat-Lavaud To cite this version: Antoine Delignat-Lavaud. On the security of authentication protocols on the web. Cryptography and Security [cs.CR]. Université Paris sciences et lettres, 2016. English. NNT : 2016PSLEE018. tel-01469937 HAL Id: tel-01469937 https://tel.archives-ouvertes.fr/tel-01469937 Submitted on 16 Mar 2017 HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. École Normale Supérieure Doctoral School ED386: Sciences Mathématiques de Paris Centre University Department Inria Paris-Rocquencourt Thesis defended by Antoine Delignat-Lavaud In order to become Doctor from École Normale Supérieure Academic Field Computer Science Speciality Security On the Security of Authentication Protocols for the Web Thesis supervised by Karthikeyan Bhargavan École Normale Supérieure Doctoral School ED386: Sciences Mathématiques de Paris Centre University Department Inria Paris-Rocquencourt Thesis defended by Antoine Delignat-Lavaud In order to become Doctor from École Normale Supérieure Academic Field Computer Science Speciality Security On the Security of Authentication Protocols for the Web Thesis supervised by Karthikeyan Bhargavan École Normale Supérieure École doctorale ED386: Sciences Mathématiques de Paris Centre Unité de recherche Inria Paris-Rocquencourt Thèse présentée par Antoine Delignat-Lavaud En vue de l’obtention du grade de docteur de l’École Normale Supérieure Discipline Informatique Spécialité Sécurité La sécurité des protocoles d’authentification sur le Web Thèse dirigée par Karthikeyan Bhargavan The École Normale Supérieure neither endorse nor censure authors’ opinions expressed in the theses: these opinions must be considered to be those of their authors. Keywords: sécurité du web, authentification, analyse de protocoles, http, transport layer security, tls, javascript, same-origin policy, x.509, infrastructure à clé publique, authentification unique, composition de protocoles, lieur de canal, triple poignée de main Mots clés : web security, authentication, protocol analysis, http, transport layer security, tls, javascript, same-origin policy, x.509, public key infrastructure, single sign-on, delegated authentication, compositional security, channel binding, compound authentication, triple handshake This thesis has been prepared at Inria Paris-Rocquencourt B.P. 105 Team Prosecco Domaine de Voluceau - Rocquencourt 78153 Le Chesnay France T +33 (0)1 39 63 55 11 v +33 (0)1 39 63 53 30 Web Site http://www.inria.fr Abstract xiii On the Security of Authentication Protocols for the Web Abstract Est-il possible de démontrer un théorème prouvant que l’accès aux données confidentielles d’un util- isateur d’un service Web (tel que GMail) nécessite la connaissance de son mot de passe, en supposant certaines hypothèses sur ce qu’un attaquant est incapable de faire (par exemple, casser des primitives cryptographiques ou accéder directement aux bases de données de Google), sans toutefois le restreindre au point d’exclure des attaques possibles en pratique? Il existe plusieurs facteurs spécifiques aux protocoles du Web qui rendent impossible une application directe des méthodes et outils existants issus du domaine de l’analyse des protocoles cryptographiques. Tout d’abord, les capacités d’un attaquant sur le Web vont largement au-delà de la simple manipulation des messages echangés entre le client et le serveur sur le réseau. Par exemple, il est tout à fait possible (et même fréquent en pratique) que l’utilisateur ait dans son navigateur un onglet contenant un site contrôlé par l’adversaire pendant qu’il se connecte à sa messagerie (par exemple, via une bannière publicitaire) ; cet onglet est, comme n’importe quel autre site, capable de provoquer l’envoi de requêtes arbitraires vers le serveur de GMail, bien que la politique d’isolation des pages du navigateur empêche la lecture directe de la réponse à ces requêtes. De plus, la procédure pour se connecter à GMail implique un empilement complexe de protocoles : tout d’abord, un canal chiffré, et dont le serveur est authentifié, est établi avec le protocole TLS ; puis, une session HTTP est créée en utilisant un cookie ; enfin, le navigateur exécute le code JavaScript retourné par le client, qui se charge de demander son mot de passe à l’utilisateur. Enfin, même en imaginant que la conception de ce système soit sûre, il suffit d’une erreur minime de programmation (par exemple, une simple instruction goto mal placée) pour que la sécurité de l’ensemble de l’édifice s’effondre. Le but de cette thèse est de bâtir un ensemble d’outils et de librairies permettant de programmer et d’analyser formellement de manière compositionelle la sécurité d’applications Web confrontées à un mod- ère plausible des capacités actuelles d’un attaquant sur le Web. Dans cette optique, nous étudions la conception des divers protocoles utilisés à chaque niveau de l’infrastructure du Web (TLS, X.509, HTTP, HTML, JavaScript) et évaluons leurs compositions respectives. Nous nous intéressons aussi aux implé- mentations existantes et en créons de nouvelles que nous prouvons correctes afin de servir de référence lors de comparaisons. Nos travaux mettent au jour un grand nombre de vulnérabilités aussi bien dans les protocoles que dans leurs implémentations, ainsi que dans les navigateurs, serveurs, et sites internet ; plusieures de ces failles ont été reconnues d’importance critiques. Enfin, ces découvertes ont eu une influence sur les versions actuelles et futures du protocole TLS. Keywords: sécurité du web, authentification, analyse de protocoles, http, transport layer security, tls, javascript, same-origin policy, x.509, infrastructure à clé publique, authentification unique, compo- sition de protocoles, lieur de canal, triple poignée de main Inria Paris-Rocquencourt B.P. 105 Team Prosecco – Domaine de Voluceau - Rocquencourt – 78153 Le Chesnay – France xiv Abstract La sécurité des protocoles d’authentification sur le Web Résumé As ever more private user data gets stored on the Web, ensuring proper protection of this data (in parti- cular when it transits through untrusted networks, or when it is accessed by the user from her browser) becomes increasingly critical. However, in order to formally prove that, for instance, email from GMail can only be accessed by knowing the user’s password, assuming some reasonable set of assumptions about what an attacker cannot do (e.g. he cannot break AES encryption), one must precisely understand the se- curity properties of many complex protocols and standards (including DNS, TLS, X.509, HTTP, HTML, JavaScript), and more importantly, the composite security goals of the complete Web stack. In addition to this compositional security challenge, one must account for the powerful additional attacker capabilities that are specific to the Web, besides the usual tampering of network messages. For instance, a user may browse a malicious pages while keeping an active GMail session in a tab; this page is allowed to trigger arbitrary, implicitly authenticated requests to GMail using JavaScript (even though the isolation policy of the browser may prevent it from reading the response). An attacker may also inject himself into honest page (for instance, as a malicious advertising script, or exploiting a data sanitization flaw), get the user to click bad links, or try to impersonate other pages. Besides the attacker, the protocols and applications are themselves a lot more complex than typical examples from the protocol analysis literature. Logging into GMail already requires multiple TLS sessions and HTTP requests between (at least) three principals, representing dozens of atomic messages. Hence, ad hoc models and hand written proofs do not scale to the complexity of Web protocols, mandating the use of advanced verification automation and modeling tools. Lastly, even assuming that the design of GMail is indeed secure against such an attacker, any single pro- gramming bug may completely undermine the security of the whole system. Therefore, in addition to modeling protocols based on their specification, it is necessary to evaluate implementations in order to achieve practical security. The goal of this thesis is to develop new tools and methods that can serve as the foundation towards an extensive compositional Web security analysis framework that could be used to implement and formally verify applications against a reasonably extensive model of attacker capabilities on the Web. To this end, we investigate the design of Web protocols at various levels (TLS, HTTP, HTML, JavaScript) and evaluate their composition using a broad range of formal methods, including symbolic protocol models, type sys- tems, model extraction, and type-based program verification. We also analyze current implementations and develop some new verified versions to run tests against. We uncover a broad range of vulnerabilities in protocols and their implementations, and propose countermeasures that we formally verify, some of which have been implemented in browsers and by various websites.
Recommended publications
  • On the Security of Single Sign-On
    On the Security of Single Sign-On Vladislav Mladenov (Place of birth: Pleven/Bulgaria) [email protected] 30th June 2017 Ruhr-University Bochum Horst G¨ortz Institute for IT-Security Chair for Network and Data Security Dissertation zur Erlangung des Grades eines Doktor-Ingenieurs der Fakult¨atf¨urElektrotechnik und Informationstechnik an der Ruhr-Universit¨atBochum First Supervisor: Prof. Dr. rer. nat. J¨org Schwenk Second Supervisor: Prof. Dr.-Ing. Felix Freiling www.nds.rub.de Abstract Single Sign-On (SSO) is a concept of delegated authentication, where an End- User authenticates only once at a central entity called Identity Provider (IdP) and afterwards logs in at multiple Service Providers (SPs) without reauthenti- cation. For this purpose, the IdP issues an authentication token, which is sent to the SP and must be verified. There exist different SSO protocols, which are implemented as open source libraries or integrated in commercial products. Google, Facebook, Microsoft and PayPal belong to the most popular SSO IdPs. This thesis provides a comprehensive security evaluation of the most popular and widely deployed SSO protocols: OpenID Connect, OpenID, and SAML. A starting point for this research is the development of a new concept called malicious IdP, where a maliciously acting IdP is used to attack SSO. Generic attack classes are developed and categorized according to the requirements, goals, and impact. These attack classes are adapted to different SSO proto- cols, which lead to the discovery of security critical vulnerabilities in Software- as-a-Service Cloud Providers, eCommerce products, web-based news portals, Content-Management systems, and open source implementations.
    [Show full text]
  • Proof-Of-Possession Tokens in Microservice Architectures
    Proof-of-Possession Tokens in Microservice Architectures Ruaridh Watt January 26, 2018 MSc Computer Science Thesis External Partner: Omegapoint External Supervisors: Markus Örebrand & Björn Nyberg Internal Supervisor: Mikael Rännar Examiner: Henrik Björklund Abstract The popular OAuth 2.0 Framework specifies the use of Bearer Tokens for the transmission of authorization credentials. A Bearer Token has the property that any party in possession of it can use the it. Requests including Bearer Tokens are therefore performed over a secure channel to ensure that tokens cannot be obtained by eavesdroppers. There are, however, still ways in which tokens may be leaked, in- cluding cross-site scripting and man-in-the-middle attacks. In situations where Bearer Tokens do not provide adequate security, proof-of-possession techniques may be employed to bind tokens to clients, thereby mitigating token leakage. This project presents a method which can be used to bind tokens to clients based on authentication performed by an external identity provider. How clients form proof-of-possession tokens is also described. The result is a token which may be used to transmit authorization credentials over an insecure channel. Token performance is measured in terms of client key generation time, token generation time, and authorization time. The effect different signing algorithms have on performance is measured and the proof-of-possession token is compared to Bearer Token based authorization. The results show that Elliptical Curve cryptography may be employed by lightweight devices to reduce client key and token generation times. The analysis also shows that an increase in authorization time by a factor of between six and nine can be expected when compared to Bearer Token based authorization.
    [Show full text]
  • Background on Identity Federation Technologies for the Public Safety Community
    1 Draft NISTIR 8336 2 Background on Identity Federation 3 Technologies for the Public Safety 4 Community 5 6 William Fisher 7 Mark Russell* 8 Sudhi Umarji 9 Karen Scarfone 10 11 * Former employee; all work for this 12 publication was done while at employer. 13 14 15 16 This publication is available free of charge from: 17 https://doi.org/10.6028/NIST.IR.8336-draft 18 19 20 21 Draft NISTIR 8336 22 Background on Identity Federation 23 Technologies for the Public Safety 24 Community 25 William Fisher 26 Applied Cybersecurity Division 27 Information Technology Laboratory 28 29 Mark Russell* 30 Sudhi Umarji 31 The MITRE Corporation 32 McLean, VA 33 34 Karen Scarfone 35 Scarfone Cybersecurity 36 Clifton, VA 37 38 * Former employee; all work for this 39 publication was done while at employer. 40 41 This publication is available free of charge from: 42 https://doi.org/10.6028/NIST.IR.8336-draft 43 44 June 2021 45 46 47 48 U.S. Department of Commerce 49 Gina Raimondo, Secretary 50 51 National Institute of Standards and Technology 52 James K. Olthoff, Performing the Non-Exclusive Functions and Duties of the Under Secretary of Commerce 53 for Standards and Technology & Director, National Institute of Standards and Technology 54 National Institute of Standards and Technology Interagency or Internal Report 8336 55 80 pages (June 2021) 56 This publication is available free of charge from: 57 https://doi.org/10.6028/NIST.IR.8336-draft 58 Certain commercial entities, equipment, or materials may be identified in this document in order to describe an 59 experimental procedure or concept adequately.
    [Show full text]
  • Internet Engineering Task Force A. Popov Internet-Draft M. Nystroem Intended Status: Standards Track Microsoft Corp
    Internet Engineering Task Force A. Popov Internet-Draft M. Nystroem Intended status: Standards Track Microsoft Corp. Expires: September 22, 2016 D. Balfanz, Ed. A. Langley Google Inc. J. Hodges Paypal March 21, 2016 Token Binding over HTTP draft-ietf-tokbind-https-03 Abstract This document describes a collection of mechanisms that allow HTTP servers to cryptographically bind authentication tokens (such as cookies and OAuth tokens) to a TLS [RFC5246] connection. We describe both _first-party_ as well as _federated_ scenarios. In a first-party scenario, an HTTP server issues a security token (such as a cookie) to a client, and expects the client to send the security token back to the server at a later time in order to authenticate. Binding the token to the TLS connection between client and server protects the security token from theft, and ensures that the security token can only be used by the client that it was issued to. Federated token bindings, on the other hand, allow servers to cryptographically bind security tokens to a TLS [RFC5246] connection that the client has with a _different_ server than the one issuing the token. This Internet-Draft is a companion document to The Token Binding Protocol [TBPROTO] Status of This Memo This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at http://datatracker.ietf.org/drafts/current/.
    [Show full text]
  • Internet Engineering Task Force A. Popov Internet-Draft M
    Internet Engineering Task Force A. Popov Internet-Draft M. Nystroem Intended status: Standards Track Microsoft Corp. Expires: April 17, 2016 D. Balfanz, Ed. A. Langley Google Inc. October 15, 2015 Token Binding over HTTP draft-ietf-tokbind-https-02 Abstract This document describes a collection of mechanisms that allow HTTP servers to cryptographically bind authentication tokens (such as cookies and OAuth tokens) to a TLS [RFC5246] connection. We describe both _first-party_ as well as _federated_ scenarios. In a first-party scenario, an HTTP server issues a security token (such as a cookie) to a client, and expects the client to send the security token back to the server at a later time in order to authenticate. Binding the token to the TLS connection between client and server protects the security token from theft, and ensures that the security token can only be used by the client that it was issued to. Federated token bindings, on the other hand, allow servers to cryptographically bind security tokens to a TLS [RFC5246] connection that the client has with a _different_ server than the one issuing the token. This Internet-Draft is a companion document to The Token Binding Protocol [TBPROTO] Status of This Memo This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at http://datatracker.ietf.org/drafts/current/. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time.
    [Show full text]
  • Security Investigation and Analysis of Openid: Problems and Enhancements
    198 IJCSNS International Journal of Computer Science and Network Security, VOL.17 No.10, October 2017 Security Investigation and Analysis of OpenID: Problems and Enhancements Waleed A. Alrodhan and Alya I. Alqarni College of Computer and Information Sciences Al-Imam Muhammad ibn Saud University Summary confident sources that exist in other systems or structural OpenID is a widely used identity management system (IdMS) by areas, at the moment when the user uses the method [2]. which identity providers (IdPs) provide their users with 'open' SSO aims at boosting-up the user-convenience and identities that can be used to log in to particular relaying parties mitigating the risk of users forgetting their security (RPs). OpenID implements a single sign-on (SSO) solution that credentials. reduces the number of authentication credentials that are required. An SSO permits users to authenticate themselves to many SPs by using one set of authentication credentials. OpenID is faster and 1.1 OpenID system easier than the traditional method, which requires the user to manage a large number of digital identities, since each SP only OpenID is one of the IDMS’s that offer users with a recognises the identity it has issued. This increases the security universal identity, permitting them to sign in to several risk of identity theft and, at the same time, forms an obstacle with relying parties (or RPs). OpenID supports SSO which regard to user convenience. The aim of this paper is to analyse the prevents the necessity to have individual signings and security of OpenID by identifying its weaknesses and passwords for to each website which supports OpenID [3].
    [Show full text]