Lune

NDSS2023顶会

DiffCSP: Finding Browser Bugs in Content Security Policy Enforcement through Differential Testing

Seongil Wi, Trung Tin Nguyen, Jihwan Kim, Ben Stock, Sooel Son

摘要

—The Content Security Policy (CSP) is one of the de facto security mechanisms that mitigate web threats. Many websites have been deploying CSPs mainly to mitigate cross-site scripting (XSS) attacks by instructing client browsers to constrain JavaScript (JS) execution. However, a browser bug in CSP enforcement enables an adversary to bypass a deployed CSP, posing a security threat. As the CSP specification evolves, CSP becomes more complicated in supporting an increasing number of directives, which brings additional complexity to implementing correct enforcement behaviors. Unfortunately, the finding of CSP enforcement bugs in a systematic way has been largely understudied. In this paper, we propose DiffCSP, the first differential testing framework to find CSP enforcement bugs involving JS execution. DiffCSP generates CSPs and a comprehensive set of HTML instances that exhibit all known ways of executing JS snippets. DiffCSP then executes each HTML instance for each generated policy across different browsers, thereby collecting inconsistent execution results. To analyze a large volume of the execution results, we leverage a decision tree and identify common causes of the observed inconsistencies. We demonstrate the efficacy of DiffCSP by finding 29 security bugs and eight functional bugs. We also show that three bugs are due to unclear descriptions of the CSP specification. We further identify the common root causes of CSP enforcement bugs, such as incorrect CSP inheritance and hash handling. We confirm the risky trend of client browsers deriving completely different interpretations from the same CSPs, which raises security concerns. Our study demonstrates the effectiveness of DiffCSP for identifying CSP enforcement bugs, and our findings have contributed to patching 12 security bugs in major browsers, including Chrome and Safari.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 11 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • BUIzz: Finding Policy Enforcement Bugs via Interaction Simulation on the Browser User Interface 引用了 How the Web Tangled Itself: Uncovering the History of Client-Side Web (In)Security
  • BUIzz: Finding Policy Enforcement Bugs via Interaction Simulation on the Browser User Interface 引用了 Skyfire: Data-Driven Seed Generation for Fuzzing
  • BUIzz: Finding Policy Enforcement Bugs via Interaction Simulation on the Browser User Interface 引用了 Content Security Problems?: Evaluating the Effectiveness of Content Security Policy in the Wild
  • BUIzz: Finding Policy Enforcement Bugs via Interaction Simulation on the Browser User Interface 引用了 Web Platform Threats: Automated Detection of Web Security Issues With WPT
  • BUIzz: Finding Policy Enforcement Bugs via Interaction Simulation on the Browser User Interface 引用了 CSP Is Dead, Long Live CSP! On the Insecurity of Whitelists and the Future of Content Security Policy
  • Parse Me, Baby, One More Time: Bypassing HTML Sanitizer via Parsing Differentials 引用了 How the Web Tangled Itself: Uncovering the History of Client-Side Web (In)Security
  • Parse Me, Baby, One More Time: Bypassing HTML Sanitizer via Parsing Differentials 引用了 Content Security Problems?: Evaluating the Effectiveness of Content Security Policy in the Wild
  • Parse Me, Baby, One More Time: Bypassing HTML Sanitizer via Parsing Differentials 引用了 CSP Is Dead, Long Live CSP! On the Insecurity of Whitelists and the Future of Content Security Policy
  • Rise of Inspectron: Automated Black-box Auditing of Cross-platform Electron Apps 引用了 Content Security Problems?: Evaluating the Effectiveness of Content Security Policy in the Wild
  • MatriXSSed: A New Taxonomy for XSS in the Modern Web 引用了 CSP Is Dead, Long Live CSP! On the Insecurity of Whitelists and the Future of Content Security Policy
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper11

  1. Parse Me, Baby, One More Time: Bypassing HTML Sanitizer via Parsing DifferentialsDavid Klein, Martin JohnsS&P 2024 · 7 次引用
  2. Web Platform Threats: Automated Detection of Web Security Issues With WPTPedro Bernardo, Lorenzo Veronese, Valentino Dalla Valle, Stefano Calzavara 等USENIX Security 2024 · 6 次引用
  3. Rise of Inspectron: Automated Black-box Auditing of Cross-platform Electron AppsMir Masood Ali, Mohammad Ghasemisharif, Chris Kanich, Jason PolakisUSENIX Security 2024 · 2 次引用
  4. MatriXSSed: A New Taxonomy for XSS in the Modern WebDolière Francis SoméWWW 2025 · 2 次引用
  5. BUIzz: Finding Policy Enforcement Bugs via Interaction Simulation on the Browser User InterfaceMingi Jung, Donggyu Kim, Mijung Kim, Seongil WiUSENIX Security 2026

它引用的 Paper16

  1. Skyfire: Data-Driven Seed Generation for FuzzingJunjie Wang, Bihuan Chen, Lei Wei, Yang LiuS&P 2017 · 382 次引用
  2. CSP Is Dead, Long Live CSP! On the Insecurity of Whitelists and the Future of Content Security PolicyLukas Weichselbaum, Michele Spagnuolo, Sebastian Lekies, Artur JancCCS 2016 · 114 次引用
  3. Content Security Problems?: Evaluating the Effectiveness of Content Security Policy in the WildStefano Calzavara, Alvise Rabitti, Michele BugliesiCCS 2016 · 71 次引用
  4. How the Web Tangled Itself: Uncovering the History of Client-Side Web (In)SecurityBen Stock, Martin Johns, Marius Steffens, Michael BackesUSENIX Security 2017 · 67 次引用
  5. CSPAutoGen: Black-box Enforcement of Content Security Policy upon Real-world WebsitesXiang Pan, Yinzhi Cao, Shuangping Liu, Yu Zhou 等CCS 2016 · 55 次引用

相关 Paper

  1. A Bug's Life: Analyzing the Lifecycle and Mitigation Process of Content Security Policy BugsGertjan Franken, Tom van Goethem, Lieven Desmet, Wouter JoosenUSENIX Security 2023
  2. A Tale of Two Headers: A Formal Analysis of Inconsistent Click-Jacking Protection on the WebStefano Calzavara, Sebastian Roth, Alvise Rabitti, Michael Backes 等USENIX Security 2020
  3. CCSP: Controlled Relaxation of Content Security Policies by Runtime Policy CompositionStefano Calzavara, Alvise Rabitti, Michele BugliesiUSENIX Security 2017 · 15 次引用
  4. Head(er)s Up! Detecting Security Header Inconsistencies in BrowsersJannis Rautenstrauch, Trung Tin Nguyen, Karthik Ramakrishnan, Ben StockCCS 2025
  5. 12 Angry Developers - A Qualitative Study on Developers' Struggles with CSPSebastian Roth, Lea Gröber, Michael Backes, Katharina Krombholz 等CCS 2021 · 22 次引用
黄昏的海面,两侧是细线勾勒的悬崖