arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2602.00711cs.CRcs.AIcs.SE
收藏

从检测到预防:解释安全关键代码以避免漏洞

From Detection to Prevention: Explaining Security-Critical Code to Avoid Vulnerabilities

Paderborn University \& Fraunhofer IEM Paderborn Germany;Amazon Web Services Berlin Germany;Paderborn University \& Fraunhofer IEM;Amazon Web Services

Ranjith Krishnamurthy, Oshando Johnson, Goran Piskachev, Eric Bodden

AI总结:

本文提出通过代码级别度量指标和LLM生成预防性解释,以主动预防安全漏洞。

摘要:

安全漏洞通常在开发过程中由于缺乏安全专业知识和代码复杂性而意外产生。传统工具,如静态和动态分析,只能在漏洞引入代码后才能检测到漏洞,导致高昂的修复成本。本文探索了一种预防漏洞的主动策略,通过突出实现安全关键功能的代码区域——如数据访问、认证和输入处理——并提供其安全实现的指导。我们提出了一个IntelliJ IDEA插件原型,利用代码级别的软件度量指标来识别可能的安全关键方法,并使用大型语言模型(LLMs)生成预防性的解释。我们在Spring-PetClinic应用程序上的初步评估表明,所选指标识别了大多数已知的安全关键方法,而LLM提供了具有操作性的、面向预防的见解。尽管这些指标捕捉的是结构属性而非安全的语义方面,但本工作为代码级别的安全感知度量指标和增强的解释奠定了基础。

英文摘要:

Security vulnerabilities often arise unintentionally during development due to a lack of security expertise and code complexity. Traditional tools, such as static and dynamic analysis, detect vulnerabilities only after they are introduced in code, leading to costly remediation. This work explores a proactive strategy to prevent vulnerabilities by highlighting code regions that implement security-critical functionality -- such as data access, authentication, and input handling -- and providing guidance for their secure implementation. We present an IntelliJ IDEA plugin prototype that uses code-level software metrics to identify potentially security-critical methods and large language models (LLMs) to generate prevention-oriented explanations. Our initial evaluation on the Spring-PetClinic application shows that the selected metrics identify most known security-critical methods, while an LLM provides actionable, prevention-focused insights. Although these metrics capture structural properties rather than semantic aspects of security, this work lays the foundation for code-level security-aware metrics and enhanced explanations.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑