The Nonce-nce of Web Security: an Investigation of CSP Nonces Reuse

09/14/2023
by   Matteo Golinelli, et al.
0

Content Security Policy (CSP) is an effective security mechanism that prevents the exploitation of Cross-Site Scripting (XSS) vulnerabilities on websites by specifying the sources from which their web pages can load resources, such as scripts and styles. CSP nonces enable websites to allow the execution of specific inline scripts and styles without relying on a whitelist. In this study, we measure and analyze the use of CSP nonces in the wild, specifically looking for nonce reuse, short nonces, and invalid nonces. We find that, of the 2271 sites that deploy a nonce-based policy, 598 of them reuse the same nonce value in more than one response, potentially enabling attackers to bypass protection offered by the CSP against XSS attacks. We analyze the causes of the nonce reuses to identify whether they are introduced by the server-side code or if the nonces are being cached by web caches. Moreover, we investigate whether nonces are only reused within the same session or for different sessions, as this impacts the effectiveness of CSP in preventing XSS attacks. Finally, we discuss the possibilities for attackers to bypass the CSP and achieve XSS in different nonce reuse scenarios.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
06/25/2020

Usability, Accessibility and Web Security Assessment of E-government Websites in Tanzania

In spite of the fact that e-government agency (ega) in Tanzania emphasiz...
research
06/24/2018

WPSE: Fortifying Web Protocols via Browser-Side Security Monitoring

We present WPSE, a browser-side security monitor for web protocols desig...
research
12/03/2020

Can I Take Your Subdomain? Exploring Related-Domain Attacks in the Modern Web

Related-domain attackers control a sibling domain of their target web ap...
research
04/02/2020

CORSICA: Cross-Origin Web Service Identification

Vulnerabilities in private networks are difficult to detect for attacker...
research
09/04/2022

PhishClone: Measuring the Efficacy of Cloning Evasion Attacks

Web-based phishing accounts for over 90 web-browsers and security vendor...
research
03/13/2019

Preventing the attempts of abusing cheap-hosting Web-servers for monetization attacks

Over the past decades, the web is always one of the most popular targets...
research
11/10/2021

MAJORCA: Multi-Architecture JOP and ROP Chain Assembler

Nowadays, exploits often rely on a code-reuse approach. Short pieces of ...

Please sign up or login with your details

Forgot password? Click here to reset