Fast Graph Simplification for Path-Sensitive Typestate Analysis through Tempo-Spatial Multi-Point Slicing
Xiao Cheng, Jiawei Ren, Yulei Sui
Abstract
Typestate analysis is a commonly used static technique to identify software vulnerabilities by assessing if a sequence of operations violates temporal safety specifications defined by a finite state automaton. Pathsensitive typestate analysis (PSTA) offers a more precise solution by eliminating false alarms stemming from infeasible paths. To improve the efficiency of path-sensitive analysis, previous efforts have incorporated sparse techniques, with a focus on analyzing the path feasibility of def-use chains. However, they cannot be directly applied to detect typestate vulnerabilities requiring temporal information within the control flow graph like use-to-use information.
In this paper, we introduce FGS, a Fast Graph Simplification approach designed for PSTA by retaining multi-point temporal information while harnessing the advantages of sparse analysis. We propose a new multi-point slicing technique that captures the temporal and spatial correlations within the program. By doing so, it optimizes the program by only preserving the necessary program dependencies, resulting in a sparser structure for precision-preserving PSTA. Our graph simplification approach, as a fast preprocessing step, offers several benefits for existing PSTA algorithms. These include a more concise yet precision-preserving graph structure, decreased numbers of variables and constraints within execution states, and simplified path feasibility checking. As a result, the overall efficiency of the PSTA algorithm exhibits significant improvement.
We evaluated FGS using NIST benchmarks and ten real-world large-scale projects to detect four types of vulnerabilities, including memory leaks, double-frees, use-after-frees, and null dereferences. On average, when comparing FGS against ESP (baseline PSTA), FGS reduces 89% of nodes, 86% of edges, and 88% of calling context of the input graphs, obtaining a speedup of 116× and a memory usage reduction of 93% on the large projects evaluated. Our experimental results also demonstrate that FGS outperforms six open-source tools (IKOS, ClangSA, Saber, Cppcheck, Infer, and Sparrow) on the NIST benchmarks, which comprises 846 programs. Specifically, FGS achieves significantly higher precision, with improvements of up to 171% (42% on average), and detects a greater number of true positives, with enhancements of up to 245% (52% on average). Moreover, among the ten large-scale projects, FGS successfully found 105 real bugs with a precision rate of 82%. In contrast, our baseline tools not only missed over 42% of the real bugs but also yielded an average precision rate of just 13%.
• Software and its engineering → Automated static analysis; Model checking.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 92a945d9-2ac0-4ad5-b6f9-82263e327d41Cited by top-tier papers5
- Type-Alias Analysis: Enabling LLVM IR with Accurate TypesJinmeng Zhou, Ziyue Pan, Wenbo Shen, Xingkai Wang et al.ISSTA 2025 · 1 citation
- TLR: Codebase-Level C Memory Management Error Repair with Large Language ModelsXiao Cheng, Zhihao Guo, Huan Huo, Yulei SuiFSE 2026 · 1 citation
- A Sound Static Analysis Approach to I/O API MigrationShangyu Li, Zhaoyang Zhang, Sizhe Zhong, Diyu Zhou et al.OOPSLA 2025
- Protecting Source Code Privacy When Hunting Memory BugsJielun Wu, Bing Shui, Hongcheng Fan, Shengxin Wu et al.ASE 2025
- Multi-stage On-Demand Program Slicing for Modular Analysis of Multi-threaded ProgramsJiawei Yang, Xiao Cheng, Jiawei Wang, Xiapu Luo et al.ISSTA 2026
Builds on11
- Typestate-guided fuzzer for discovering use-after-free vulnerabilitiesHaijun Wang, Xiaofei Xie, Yi Li, Cheng Wen et al.ICSE 2020 · 107 citations
- Path-sensitive code embedding via contrastive learning for software vulnerability detectionXiao Cheng, Guanqin Zhang, Haoyu Wang, Yulei SuiISSTA 2022 · 98 citations
- Flow2Vec: value-flow-based precise code embeddingYulei Sui, Xiao Cheng, Guanqin Zhang, Haoyu WangOOPSLA 2020 · 94 citations
- Fast graph simplification for interleaved Dyck-reachabilityYuanbo Li, Qirun Zhang, Thomas W. RepsPLDI 2020 · 30 citations
- Path-sensitive sparse analysis without path conditionsQingkai Shi, Peisen Yao, Rongxin Wu, Charles ZhangPLDI 2021 · 24 citations
Related papers
- Path-sensitive and alias-aware typestate analysis for detecting OS bugsTuo Li, Jia-Ju Bai, Yulei Sui, Shi-Min HuASPLOS 2022 · 16 citations
- Efficient Strong Updates For Path Sensitive Data Dependence AnalysisYiyuan Guo, Charles ZhangICSE 2026
- Precise Sparse Abstract Execution via Cross-Domain InteractionXiao Cheng, Jiawei Wang, Yulei SuiICSE 2024 · 6 citations
- Efficient Static Vulnerability Analysis for JavaScript with Multiversion Dependency GraphsMafalda Ferreira, Miguel Monteiro, Tiago Brito, Miguel E. Coimbra et al.PLDI 2024 · 13 citations
- Hermes: Making Path-Sensitive Pointer Analysis Scalable for Sparse Value-Flow AnalysisYuxuan He, Ruilin Jiang, He Zhang, Qingkai Shi et al.OOPSLA 2026
