THÈSE DE DOCTORAT









Ajax Request Jquery Get

Let's see how to wire up a jQuery AJAX request to a Named Handler Method in ASPNET Core You can side-step CORS by using a proxy and get non-JSONP data.
ajax request jquery get


Cross Domain Request Dojo Burgh Property

Lifecycle methods triggered by standard lifecycle annotations. Cross platform Web debugging proxy. Jsonp is similar with handshake.
cross domain request dojo


NOBIL API

8 août 2018 Cross domain Ajax - JSONP. Example of how this can be implemented across different domains using Ajax and JSONP and. jQuery: jQuery.ajax({.
API NOBIL Documentation v


Less Known Web Application Vulnerabilities

Cross Site Request Forgery Client Side Template Injection* ... such as Same-origin Policy which is enforced for XMLHttpRequest (AJAX requests).
OWASP Ionut Popescu Less Known Web Application Vulnerabilities Stripped





Procedure to request a JSON file or an XML file in the local host

If you want to use the example above on one of your own web pages If you wish to force a crossDomain request (such as JSONP) on the same domain
LocalFileProcessingWithJSXMLJSON


Procedure to request a JSON file or an XML file in the local host

Example: Create a jQuery object using an XML string and obtain the value If you wish to force a crossDomain request (such as JSONP) on the same domain.
LocalFileProcessingWithJSXMLJSON


Putting Frontend and Backend Together

the same-domain limitation of AJAX technology with JSONP: const request = $.ajax({ It will require to add the OPTIONS method request handler and special.
. /


Defense against Client-Side Attacks

Cross-Site Script Inclusion (JSONP Attacks) . resources cross domain communication using postMessage()
whitepaper defense against client side attacks





THÈSE DE DOCTORAT

Example of messages to send to extensions . in order for the latter to authorize (or not) cross-origin AJAX requests. Before CORS.
AZUR


CWS/6/6 (in French)

14 févr. 2017 The JSON with padding (JSONP) is a method for sending JSON data without worrying about cross-domain request issues.
cws corr


216212 THÈSE DE DOCTORAT >G

Dolière Francis Somé

Dirigée par

Co

Soutenue le

Devant le jury, composé de

THÈSE DE DOCTORAT

Composition

Résumé

Dans cette thèse, nous nous sommes intéressés aux problématiques de sécurité et de

confidentialité liées à l"utilisation d"applications web et à l"installation d"extensions de

navigateurs. Parmi les attaques dont sont victimes les applications web, il y a celles très connues de type XSS (ou Cross-Site Scripting). Les extensions sont des logiciels tiers que les

utilisateurs peuvent installer afin de booster les fonctionnalités des navigateurs et améliorer

leur expérience utilisateur. Content Security Policy (CSP) est une politique de sécurité qui a été proposée pour contrer les attaques de type XSS. La Same Origin Policy (SOP) est une politique de

sécurité fondamentale des navigateurs, régissant les interactions entre applications web. Par

exemple, elle ne permet pas qu"une application accède aux données d"une autre application. Cependant, le mécanisme de Cross-Origin Resource Sharing (CORS) peut être implémenté par des applications désirant échanger des données entre elles. Tout d"abord, nous avons étudié l"intégration de CSP avec la Same Origin Policy (SOP) et démontré que SOP peut rendre CSP inefficace, surtout quand une application web ne protège pas toutes ses pages avec CSP, et qu"une page avec CSP imbrique ou est imbriquée dans une autre page sans ou avec un CSP différent et inefficace. Nous avons

aussi élucidé la sémantique de CSP, en particulier les différences entre ses 3 versions, et

leurs implémentations dans les navigateurs. Nous avons ainsi introduit le concept de CSP sans dépendances qui assure à une application la même protection contre les attaques, quelque soit le navigateur dans lequel elle s"exécute. Finalement, nous avons proposé et démontré comment étendre CSP dans son état actuel, afin de pallier à nombre de ses limitations qui ont été révélées dans d"autres études. Les contenus tiers dans les applications web permettent aux propriétaires de ces contenus de pister les utilisateurs quand ils naviguent sur le web. Pour éviter cela, nous avons introduit une nouvelle architecture web qui une fois déployée, supprime le pistage des utilisateurs. Dans un dernier temps, nous nous sommes intéressés aux extensions de navigateurs. Nous avons d"abord démontré que les extensions qu"un utilisateur installe et/ou les applications web auxquelles il se connecte, peuvent le distinguer d"autres utilisateurs. Nous avons aussi étudié les interactions entre extensions et applications web. Ainsi avons-nous trouvé

plusieurs extensions dont les privilèges peuvent être exploités par des sites web afin d"accéder

à des données sensibles de l"utilisateur. Par exemple, certaines extensions permettent à des applications web d"accéder aux contenus d"autres applications, bien que cela soit normalement interdit par la Same Origin Policy. Finalement, nous avons aussi trouvé qu"un grand nombre d"extensions a la possibilité de désactiver la Same Origin Policy dans le navigateur, en manipulant les entêtes CORS. Cela permet à un attaquant d"accéder aux données de l"utilisateur dans n"importe qu"elle autre application, comme par example ses

mails, son profile sur les réseaux sociaux, et bien plus. Pour lutter contre ces problèmes, nous

préconisons aux navigateurs un système de permissions plus fin et une analyse d"extensions plus poussée, afin d"alerter les utilisateurs des dangers réels liés aux extensions. i ii Mots-clés :web, navigateurs, applications web, securité, same-rigin policy, content security policy, cross-origin resource sharing, extensions de navigateurs, communication inter-iframes, confidentialité, vie privée, pistage, empreinte de navigateurs

Abstract

In this thesis, we studied security and privacy threats in web applications and browser extensions. There are many attacks targeting the web of which XSS (Cross-Site Scripting) is one of the most notorious. Third party tracking is the ability of an attacker to benefit from its presence in many web applications in order to track the user has she browses the web, and build her browsing profile. Extensions are third party software that users install to extend their browser functionality and improve their browsing experience. Malicious or poorly programmed extensions can be exploited by attackers in web applications, in order to benefit from extensions privileged capabilities and access sensitive user information. Content Security Policy (CSP) is a security mechanism for mitigating the impact of content injection attacks in general and in particular XSS. The Same Origin Policy (SOP) is a security mechanism implemented by browsers to isolate web applications of different origins from one another. In a first work on CSP, we analyzed the interplay of CSP with SOP and demonstrated that the latter allows the former to be bypassed. Then we scrutinized the three CSP versions and found that a CSP is differently interpreted depending on the browser, the version of CSP it implements, and how compliant the implementation is with respect to the specification. To help developers deploy effective policies that encompass all these differences in CSP versions and browsers implementations, we proposed the deployment of dependency-free policies that effectively protect against attacks in all browsers. Finally, previous studies have identified many limitations of CSP. We reviewed the different solutions proposed in the wild, and showed that they do not fully mitigate the identified shortcomings of CSP. Therefore, we proposed to extend the CSP specification, and showed the feasibility of our proposals with an example of implementation. Regarding third party tracking, we introduced and implemented a tracking preserving ar- chitecture, that can be deployed by web developers willing to include third party content in their applications while preventing tracking. Intuitively, third party requests are auto- matically routed to a trusted middle party server which removes tracking information from the requests. Finally considering browser extensions, we first showed that the extensions that users install and the websites they are logged into, can serve to uniquely identify and track them. We then studied the communications between browser extensions and web applications and demonstrate that malicious or poorly programmed extensions can be exploited by web applications to benefit from extensions privileged capabilities. Also, we demonstrated that extensions can disable the Same Origin Policy by tampering with CORS headers. All this enables web applications to read sensitive user information. To mitigate these threats, we proposed countermeasures and a more fine-grained permissions system and review process for browser extensions. We believe that this can help browser vendors identify malicious extensions and warn users about the threats posed by extensions they install. iii iv Keywords:web, browser, web application, security, same origin policy, content secu- rity policy, cross-origin resource sharing, browser extensions, cross-iframe communication, privacy, third party web tracking, browser fingerprinting

Acknowledgements

v

Contents

1 Introduction

1

1 Security threats

1

2 Privacy threats

2

3 Extensible browsers

3

4 Scope of the thesis

3

4.1 Improving the effectiveness of CSP

3

4.2 Server-side third party tracking protection

4

4.3 Web applications meet browser extensions

5

5 Outline

5

6 List of publications and submissions

6

2 Background

7

1 Web applications ecosystem

7

1.1 Web servers

7

1.2 HTTP protocol

8

1.3 Web documents

9

1.4 Cascading Style Sheets (CSS)

10

1.5 JavaScript

11

1.6 Browsing contexts

>G

Dolière Francis Somé

Dirigée par

Co

Soutenue le

Devant le jury, composé de

THÈSE DE DOCTORAT

Composition

Résumé

Dans cette thèse, nous nous sommes intéressés aux problématiques de sécurité et de

confidentialité liées à l"utilisation d"applications web et à l"installation d"extensions de

navigateurs. Parmi les attaques dont sont victimes les applications web, il y a celles très connues de type XSS (ou Cross-Site Scripting). Les extensions sont des logiciels tiers que les

utilisateurs peuvent installer afin de booster les fonctionnalités des navigateurs et améliorer

leur expérience utilisateur. Content Security Policy (CSP) est une politique de sécurité qui a été proposée pour contrer les attaques de type XSS. La Same Origin Policy (SOP) est une politique de

sécurité fondamentale des navigateurs, régissant les interactions entre applications web. Par

exemple, elle ne permet pas qu"une application accède aux données d"une autre application. Cependant, le mécanisme de Cross-Origin Resource Sharing (CORS) peut être implémenté par des applications désirant échanger des données entre elles. Tout d"abord, nous avons étudié l"intégration de CSP avec la Same Origin Policy (SOP) et démontré que SOP peut rendre CSP inefficace, surtout quand une application web ne protège pas toutes ses pages avec CSP, et qu"une page avec CSP imbrique ou est imbriquée dans une autre page sans ou avec un CSP différent et inefficace. Nous avons

aussi élucidé la sémantique de CSP, en particulier les différences entre ses 3 versions, et

leurs implémentations dans les navigateurs. Nous avons ainsi introduit le concept de CSP sans dépendances qui assure à une application la même protection contre les attaques, quelque soit le navigateur dans lequel elle s"exécute. Finalement, nous avons proposé et démontré comment étendre CSP dans son état actuel, afin de pallier à nombre de ses limitations qui ont été révélées dans d"autres études. Les contenus tiers dans les applications web permettent aux propriétaires de ces contenus de pister les utilisateurs quand ils naviguent sur le web. Pour éviter cela, nous avons introduit une nouvelle architecture web qui une fois déployée, supprime le pistage des utilisateurs. Dans un dernier temps, nous nous sommes intéressés aux extensions de navigateurs. Nous avons d"abord démontré que les extensions qu"un utilisateur installe et/ou les applications web auxquelles il se connecte, peuvent le distinguer d"autres utilisateurs. Nous avons aussi étudié les interactions entre extensions et applications web. Ainsi avons-nous trouvé

plusieurs extensions dont les privilèges peuvent être exploités par des sites web afin d"accéder

à des données sensibles de l"utilisateur. Par exemple, certaines extensions permettent à des applications web d"accéder aux contenus d"autres applications, bien que cela soit normalement interdit par la Same Origin Policy. Finalement, nous avons aussi trouvé qu"un grand nombre d"extensions a la possibilité de désactiver la Same Origin Policy dans le navigateur, en manipulant les entêtes CORS. Cela permet à un attaquant d"accéder aux données de l"utilisateur dans n"importe qu"elle autre application, comme par example ses

mails, son profile sur les réseaux sociaux, et bien plus. Pour lutter contre ces problèmes, nous

préconisons aux navigateurs un système de permissions plus fin et une analyse d"extensions plus poussée, afin d"alerter les utilisateurs des dangers réels liés aux extensions. i ii Mots-clés :web, navigateurs, applications web, securité, same-rigin policy, content security policy, cross-origin resource sharing, extensions de navigateurs, communication inter-iframes, confidentialité, vie privée, pistage, empreinte de navigateurs

Abstract

In this thesis, we studied security and privacy threats in web applications and browser extensions. There are many attacks targeting the web of which XSS (Cross-Site Scripting) is one of the most notorious. Third party tracking is the ability of an attacker to benefit from its presence in many web applications in order to track the user has she browses the web, and build her browsing profile. Extensions are third party software that users install to extend their browser functionality and improve their browsing experience. Malicious or poorly programmed extensions can be exploited by attackers in web applications, in order to benefit from extensions privileged capabilities and access sensitive user information. Content Security Policy (CSP) is a security mechanism for mitigating the impact of content injection attacks in general and in particular XSS. The Same Origin Policy (SOP) is a security mechanism implemented by browsers to isolate web applications of different origins from one another. In a first work on CSP, we analyzed the interplay of CSP with SOP and demonstrated that the latter allows the former to be bypassed. Then we scrutinized the three CSP versions and found that a CSP is differently interpreted depending on the browser, the version of CSP it implements, and how compliant the implementation is with respect to the specification. To help developers deploy effective policies that encompass all these differences in CSP versions and browsers implementations, we proposed the deployment of dependency-free policies that effectively protect against attacks in all browsers. Finally, previous studies have identified many limitations of CSP. We reviewed the different solutions proposed in the wild, and showed that they do not fully mitigate the identified shortcomings of CSP. Therefore, we proposed to extend the CSP specification, and showed the feasibility of our proposals with an example of implementation. Regarding third party tracking, we introduced and implemented a tracking preserving ar- chitecture, that can be deployed by web developers willing to include third party content in their applications while preventing tracking. Intuitively, third party requests are auto- matically routed to a trusted middle party server which removes tracking information from the requests. Finally considering browser extensions, we first showed that the extensions that users install and the websites they are logged into, can serve to uniquely identify and track them. We then studied the communications between browser extensions and web applications and demonstrate that malicious or poorly programmed extensions can be exploited by web applications to benefit from extensions privileged capabilities. Also, we demonstrated that extensions can disable the Same Origin Policy by tampering with CORS headers. All this enables web applications to read sensitive user information. To mitigate these threats, we proposed countermeasures and a more fine-grained permissions system and review process for browser extensions. We believe that this can help browser vendors identify malicious extensions and warn users about the threats posed by extensions they install. iii iv Keywords:web, browser, web application, security, same origin policy, content secu- rity policy, cross-origin resource sharing, browser extensions, cross-iframe communication, privacy, third party web tracking, browser fingerprinting

Acknowledgements

v

Contents

1 Introduction

1

1 Security threats

1

2 Privacy threats

2

3 Extensible browsers

3

4 Scope of the thesis

3

4.1 Improving the effectiveness of CSP

3

4.2 Server-side third party tracking protection

4

4.3 Web applications meet browser extensions

5

5 Outline

5

6 List of publications and submissions

6

2 Background

7

1 Web applications ecosystem

7

1.1 Web servers

7

1.2 HTTP protocol

8

1.3 Web documents

9

1.4 Cascading Style Sheets (CSS)

10

1.5 JavaScript

11

1.6 Browsing contexts