论文标题

数据库流量截距,用于灰色检测存储和上下文敏感XSS的检测

Database Traffic Interception for Graybox Detection of Stored and Context-Sensitive XSS

论文作者

Steinhauser, Antonín, Tůma, Petr

论文摘要

XSS是一个安全漏洞,允许将恶意代码注入Web应用程序的客户端。在最简单的情况下,XSS漏洞会在Web应用程序中包含Web输出中的用户输入而无需进行适当消毒时会出现。可以通过BlackBox扫描仪可靠地检测到这种简单的XSS漏洞,该扫描仪将恶意有效载荷注入HTTP请求的敏感部分,并在Web输出中寻找反射值。 当代黑框扫描仪对存储的XSS漏洞无效,其中HTTP响应中的恶意有效负载源自Web应用程序的数据库存储,而不是来自关联的HTTP请求。同样,许多BlackBox扫描仪不会系统地处理上下文敏感的XSS漏洞,在此转换后,在此转换后,用户输入包含在Web输出中,以防止扫描仪识别原始值,但不能充分消毒该值。在两个基本数据源(已存储与反射)和两个基本漏洞模式(上下文敏感与不是如此)的组合中,仅通过最先进的黑框扫描仪进行系统测试。 我们的工作着重于对剩余三种组合的系统覆盖。我们提出了一种灰色盒机制,该机制扩展了通用数据库,与我们的XSS扫描仪合作,报告和注入数据库和Web应用程序之间边界的测试输入。此外,我们设计了一种机制,即使通过Web应用程序编码后,也可以识别Web输出中的注入输入,并检查编码是否在相应的浏览器上下文中正确地对注入的输入进行了卫生。我们在八个成熟和技术上多样化的Web应用程序上评估了我们的方法,发现了以前未知的和可利用的XSS缺陷。

XSS is a security vulnerability that permits injecting malicious code into the client side of a web application. In the simplest situations, XSS vulnerabilities arise when a web application includes the user input in the web output without due sanitization. Such simple XSS vulnerabilities can be detected fairly reliably with blackbox scanners, which inject malicious payload into sensitive parts of HTTP requests and look for the reflected values in the web output. Contemporary blackbox scanners are not effective against stored XSS vulnerabilities, where the malicious payload in an HTTP response originates from the database storage of the web application, rather than from the associated HTTP request. Similarly, many blackbox scanners do not systematically handle context-sensitive XSS vulnerabilities, where the user input is included in the web output after a transformation that prevents the scanner from recognizing the original value, but does not sanitize the value sufficiently. Among the combination of two basic data sources (stored vs reflected) and two basic vulnerability patterns (context sensitive vs not so), only one is therefore tested systematically by state-of-the-art blackbox scanners. Our work focuses on systematic coverage of the three remaining combinations. We present a graybox mechanism that extends a general purpose database to cooperate with our XSS scanner, reporting and injecting the test inputs at the boundary between the database and the web application. Furthermore, we design a mechanism for identifying the injected inputs in the web output even after encoding by the web application, and check whether the encoding sanitizes the injected inputs correctly in the respective browser context. We evaluate our approach on eight mature and technologically diverse web applications, discovering previously unknown and exploitable XSS flaws in each of those applications.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源