Skip to main content
QUICK REVIEW

[论文解读] SBOM.EXE: Countering Dynamic Code Injection based on Software Bill of Materials in Java

Aman Sharma, Martin Wittlinger|arXiv (Cornell University)|Jun 28, 2024
Advanced Malware Detection TechniquesComputer Science被引用 3
一句话总结

SBOM.exe 是一种针对 Java 应用程序的运行时完整性强制系统,它通过字节码规范化技术,从完整的软件供应链中构建软件物料清单索引(BOMI),为所有允许的类生成确定性校验和。该系统可在运行时阻止任何未经识别或被篡改的类的执行,有效缓解了三个关键的 CVE 漏洞——Log4j、H2 和 Apache Commons Configuration,同时在实际应用中仅带来极低的性能开销。

ABSTRACT

Software supply chain attacks have become a significant threat as software development increasingly relies on contributions from multiple, often unverified sources. The code from unverified sources does not pose a threat until it is executed. Log4Shell is a recent example of a supply chain attack that processed a malicious input at runtime, leading to remote code execution. It exploited the dynamic class loading facilities of Java to compromise the runtime integrity of the application. Traditional safeguards can mitigate supply chain attacks at build time, but they have limitations in mitigating runtime threats posed by dynamically loaded malicious classes. This calls for a system that can detect these malicious classes and prevent their execution at runtime. This paper introduces SBOM.EXE, a proactive system designed to safeguard Java applications against such threats. SBOM.EXE constructs a comprehensive allowlist of permissible classes based on the complete software supply chain of the application. This allowlist is enforced at runtime, blocking any unrecognized or tampered classes from executing. We assess SBOM.EXE's effectiveness by mitigating 3 critical CVEs based on the above threat. We run our tool with 3 open-source Java applications and report that our tool is compatible with real-world applications with minimal performance overhead. Our findings demonstrate that SBOM.EXE can effectively maintain runtime integrity with minimal performance impact, offering a novel approach to fortifying Java applications against dynamic classloading attacks.

研究动机与目标

  • 应对 Java 软件供应链攻击日益增长的威胁,这些攻击利用运行时的动态类加载机制。
  • 克服传统构建时防护措施(如 SBOM、版本锁定和代码签名)的局限性,这些措施无法阻止运行时代码注入。
  • 开发一种在运行时通过监控和验证所有动态加载类来强制执行应用程序完整性的系统。
  • 在保持极低性能开销的同时,确保与真实世界 Java 应用程序的兼容性。
  • 提供一种完全自动化的、无需源代码的机制,以检测并阻止恶意类加载,而无需人工干预。

提出的方法

  • 在测试执行期间构建全面的软件物料清单索引(BOMI),捕获运行时环境中预期的所有类。
  • 应用一种新颖的字节码规范化技术,消除 Java 字节码中的非确定性特征(例如时间戳、随机 ID),以生成一致的校验和。
  • 通过拦截类加载并在运行时将每个类的校验和与参考 BOMI 进行比较,强制执行 BOMI。
  • 如果某个类不在 BOMI 中或已被篡改,则立即终止应用程序,防止恶意代码执行。
  • 作为 Java Agent 集成到系统中,无需对目标应用程序进行源代码修改。
  • 利用应用程序的测试套件动态发现并记录所有合法类,确保允许列表的完整性。
Figure 1: Overview of the Log4Shell vulnerability.
Figure 1: Overview of the Log4Shell vulnerability.

实验结果

研究问题

  • RQ1能否构建一个系统,在恶意代码通过不受信任的依赖项注入的情况下,仍能检测并阻止 Java 应用程序中的恶意类加载?
  • RQ2尽管字节码中存在非确定性特征,如何计算出动态生成的 Java 类的确定性和安全校验和?
  • RQ3此类系统在真实世界 Java 应用程序中的集成程度如何,性能开销是否可接受?
  • RQ4该方法能否有效缓解已知的高危供应链漏洞,如 Log4j、H2 和 Apache Commons Configuration?
  • RQ5与现有的技术(如控制流完整性、反序列化过滤或 GraalVM 中的静态分析)相比,该方法有何优势?

主要发现

  • SBOM.exe 通过在类被加载前阻止恶意类的执行,成功缓解了三个关键 CVE 漏洞——Log4j(CVE-2021-44228)、H2(CVE-2022-23947)和 Apache Commons Configuration(CVE-2022-23947)。
  • 该系统在实际应用中表现出与 PDFBox、tTorrent 和 GraphHopper 等真实世界应用的兼容性,评估期间观察到的性能开销极低。
  • 字节码规范化有效消除了 Java 字节码中的非确定性,使得在不同环境和 Java 版本下都能实现可靠且安全的校验和计算。
  • 该方法无需对目标应用程序进行源代码修改,使其在生产系统中部署具有实际可行性。
  • SBOM.exe 提供细粒度的完整性违规可见性,使开发人员能够准确识别触发阻断的类,从而提升可调试性。
  • 该系统是首个通过动态、基于测试的 BOMI 构建和运行时强制执行,在 Java 中实现软件供应链完整性的方案。
Figure 2: Overview of SBOM.exe, a novel system to detect and mitigate code injection attacks in Java systems.
Figure 2: Overview of SBOM.exe, a novel system to detect and mitigate code injection attacks in Java systems.

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。