Classport: Designing Runtime Dependency Introspection for Java

Serena Cofano, Daniel Williams, Aman Sharma, Martin Monperrus · 2025

Read Classport: Designing Runtime Dependency Introspection for Java by Serena Cofano, Daniel Williams, Aman Sharma, Martin Monperrus (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2510-20340.txt.

Introduction

Serena Cofano and three co-authors design Classport, a system that lets Java programs observe which dependencies they actually use at runtime. Knowing the live dependency set is fundamental for software supply chain security, yet Java offers no built-in support for that introspection. Classport embeds dependency information directly into Java class files so it can be retrieved while the program runs.

The authors present Classport as both a blueprint and a working system for runtime dependency introspection. They evaluate it on six real-world projects to test whether the approach is feasible outside toy examples. The evaluation demonstrates that dependencies in use can indeed be identified at runtime, giving security tools a signal that static manifests alone cannot provide.

Catalog record

CREATORSerena Cofano, Daniel Williams, Aman Sharma, Martin Monperrus
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE43 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2510-20340

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Classport: Designing Runtime Dependency Introspection for Java Serena Cofano, Daniel Williams, Aman Sharma, Martin Monperrus Abstract . Runtime introspection of dependencies, i.e., the ability to observe which dependencies are currently used during program execution, is fundamental for Software Supply Chain security. Yet, Java has no support for it. We solve this problem with Classport, a system that embeds dependency information into Java class files, enabling the retrieval of dependency information at runtime. We evaluate Classport on six real-world projects, demonstrating the feasibility in identifying dependencies at runtime. Runtime dependency introspection with Classport opens important avenues for runtime integrity checking. 1. Introduction Figure 1. Overview of Classport, a novel system that enables runtime dependency introspection in Java. Software systems keep increasing in size and complexity. To speed up implementation and satisfy the growing demand for features, developers often reuse existing libraries ( Linskens 2024 ) . They leverage third-party open-source code, which is integrated into the main application as a dependency. This collection of source code, dependencies, and build tools used to aggregate these two into a final software product is known as the Software Supply Chain ( Linskens 2024 ) . Using third-party dependencies is essential for productivity and reliability, but it also increases the attack surface ( OpenSSF and The Linux Foundation 2022 ) . Security vulnerabilities that exist in a dependency are inherited by downstream software products, leading to potential compromises. Notable Software Supply Chain incidents include the Log4Shell vulnerability ( Turunen 2021 ) , the Codecov compromise ( Sharma 2021 ) , and the xz catastrophe ( Przymus and Durieux 2025 ) . Assessing and hardening the security of the Software Supply Chain requires increasing its so-called “transparency”, i.e., the visibility on its components at all points in time of the software lifecycle ( Okafor et al. 2022 ) . One of the key tools to support transparency is the production of sbom ( sbom ) ( Cybersecurity and Infrastructure Security Agency 2024 ) . An sbom is an exhaustive record of the individual components included in a software system ( National Telecommunications and Information Administration 2021 ) . Maintainers can use this list as input for vulnerability assessment to efficiently detect malicious or vulnerable software packages. Most of the approaches to sbom operate statically, by looking for dependencies in metadata files, such as manifests or lock files, only at build time ( Yu et al. 2024 ; Rabbi et al. 2024 ; Cofano et al. 2024 ) . This has two fundamental limitations. First, it does not reflect the actual dependency usage at runtime, i.e., whether a dependency is actually loaded or used in production ( Balliu et al. 2023 ) . Even if this does not present a direct risk for the application, it makes maintainers and developers waste a lot of time doing unnecessary work by assessing the security of unreachable dependencies, which slows down the response time to the actual security problems. Second, static analysis of dependencies does not support the maintainers or developers to make runtime decisions based on the actually used dependencies. Basically, the fundamental limitation of sbom is that all dependency information is lost at runtime. Runtime dependency introspection solves these limitations. It is the ability of a piece of software to observe which components are executed during a program’s actual run, including component name and component version. Runtime dependency introspection is the necessary building block for advanced security hardening. First, it is crucial for identifying dependencies that are present in the application but never used at runtime. This simplifies vulnerability management by deprioritizing components that are never used and helps in reducing the attack surface through the removal of unused dependencies. Second, runtime dependency introspection is required to be able to restrict execution privileges at runtime, by mapping the accessed resource to the corresponding dependency ( Amusuo et al. 2024 ) . The Java runtime is known for its good support of object-oriented introspection (aka class, field, and method reflection) ( Rigger et al. 2017 ) . Yet, it is completely blind to dependencies: it has no native support for dependency introspection at runtime ( Xiao et al. 2025 ) . In Java, the information that uniquely identifies a dependency is present at build time, but it is not preserved at runtime. Heuristics like guessing the origin of dependencies from package names have been implemented in previous works ( Amusuo et al. 2024 ) . However, they suffer from fundamental limitations, such as the requirement for dependencies to be compliant with fragile conventions to be correctly identified. Overall, the problem of runtime introspection of dependencies is an open one. To the best of our knowledge, there are currently no principled blueprint for identifying which dependencies are actually executed at runtime in Java. In this paper, we propose Classport, a novel technique for introspecting dependencies at runtime in Java. In essence, Classport brings dependency information to runtime: supplier, dependency name and version (group id, artifact id and version in Maven lingo). Classport operates in two phases by: (1) embedding dependency information into Java binary artifacts through build-time instrumentation, and (2) retrieving this information at runtime through dynamic instrumentation. We evaluate Classport on six real-world open-source Java projects. Our experimental protocol measures the ability to embed dependency information into the binary artifacts, and assesses the time and disk space overhead caused by the added information. Then, we test Classport’s ability to identify the correct set of runtime dependencies according to a meaningful workload. We also consider the impact on the running application, incl. the runtime overhead. Our results demonstrate the applicability of Classport to real-world applications. Classport successfully embeds dependency information, accurately identifies runtime dependencies, preserves the functional behavior of the application, and introduces a low overhead. In summary, the main contributions of this paper are: • A novel approach to inspecting Java dependencies at runtime, based on Java annotations. To the best of our knowledge, it is the first ever solution for runtime dependency introspection in Java. • Classport, a publicly available prototype implementing the blueprint: Classport embeds information into binary artifacts and provides a runtime agent to retrieve dependency information during execution. 1 1 1 https://github.com/chains-project/classport • An evaluation of our novel technique on a set of six real-world applications, demonstrating the feasibility and applicability of our approach. 2 2 2 https://github.com/chains-project/classport-experiments 2. Background This section provides background on how dependency management works in the Java ecosystem, with a focus on Maven and its limitations regarding runtime visibility of dependencies. Dependency management by package managers and build systems varies across ecosystems, as they handle resolution, versioning, and transitive dependencies differently. In the Java ecosystem, Maven is one of the available build systems ( Foundation 2025 ) . Within Maven, developers declare dependencies in a file called pom.xml. Each of these dependencies is downloaded as a binary artifact called a JAR ( The Apache Software Foundation 2024a ) , and is uniquely identified by Group ID, Artifact ID, and Version ( The Apache Software Foundation 2024b ) , this triple being called a GAV coordinate. The Group ID represents the organization or project namespace, e.g., org.apache.commons . The Artifact ID specifies the module or library, e.g., commons-lang3 . The Version

Read the complete text