QLCoder: A Query Synthesizer For Static Analysis of Security Vulnerabilities
Claire Wang, Ziyang Li, Saikat Dutta, Mayur Naik
静态分析工具提供了一种强大的手段,通过指定编码易受攻击的代码模式的查询来检测安全漏洞。 然而,编写此类查询具有挑战性,需要在安全和程序分析方面具有多种专业知识。 为了应对这一挑战,我们展示了QLCoder - 一个代理框架,它自动合成CodeQL中的查询,CodeQL是一个强大的静态分析引擎,直接从给定的CVE元数据。 QLCode将LLM嵌入到具有执行反馈的合成循环中,同时使用自定义MCP接口限制其推理,该接口允许与语言服务器协议(用于语法指导)和RAG数据库(用于查询和文档的语义检索)进行结构化交互。 这种方法允许QLCoder生成语法和语义上有效的安全查询。 我们在 111 个 Java 项目中对 176 个现有 CVE 进行 QLCode 评估。 基于 Claude Code 代理框架,QLCoder 综合了正确的查询,检测易受攻击的 CVE ,但在 53.4% 的 CVE 的修补版本中检测 CVE。 相比之下,仅使用克劳德代码可以合成10%的正确查询。
Static analysis tools provide a powerful means to detect security vulnerabilities by specifying queries that encode vulnerable code patterns. However, writing such queries is challenging and requires diverse expertise in security and program analysis. To address this challenge, we present QLCoder - an agentic framework that automatically synthesizes queries in CodeQL, a powerful static analysis engine, directly from a given CVE metadata. QLCode embeds an LLM in a synthesis loop with execution fe...