JSCSP: A Novel Policy-Based XSS Defense Mechanism for Browsers

Guangquan Xu, Xiaofei Xie, Shuhan Huang, Jun Zhang, Lei Pan, Wei Lou, Kaitai Liang

Abstract

To mitigate cross-site scripting attacks (XSS), the W3C group recommends web service providers to employ a computer security standard called Content Security Policy (CSP). However, less than 3.7 percent of real-world websites are equipped with CSP according to Google’s survey. The low scalability of CSP is incurred by the difficulty of deployment and non-compatibility for state-of-art browsers. To explore the scalability of CSP, in this article, we propose JavaScript based CSP (JSCSP), which is able to support most of real-world browsers but also to generate security policies automatically. Specifically, JSCSP offers a novel self-defined security policy which enforces essential confinements to related items, including JavaScript functions, DOM elements and data access. Meanwhile, JSCSP has an efficient algorithm to automatically generate the policy directives and enforce them in a cascading way, which is more fine-grained and practical than the functionalities provided by CSP. We further implement JSCSP on a Chrome extension, and our evaluation shows that the extension is compatible with popular JavaScript libraries. Our JSCSP extension can detect and block the tested attacking vectors extracted from the prevalent web applications. We state that JSCSP delivers better performance compared to other XSS defense solutions.
BibTeX
@article{xu2022jscsp,
  author = {Guangquan Xu and Xiaofei Xie and Shuhan Huang and Jun Zhang and Lei Pan and Wei Lou and Kaitai Liang},
  title = {{JSCSP: A Novel Policy-Based XSS Defense Mechanism for Browsers}},
  journal = {IEEE Trans. Dependable Secur. Comput.},
  year = {2022},
  doi = {10.1109/tdsc.2020.3009472},
}

Loading related content...

Figure