ZTD$_{JAVA}$: Mitigating Software Supply Chain Vulnerabilities via Zero-Trust Dependencies

Paschal C. Amusuo, Kyle A. Robinson, Santiago Torres-Arias, Laurent Simon, James C. Davis, Torres-Arias, Santiago, Simon, Laurent, Davis, James C.arXiv 2023 · DOI

Abstract

Third-party libraries like Log4j accelerate software application development but introduce substantial risk. Vulnerabilities in these libraries have led to Software Supply Chain (SSC) attacks that compromised resources within the host system. These attacks benefit from current application permissions approaches: third-party libraries are implicitly trusted in the application runtime. An application runtime designed with Zero-Trust Architecture (ZTA) principles—secure access to resources, continuous monitoring, and least-privilege enforcement—could mitigate SSC attacks, as it would give zero implicit trust to these libraries. This paper proposes Zero-Trust Dependencies to mitigate SSC vulnerabilities: we apply the NIST ZTA to software applications. We present a system design, ZTD${SYS}$, and a prototype, ZTD${JAVA}$, for Java applications. Evaluations show that ZTD$_{JAVA}$ defends against prevalent vulnerability classes, introduces negligible cost, and is easy to configure.

Introduction: The Vulnerability of Implicit Trust

Modern software development relies heavily on third-party libraries (TPLs). While these dependencies accelerate innovation, they create a significant security gap: by default, every library in an application inherits the full permissions of the host process. If a single utility library contains a vulnerability—such as the Log4j "Log4Shell" flaw—an attacker can exploit it to read sensitive files, establish network connections, or execute arbitrary shell commands.

Conceptual overview of the Zero-Trust Dependency model, where access to system resources is mediated by a secure policy.

Existing defenses are often insufficient. Application-level sandboxes protect the host from the application but fail to protect the application from its own internal dependencies. Historically, the Java Security Manager (JSM) attempted to address this but was deprecated due to its extreme configuration complexity and performance overhead (often exceeding 200%). ZTD$_{JAVA}$ addresses this by providing a low-cost, easy-to-configure system that enforces least-privilege at the dependency level.

System Design and Implementation

The authors introduce ZTD$_{SYS}$, a design based on three core Zero-Trust Architecture (ZTA) principles:

  1. Secure Access: Every resource request is authorized based on the library's identity and execution context.
  2. Least-Privilege Enforcement: Libraries are restricted to the minimum permissions required for legitimate operation.
  3. Continuous Monitoring: All resource accesses are logged for full visibility into dependency behavior.
The ZTD$_{JAVA}$ architecture, illustrating the transformation, monitoring, and enforcement pipeline.

To implement this in the Java ecosystem, ZTD$_{JAVA}$ utilizes:

  • Bytecode Instrumentation: Using the ASM library, the system modifies the Java runtime at startup to "hook" into core JDK classes responsible for high-risk operations (e.g., FileInputStream, Socket, ProcessBuilder).
  • Namespace Mapping: ZTD$_{JAVA}$ uses a package-prefix heuristic (e.g., com.mongodb.*) to identify which dependency is responsible for a call in the stack.
  • Automated Policy Discovery: A "discovery mode" observes the application during testing to automatically generate least-privilege policies based on observed legitimate behavior.
  • Context-Sensitive Authorization: The system inspects the entire call stack during resource requests. If any library in the chain lacks the required permission, access is blocked.

Key Insights and Results

The effectiveness of ZTD$_{JAVA}$ is rooted in several key observations:

  • The "46% Rule": Analysis shows that 46% of Java supply chain vulnerabilities involve access to the file system, network, or shell. By focusing on these high-risk resources, ZTD$_{JAVA}$ provides high security value with reduced complexity.
  • Dependency Sparsity: Only 4% of dependencies in typical applications actually require access to OS resources. This makes security policies small, manageable, and easy to audit.
  • Performance Efficiency: By checking permissions at the dependency level rather than the class level, ZTD$_{JAVA}$ achieves a median performance overhead of -0.03% (effectively zero) on the DaCapo benchmarks. In contrast, the legacy JSM caused a 201% slowdown on complex tasks like Eclipse.

In empirical testing, ZTD$_{JAVA}$ successfully blocked 100% of 15 recreated real-world vulnerability exploits, including those affecting Spring Cloud and Log4j. Configuration effort remains low, with an average of only 5 dependencies per application requiring explicit policy definitions.

Conclusion and Future Directions

ZTD$_{JAVA}$ demonstrates that Zero-Trust principles can be efficiently applied to software dependencies. While highly effective, current limitations include challenges with asynchronous task delegation and native code (JNI) bypasses. Future work aims to extend this model to other ecosystems like npm (JavaScript) and PyPI (Python), where supply chain attacks are increasingly prevalent.

Summary updated

BibTeX
@misc{amusuo2023ztd,
  author = {Paschal C. Amusuo and Kyle A. Robinson and Santiago Torres-Arias and Laurent Simon and James C. Davis and Torres-Arias, Santiago and Simon, Laurent and Davis, James C.},
  title = {{ZTD$\_\{JAVA\}$: Mitigating Software Supply Chain Vulnerabilities via Zero-Trust Dependencies}},
  year = {2023},
  eprint = {2310.14117},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2310.14117},
}
Figure