ShadowProbe:面向隐藏算法复杂度漏洞的语言可扩展检测 ShadowProbe: Language-Extensible Detection of Hidden Algorithmic Complexity Vulnerabilities 预印本

⚠️ 本文为 预印本(arXiv 公开版本),尚未经过正式同行评审。作者自发公开,结论未经期刊审稿验证,阅读时请知悉。
发布时间:2026-07-06
👁️ 预览文献
💡 AI 中文简介
算法复杂度漏洞(ACV)是指攻击者用特定输入触发程序最坏情况,导致性能骤降甚至拒绝服务。其中一大隐患是“影子复杂度”——看似无害的标准库API内部隐藏着高昂计算成本。现有检测方法多依赖模糊测试、符号执行,往往局限于单一语言且需大量人工。本文提出ShadowProbe框架,通过轻量静态分析、自动重建执行上下文和LLM辅助生成测试,实现跨语言检测。在WISE基准上效率优于现有方法,并在CPython、JDK、Zig、Rustc、vLLM等大型系统中发现大量未知漏洞,多数已被维护者确认并部分修复。
领域软件安全 / 程序分析与漏洞检测
适合谁读需要一定专业背景(软件安全、程序分析或编译器方向的研究者与工程师)
核心贡献1. 提出“影子复杂度”概念,揭示标准库API中隐藏的非线性开销是ACV的重要来源;2. 构建ShadowProbe框架,结合轻量静态筛选、自动执行上下文重建与LLM辅助测试生成,实现语言可扩展的ACV检测。
关键数据在WISE基准上分析效率持续优于现有方法;在CPython、JDK、Zig、Rustc、vLLM等大型系统中发现大量未知ACV,多数已被维护者确认并部分修复。
推荐理由如果你关心软件性能安全,想知道那些看似无害的库调用如何被攻击者变成DoS武器,这篇论文给出了一个跨语言、可扩展的自动化检测方案,实战效果已在多个主流系统中验证。
关键词["算法复杂度漏洞", "影子复杂度", "静态分析", "大语言模型", "拒绝服务攻击", "跨语言检测"]

原文摘要

查看英文原文摘要

Algorithmic Complexity Vulnerabilities (ACVs) arise when adversarial inputs trigger worst-case execution behavior, causing severe performance degradation or Denial-of-Service conditions. A key but underexplored source is shadow complexity: non-trivial computational costs hidden inside seemingly benign standard library APIs. Because these costs are invisible at call sites, attackers can exploit them to induce unexpected superlinear runtime behavior. Existing ACV detectors often rely on fuzzing, symbolic execution, or hybrid analysis, but they are usually language-specific, require substantial manual effort to construct harnesses, and depend on heavy runtime instrumentation. We present ShadowProbe, a scalable and language-extensible framework for discovering ACVs through lightweight static analysis, automated reconstruction of execution contexts, and Large Language Model (LLM) assisted test generation. ShadowProbe uses a structured multi-stage pipeline: it statically screens for candidate functions guided by shadow-complexity signals, reconstructs minimal executable contexts from project-level symbols, and synthesizes size-controlled inputs to probe worst-case behavior. It then validates candidates using execution-time measurements and robust statistical growth inference, separating true algorithmic blowups from runtime noise such as garbage collection and JIT compilation effects. We evaluate ShadowProbe on the WISE benchmark, where it consistently improves analysis efficiency over existing approaches. We further apply it to large-scale systems including CPython, the JDK, Zig, Rustc, and vLLM, uncovering many previously unknown ACVs, many of which have been confirmed and partially remediated by maintainers. These results show that ShadowProbe can identify hidden algorithmic risks across diverse real-world codebases.

📚 参考文献 (41 条)

查看全部 41 条
  1. [1] S. A. Crosby and D. S. Wallach, “Denial of service via algorithmic complexity attacks,” in Proceedings of the 12th USENIX Security Symposium, Washington, D.C., USA, August 4-8, 2003. USENIX Association, 2003. [Online]. Available: https://www.usenix.org/confere nce/12th-usenix-security-symposium/denial-service-algorithmic-compl exity-attacks
  2. [2] X. Cai, Y. Gui, and R. Johnson, “Exploiting unix file-system races via algorithmic complexity attacks,” in 30th IEEE Symposium on Security and Privacy (SP 2009), 17-20 May 2009, Oakland, California, USA. IEEE Computer Society, 2009, pp. 27–41. [Online]. Available: https://doi.org/10.1109/SP.2009.10
  3. [3] T. Petsios, J. Zhao, A. D. Keromytis, and S. Jana, “Slowfuzz: Automated domain-independent detection of algorithmic complexity vulnerabilities,” in Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security, CCS 2017, Dallas, TX, USA, October 30 - November 03, 2017, B. Thuraisingham, D. Evans, T. Malkin, and D. Xu, Eds. ACM, 2017, pp. 2155–2168. [Online]. Available: https://doi.org/10.1145/3133956.3134073
  4. [4] Y. Liu and W. Meng, “Acquirer: A hybrid approach to detecting algorithmic complexity vulnerabilities,” in Proceedings of the 2022 ACM SIGSAC Conference on Computer and Communications Security, CCS 2022, Los Angeles, CA, USA, November 7-11, 2022, H. Yin, A. Stavrou, C. Cremers, and E. Shi, Eds. ACM, 2022, pp. 2071–2084.
  5. [Online]. Available: https://doi.org/10.1145/3548606.3559337
  6. [5] P. Awadhutkar, G. R. Santhanam, B. Holland, and S. C. Kothari, “DISCOVER: detecting algorithmic complexity vulnerabilities,” in Proceedings of the ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering, ESEC/SIGSOFT FSE 2019, Tallinn, Estonia, August 26-30, 2019, M. Dumas, D. Pfahl, S. Apel, and A. Russo, Eds. ACM, 2019, pp. 1129–1133.
  7. [Online]. Available: https: //doi.org/10.1145/3338906.3341177
  8. [6] W. Blair, A. Mambretti, S. Arshad, M. Weissbacher, W. Robertson, E. Kirda, and M. Egele, “Hotfuzz: Discovering algorithmic denial-of- service vulnerabilities through guided micro-fuzzing,” in 27th Annual Network and Distributed System Security Symposium, NDSS 2020, San Diego, California, USA, February 23-26, 2020. The Internet Society, 2020. [Online]. Available: https://www.ndss-symposium.org/ndss-paper /hotfuzz-discovering-algorithmic-denial-of-service-vulnerabilities-thr ough-guided-micro-fuzzing/
  9. [7] MITRE Corporation, “CWE-407: Inefficient algorithmic complexity,” https://cwe.mitre.org/data/definitions/407.html, accessed: 2025-08-10.
  10. [8] NIST, “CVE-2020-10735,” https://nvd.nist.gov/vuln/detail/CVE-2020-1 0735, accessed: 2025-08-10.
  11. [9] ——, “CVE-2014-1474,” https://nvd.nist.gov/vuln/detail/CVE-2014-1 474, accessed: 2025-08-10.
  12. [10] J. Wei, J. Chen, Y. Feng, K. Ferles, and I. Dillig, “Singularity: pattern fuzzing for worst case complexity,” in Proceedings of the 2018 ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering, ESEC/SIGSOFT FSE 2018, Lake Buena Vista, FL, USA, November 04-09, 2018, G. T. Leavens, A. Garcia, and C. S. Pasareanu, Eds. ACM, 2018, pp. 213–223. [Online]. Available: https://doi.org/10.1145/ 3236024.3236039
  13. [11] J. Burnim, S. Juvekar, and K. Sen, “WISE: automated test generation for worst-case complexity,” in 31st International Conference on Software Engineering, ICSE 2009, May 16-24, 2009, Vancouver, Canada, Proceedings. IEEE, 2009, pp. 463–473. [Online]. Available: https://doi.org/10.1109/ICSE.2009.5070545
  14. [12] K. S. Luckow, R. Kersten, and C. S. Pasareanu, “Symbolic complexity analysis using context-preserving histories,” in 2017 IEEE International Conference on Software Testing, Verification and Validation, ICST 2017, Tokyo, Japan, March 13-17, 2017. IEEE Computer Society, 2017, pp. 58–68. [Online]. Available: https://doi.org/10.1109/ICST.2017.13
  15. [13] Y. Noller, R. Kersten, and C. S. Pasareanu, “Badger: complexity analysis with fuzzing and symbolic execution,” in Proceedings of the 27th ACM SIGSOFT International Symposium on Software Testing and Analysis, ISSTA 2018, Amsterdam, The Netherlands, July 16-21, 2018, F. Tip and E. Bodden, Eds. ACM, 2018, pp. 322–332. [Online]. Available: https://doi.org/10.1145/3213846.3213868
  16. [14] vLLM Project Contributors, “vllm: A high-throughput and memory- efficient inference and serving engine for large language models,” https://github.com/vllm-project/vllm, accessed: 2026-01-21.
  17. [15] M. Chen, J. Tworek, H. Jun, Q. Yuan, H. P. de Oliveira Pinto, J. Kaplan, H. Edwards, Y. Burda, N. Joseph, G. Brockman, A. Ray, R. Puri, G. Krueger, M. Petrov, H. Khlaaf, G. Sastry, P. Mishkin, B. Chan, S. Gray, N. Ryder, M. Pavlov, A. Power, L. Kaiser, M. Bavarian, C. Winter, P. Tillet, F. P. Such, D. Cummings, M. Plappert, F. Chantzis, E. Barnes, A. Herbert-Voss, W. H. Guss, A. Nichol, A. Paino, N. Tezak, J. Tang, I. Babuschkin, S. Balaji, S. Jain, W. Saunders, C. Hesse, A. N. Carr, J. Leike, J. Achiam, V. Misra, E. Morikawa, A. Radford, M. Knight, M. Brundage, M. Murati, K. Mayer, P. Welinder, B. McGrew, D. Amodei, S. McCandlish, I. Sutskever, and W. Zaremba, “Evaluating large language models trained on code,” CoRR, vol. abs/2107.03374, 2021. [Online]. Available: https://arxiv.org/abs/2107.03374
  18. [16] H. Li, Y. Hao, Y. Zhai, and Z. Qian, “Assisting static analysis with large language models: A chatgpt experiment,” in Proceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering, ESEC/FSE 2023, San Francisco, CA, USA, December 3-9, 2023, S. Chandra, K. Blincoe, and P. Tonella, Eds. ACM, 2023, pp. 2107–2111. [Online]. Available: https://doi.org/10.1145/3611643.3613078
  19. [17] M. Schäfer, S. Nadi, A. Eghbali, and F. Tip, “An empirical evaluation of using large language models for automated unit test generation,” IEEE Trans. Software Eng., vol. 50, no. 1, pp. 85–105, 2024. [Online]. Available: https://doi.org/10.1109/TSE.2023.3334955
  20. [18] Tree-sitter Project, “Tree-sitter: An incremental parsing system,” https: //tree-sitter.github.io/, accessed: 2026-02-01.
  21. [19] OpenAI, “Introducing GPT-4.1 in the API,” https://openai.com/index/g pt-4-1/, published: 2025-04-14; Accessed: 2026-02-02.
  22. [20] DeepSeek-AI, “DeepSeek-V3.2: Pushing the frontier of open large language models,” https://huggingface.co/deepseek-ai/DeepSeek-V3.2, published: 2025-12-01; Accessed: 2026-02-02.
  23. [21] ——, “DeepSeek-V4: Towards highly efficient million-token context intelligence,” https://huggingface.co/deepseek-ai/DeepSeek-V4-Flash, 2026, accessed: 2026-06-28.
  24. [22] Z. Hatfield-Dodds, “HypoFuzz,” https://github.com/Zac-HD/hypofuzz, accessed: 2026-06-19.
  25. [23] Ł. Langa, “PEP 443 – Single-dispatch Generic Functions,” https://peps .python.org/pep-0443/, 2013, accessed: 2026-01-05.
  26. [24] K. Barrett, B. Cassels, P. Haahr, D. A. Moon, K. Playford, and P. T. Withington, “A monotonic superclass linearization for dylan,” in Proceedings of the 1996 ACM SIGPLAN Conference on Object- Oriented Programming Systems, Languages & Applications, OOPSLA 1996, San Jose, California, USA, October 6-10, 1996, L. Anderson and J. Coplien, Eds. ACM, 1996, pp. 69–82. [Online]. Available: https://doi.org/10.1145/236337.236343
  27. [25] M. Simionato, “The python 2.3 method resolution order,” https://www. python.org/download/releases/2.3/mro/, 2003, accessed: 2026-01-05.
  28. [26] Django Software Foundation, “Django web framework,” https://github .com/django/django, accessed: 2026-02-01.
  29. [27] Pallets Team, “Flask-mail,” https://github.com/pallets-eco/flask-mail, accessed: 2026-02-01.
  30. [28] GNU Project, “Gnu mailman,” https://gitlab.com/mailman, accessed: 2026-02-01.
  31. [29] A. M. Kuchling, “What’s new in python 2.4: Optimizations,” https: //docs.python.org/2/whatsnew/2.4.html#optimizations, 2005, accessed: 2026-01-25.
  32. [30] C. Bolz-Tereick, “Repeated string concatenation is quadratic in PyPy (and CPython),” https://pypy.org/posts/2023/01/string-concatenation-q uadratic.html, 2023, accessed: 2026-01-25.
  33. [31] C. Saumya, J. Koo, M. Kulkarni, and S. Bagchi, “XSTRESSOR : Automatic generation of large-scale worst-case test inputs by inferring path conditions,” in 12th IEEE Conference on Software Testing, Validation and Verification, ICST 2019, Xi’an, China, April 22-27, 2019. IEEE, 2019, pp. 1–12. [Online]. Available: https://doi.org/10.1109/ICST.2019.00011
  34. [32] X. Zhou, S. Cao, X. Sun, and D. Lo, “Large language model for vulnerability detection and repair: Literature review and the road ahead,” ACM Trans. Softw. Eng. Methodol., vol. 34, no. 5, pp. 145:1–145:31, 2025. [Online]. Available: https://doi.org/10.1145/3708522
  35. [33] A. Khare, S. Dutta, Z. Li, A. Solko-Breslin, R. Alur, and M. Naik, “Understanding the effectiveness of large language models in detecting security vulnerabilities,” in IEEE Conference on Software Testing, Verification and Validation, ICST 2025, Napoli, Italy, March 31 - April 4, 2025. IEEE, 2025, pp. 103–114. [Online]. Available: https://doi.org/10.1109/ICST62969.2025.10988968
  36. [34] Y. Sun, D. Wu, Y. Xue, H. Liu, W. Ma, L. Zhang, M. Shi, and Y. Liu, “Llm4vuln: A unified evaluation framework for decoupling and enhancing llms’ vulnerability reasoning,” CoRR, vol. abs/2401.16185, 2024. [Online]. Available: https://doi.org/10.48550/arXiv.2401.16185
  37. [35] P. Liu, J. Liu, L. Fu, K. Lu, Y. Xia, X. Zhang, W. Chen, H. Weng, S. Ji, and W. Wang, “Exploring chatgpt’s capabilities on vulnerability management,” in 33rd USENIX Security Symposium, USENIX Security 2024, Philadelphia, PA, USA, August 14-16, 2024, D. Balzarotti and W. Xu, Eds. USENIX Association, 2024. [Online]. Available: https: //www.usenix.org/conference/usenixsecurity24/presentation/liu-peiyu
  38. [36] V. Wüstholz, O. Olivo, M. J. H. Heule, and I. Dillig, “Static detection of dos vulnerabilities in programs that use regular expressions,” in Tools and Algorithms for the Construction and Analysis of Systems - 23rd International Conference, TACAS 2017, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2017, Uppsala, Sweden, April 22-29, 2017, Proceedings, Part II, ser. Lecture Notes in Computer Science, A. Legay and T. Margaria, Eds., vol. 10206, 2017, pp. 3–20. [Online]. Available: https://doi.org/10.1007/978-3-662-54580-5_1
  39. [37] G. Kambourakis, T. Moschos, D. Geneiatakis, and S. Gritzalis, “Detecting DNS amplification attacks,” in Critical Information Infrastructures Security, Second International Workshop, CRITIS 2007, Málaga, Spain, October 3-5, 2007. Revised Papers, ser. Lecture Notes in Computer Science, J. López and B. M. Hämmerli, Eds., vol. 5141. Springer, 2007, pp. 185–196. [Online]. Available: https://doi.org/10.1007/978-3-540-89173-4_16
  40. [38] Y. Afek, A. Bremler-Barr, and L. Shafir, “Nxnsattack: Recursive DNS inefficiencies and vulnerabilities,” in 29th USENIX Security Symposium, USENIX Security 2020, August 12-14, 2020, S. Capkun and F. Roesner, Eds. USENIX Association, 2020, pp. 631–648. [Online]. Available: https://www.usenix.org/conference/usenixsecurity20/presentation/afek
  41. [39] Y. Liu, M. Zhang, and W. Meng, “Revealer: Detecting and exploiting regular expression denial-of-service vulnerabilities,” in 42nd IEEE Symposium on Security and Privacy, SP 2021, San Francisco, CA, USA, 24-27 May 2021. IEEE, 2021, pp. 1468–1484. [Online]. Available: https://doi.org/10.1109/SP40001.2021.00062