一句话:首次黑盒测量真实 Web 服务中由公开正则净化逻辑导致的 ReDoS 漏洞,并推动修复与防御。
论文研究 Web 服务公开其输入净化正则表达式所带来的正则表达式拒绝服务(ReDoS)风险。作者提出“一致净化假设”,即客户端可见的净化逻辑(含正则)与服务器端一致,并据此对 1,000 个服务的 HTML 表单和 475 个服务的 API 进行黑盒分析:识别公开正则,筛选脆弱正则,构造 ReDoS 探针并定位漏洞。结果显示 355 个服务公开正则,17 个发布不安全正则,6 个服务(6 个域、15 个子域)的 API 可被 ReDoS 攻击。微软和 AWS 因此修补服务;作者还为流行 API 校验库提交的 ReDoS 防御补丁已被合并。
Web services use server-side input sanitization to guard against harmful input. Some web services publish their sanitization logic to make their client interface more usable, e.g., allowing clients to debug invalid requests locally. However, this usability practice poses a security risk. Specifically, services may share the regexes they use to sanitize input strings - and regex-based denial of service (ReDoS) is an emerging threat. Although prominent service outages caused by ReDoS have spurred interest in this topic, we know little about the degree to which live web services are vulnerable to ReDoS. In this paper, we conduct the first black-box study measuring the extent of ReDoS vulnerabilities in live web services. We apply the Consistent Sanitization Assumption: that client-side sanitization logic, including regexes, is consistent with the sanitization logic on the server-side. We identify a service's regex-based input sanitization in its HTML forms or its API, find vulnerable regexes among these regexes, craft ReDoS probes, and pinpoint vulnerabilities. We analyzed the HTML forms of 1,000 services and the APIs of 475 services. Of these, 355 services publish regexes; 17 services publish unsafe regexes; and 6 services are vulnerable to ReDoS through their APIs (6 domains; 15 subdomains). Both Microsoft and Amazon Web Services patched their web services as a result of our disclosure. Since these vulnerabilities were from API specifications, not HTML forms, we proposed a ReDoS defense for a popular API validation library, and our patch has been merged. To summarize: in client-visible sanitization logic, some web services advertise Re-DoS vulnerabilities in plain sight. Our results motivate short-term patches and long-term fundamental solutions. “Make measurable what cannot be measured.” -Galileo Galilei