Bing Zhang;Hongbo Jin;Rong Ren;Jiadong Ren;Qian Wang
{"title":"DPSSX: Detecting and Preventing SQLi and Stored XSS Induced by Expressions in Web Application SQL Statements via Static-Dynamic Analysis","authors":"Bing Zhang;Hongbo Jin;Rong Ren;Jiadong Ren;Qian Wang","doi":"10.1109/TSE.2026.3709280","DOIUrl":null,"url":null,"abstract":"Injection vulnerabilities in SQL statements (e.g., SQLi and stored XSS) critically threaten web applications. Existing detection methods—source-origin-based, structure-based, and variable/rule-based—struggle when SQL statements contain arithmetic or function expressions, resulting in high false positives. To overcome this, we propose DPSSX, an automated detection and prevention prototype leveraging static and dynamic analysis to <underline>D</u>etect and <underline>P</u>revent <underline>S</u>QLi and <underline>S</u>tored <underline>X</u>SS attacks triggered by expressions in SQL statements. DPSSX first applies static analysis to locate SQL statements, identify data sources (POST, sessions, databases, etc.), and flag variables in arithmetic/function expressions that may alter attack impact. A dynamic global HTTP request extractor then collects comprehensive inputs for complex applications. Using a joint attack engine, DPSSX injects payloads covering the latest attack patterns. Through proxy-based execution, it captures SQL queries containing payloads or expressions. An expression pre-execution module computes results to mitigate false positives from expression-based neutralization/amplification. By matching query data against attack-pattern rules, DPSSX detects first/second-order SQL injection and stored XSS attacks and sanitizes malicious inputs using character escaping, truncation, unified decoding, and malicious keyword blocking. In our evaluation, using five attack generators to produce 120,495 SQL injection attacks and 3,763 XSS attacks, DPSSX successfully identified 441 first-order SQL injection vulnerabilities, 28 second-order SQL injection vulnerabilities, and 101 stored XSS vulnerabilities across 20 well-known open-source web applications. Additionally, DPSSX achieved 100% elimination of malicious effects on data with negligible overhead.","PeriodicalId":13324,"journal":{"name":"IEEE Transactions on Software Engineering","volume":"52 10","pages":"3071-3089"},"PeriodicalIF":6.0000,"publicationDate":"2026-10-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"IEEE Transactions on Software Engineering","FirstCategoryId":"94","ListUrlMain":"https://ieeexplore.ieee.org/document/11592690/","RegionNum":1,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"2026/7/1 0:00:00","PubModel":"Epub","JCR":"Q1","JCRName":"COMPUTER SCIENCE, SOFTWARE ENGINEERING","Score":null,"Total":0}
引用次数: 0
Abstract
Injection vulnerabilities in SQL statements (e.g., SQLi and stored XSS) critically threaten web applications. Existing detection methods—source-origin-based, structure-based, and variable/rule-based—struggle when SQL statements contain arithmetic or function expressions, resulting in high false positives. To overcome this, we propose DPSSX, an automated detection and prevention prototype leveraging static and dynamic analysis to Detect and Prevent SQLi and Stored XSS attacks triggered by expressions in SQL statements. DPSSX first applies static analysis to locate SQL statements, identify data sources (POST, sessions, databases, etc.), and flag variables in arithmetic/function expressions that may alter attack impact. A dynamic global HTTP request extractor then collects comprehensive inputs for complex applications. Using a joint attack engine, DPSSX injects payloads covering the latest attack patterns. Through proxy-based execution, it captures SQL queries containing payloads or expressions. An expression pre-execution module computes results to mitigate false positives from expression-based neutralization/amplification. By matching query data against attack-pattern rules, DPSSX detects first/second-order SQL injection and stored XSS attacks and sanitizes malicious inputs using character escaping, truncation, unified decoding, and malicious keyword blocking. In our evaluation, using five attack generators to produce 120,495 SQL injection attacks and 3,763 XSS attacks, DPSSX successfully identified 441 first-order SQL injection vulnerabilities, 28 second-order SQL injection vulnerabilities, and 101 stored XSS vulnerabilities across 20 well-known open-source web applications. Additionally, DPSSX achieved 100% elimination of malicious effects on data with negligible overhead.
期刊介绍:
IEEE Transactions on Software Engineering seeks contributions comprising well-defined theoretical results and empirical studies with potential impacts on software construction, analysis, or management. The scope of this Transactions extends from fundamental mechanisms to the development of principles and their application in specific environments. Specific topic areas include:
a) Development and maintenance methods and models: Techniques and principles for specifying, designing, and implementing software systems, encompassing notations and process models.
b) Assessment methods: Software tests, validation, reliability models, test and diagnosis procedures, software redundancy, design for error control, and measurements and evaluation of process and product aspects.
c) Software project management: Productivity factors, cost models, schedule and organizational issues, and standards.
d) Tools and environments: Specific tools, integrated tool environments, associated architectures, databases, and parallel and distributed processing issues.
e) System issues: Hardware-software trade-offs.
f) State-of-the-art surveys: Syntheses and comprehensive reviews of the historical development within specific areas of interest.