Back to Search
Start Over
Assessing the Impact of Script Gadgets on CSP at Scale
- Source :
- AsiaCCS
- Publication Year :
- 2020
- Publisher :
- ACM, 2020.
-
Abstract
- The Web, as one of the core technologies of modern society, has profoundly changed the way we interact with people and data. One of the worst attacks on the Web is Cross-Site Scripting (XSS), in which an attacker is able to inject their malicious JavaScript code into a Web application, giving this code full access to the victimized site. To mitigate the impact of markup injection flaws that cause XSS, support for the Content Security Policy (CSP) is nowadays shipped in all browsers. Deploying such a policy enables a Web developer to whitelist from where script code can be loaded, essentially constraining the capabilities of the attacker to only be able to execute injected code from the said whitelist. As recently shown by Lekies et al., injecting script markup is not a necessary prerequisite for a successful attack in the presence of so-called script gadgets. These small snippets of benign JavaScript code transform non-script markup contained in a page into executable JavaScript, opening the door for bypasses of a deployed CSP. Especially in combination with CSP's logic in handling redirected resources, script gadgets enable attackers to bypass an otherwise secure policy. In this paper, we, therefore, ask the question: is securely deploying CSP even possible without a priori knowledge of all files hosted on even a partially trusted origin? To answer this question, we investigate the severity of the findings of Lekies et al., showing real-world Web sites on which, even in the presence of CSP and without code containing such gadgets being added by the developer, an attacker can sideload libraries with known script gadgets, as long as the hosting site is whitelisted in the CSP. In combination with CSPs matching logic for redirects, this enables us to bypass 10% of otherwise secure policies in the wild. To further answer our main research question, we conduct a hypothetical what-if analysis. Doing so, we automatically generate sensible CSPs for all of the Top 10,000 sites and show that around one-third of all sites would still be susceptible to a bypass through script gadget sideloading due to heavy reliance on third parties that also host such libraries.
- Subjects :
- 050101 languages & linguistics
Markup language
business.industry
Computer science
Cross-site scripting
05 social sciences
Whitelist
02 engineering and technology
computer.file_format
Web developer
Content Security Policy
computer.software_genre
JavaScript
Computer security
Scripting language
0202 electrical engineering, electronic engineering, information engineering
Web application
020201 artificial intelligence & image processing
0501 psychology and cognitive sciences
Executable
business
computer
computer.programming_language
Subjects
Details
- Database :
- OpenAIRE
- Journal :
- Proceedings of the 15th ACM Asia Conference on Computer and Communications Security
- Accession number :
- edsair.doi...........cbaf1ce1901774d1103b6d17dcb313ae
- Full Text :
- https://doi.org/10.1145/3320269.3372201