paperbot · PL 论文追踪

全部论文 待读 收藏

P2 If It’s Not Secure, It Should Not Compile: Preventing DOM-Based XSS in Large-Scale Web Development with API Hardening

不安全就不应编译:通过 API 加固在大规模 Web 开发中防止基于 DOM 的 XSS
ICSE 2021 IEEE/ACM 43rd International Conference on Software Engineering (ICSE)2021匹配度 3/10 · 论文属于静态分析与工业级安全工程,核心是 DOM-based XSS 防护与 API 加固,与用户关注的 PL→AI、AI→PL、浮点程序分析或贝叶斯程序分析均无直接关系;仅在编译期检查、程序分析工具化和工业落地偏好上有边缘交集。引用 14 inbox
Pei Wang, Julian Bangert, Christoph Kern
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:提出 API 加固范式,用安全 API 与编译期检查在大规模 Web 开发中消除基于 DOM 的 XSS。

跨站脚本(XSS)仍是互联网主要安全威胁,复杂 Web 应用仅靠代码审查和测试难以高置信度消除。本文介绍 Google 的安全设计工程实践——API 加固:用一组安全 API 替换易受 XSS 影响的原生 DOM API,并通过类型契约、校验与转义保证基于这些 API 的应用不存在 XSS。部署简单的编译期检查器,强制开发者只能通过加固 API 访问 DOM。为在数万工程师中推广且不显著影响生产力,作者提供严格工具链与咨询支持。两年部署的实证结果表明,该方法在 Google 庞大代码库中减少了 XSS 漏洞。

问题
复杂 Web 应用中的基于 DOM 的 XSS 漏洞难以仅靠代码审查和测试可靠消除,大规模开发中缺乏可强制执行的防护。
方法
设计安全 API 替代易受攻击的原生 DOM API,借助类型契约、校验和转义保证安全,并用编译期检查器强制只使用加固 API;配套工具与咨询支持推广。
评估
在 Google 两年的大规模部署中,通过实证数据评估 API 加固对 XSS 漏洞数量的影响,并考察对工程师生产力的影响。
原文摘要(Abstract)

With tons of efforts spent on its mitigation, Cross-site scripting (XSS) remains one of the most prevalent security threats on the internet. Decades of exploitation and remediation demonstrated that code inspection and testing alone does not eliminate XSS vulnerabilities in complex web applications with a high degree of confidence. This paper introduces Google's secure-by-design engineering paradigm that effectively prevents DOM-based XSS vulnerabilities in large-scale web development. Our approach, named API hardening, enforces a series of company-wide secure coding practices. We provide a set of secure APIs to replace native DOM APIs that are prone to XSS vulnerabilities. Through a combination of type contracts and appropriate validation and escaping, the secure APIs ensure that applications based thereon are free of XSS vulnerabilities. We deploy a simple yet capable compile-time checker to guarantee that developers exclusively use our hardened APIs to interact with the DOM. We make various of efforts to scale this approach to tens of thousands of engineers without significant productivity impact. By offering rigorous tooling and consultant support, we help developers adopt the secure coding practices as seamlessly as possible. We present empirical results showing how API hardening has helped reduce the occurrences of XSS vulnerabilities in Google's enormous code base over the course of two-year deployment.

链接与引用

DOI 原文 · DBLP

BibTeX
@inproceedings{WangBK21,
  title = {If It’s Not Secure, It Should Not Compile: Preventing DOM-Based XSS in Large-Scale Web Development with API Hardening},
  author = {Pei Wang and Julian Bangert and Christoph Kern},
  booktitle = {ICSE},
  year = {2021},
  doi = {10.1109/icse43902.2021.00123}
}