Exploits are commonly used to demonstrate the presence of library vulnerabilities and validate their impact across different versions. However, their direct application to alternative versions often fails due to breaking changes introduced during evolution. These failures stem from both changes in triggering conditions (e.g., API refactorings) and broken dynamic environments (e.g., build or runtime errors), which are challenging to interpret and adapt manually. Existing techniques primarily focus on code-level trace alignment through fuzzing, which is both time-consuming and insufficient for handling environment-level failures. Moreover, they often fall short when dealing with complicated triggering condition changes across versions. To overcome this, we propose Diffploit, an iterative, diff-driven exploit migration method structured around two key modules: the Context Module and the Migration Module. The Context Module dynamically constructs contexts derived from analyzing behavioral discrepancies between the target and reference versions, which capture the failure symptom and its related diff hunks. Leveraging these contexts, the Migration Module guides an LLM-based adaptation through an iterative feedback loop, balancing exploration of diff candidates and gradual refinement to resolve reproduction failures effectively. We evaluate Diffploit on a large-scale dataset containing 102 Java CVEs and 689 version-migration tasks across 79 libraries. Diffploit successfully migrates 84.2% exploits, outperforming the change-aware test repair tool TARGET by 52.0% and the rule-based tool in IDEA by 61.6%. Beyond technical effectiveness, Diffploit identifies 5 CVE reports with incorrect affected version ranges, three of which have been confirmed. It also discovers 111 unreported vulnerable versions in the GitHub Advisory Database.
翻译:利用代码通常用于演示库漏洞的存在并验证其在不同版本间的影响。然而,由于版本演进过程中引入的破坏性变更,将其直接应用于替代版本往往失败。这些失败源于触发条件的变化(例如API重构)和损坏的动态环境(例如构建或运行时错误),这些变化难以手动解释和适应。现有技术主要侧重于通过模糊测试实现代码级追踪对齐,这种方法既耗时又不足以处理环境级故障。此外,它们在处理跨版本的复杂触发条件变化时往往表现不足。为克服这些限制,我们提出了Diffploit,一种基于差异驱动的迭代式利用迁移方法,其结构围绕两个核心模块构建:上下文模块和迁移模块。上下文模块通过分析目标版本与参考版本间的行为差异动态构建上下文,这些上下文捕获了故障症状及其相关的差异块。利用这些上下文,迁移模块通过迭代反馈循环引导基于大型语言模型的适应过程,平衡差异候选的探索与逐步细化,以有效解决复现失败问题。我们在一个包含102个Java CVE和涉及79个库的689个版本迁移任务的大规模数据集上评估了Diffploit。Diffploit成功迁移了84.2%的利用代码,优于变更感知测试修复工具TARGET 52.0%,并超过基于规则的IDEA工具61.6%。除了技术有效性外,Diffploit还识别出5个CVE报告中存在错误的影响版本范围,其中三个已得到确认。同时,它在GitHub安全通告数据库中发现了111个未报告漏洞的版本。