Abstract
Modern software development relies heavily on third-party libraries (TPLs), but this dependency introduces significant security risks through vulnerabilities. While Software Composition Analysis (SCA) tools frequently suggest library upgrades to mitigate these risks, developers often reject these patches due to potential build breakages. This paper introduces CORAL (Compatible Remediation of Third-party Libraries), a tool designed to fix vulnerabilities while prioritizing project compatibility. By modeling remediation as a global optimization problem and employing SMT solvers with graph partitioning, CORAL achieves an 87.56% fix rate with a 98.67% build success rate, significantly outperforming current industry standards.
Introduction
The modern software ecosystem is built upon a foundation of open-source third-party libraries. However, when a Common Vulnerabilities and Exposures (CVE) entry is identified within these dependencies, the path to remediation is rarely straightforward. Traditional SCA tools like Dependabot typically suggest upgrading the vulnerable library to the latest secure version. Yet, empirical evidence shows that developers reject over half (51.31%) of these security-related pull requests, primarily due to incompatibility issues. These incompatibilities range from syntactic breaking changes (API removals) to subtle semantic shifts in logic.
The fundamental flaw in existing tools is their reliance on "local optimization." By focusing on a single library in isolation, these tools fail to account for the "ripple effects" across the entire dependency graph. An upgrade to one library may necessitate a version change in a transitive dependency that is fundamentally incompatible with another part of the project.
Methodology: The CORAL Framework
CORAL addresses these challenges by treating vulnerability remediation as a global optimization problem. The framework consists of several key technical innovations:
Global Dependency and Call Graph Modeling
Unlike tools that view libraries as isolated units, CORAL constructs a comprehensive model of the project’s entire dependency tree. This is augmented by code-level call graphs to determine the actual reachability of vulnerable code. If a vulnerability exists in a library but the project never invokes the affected methods, the remediation priority can be adjusted accordingly.
Graph Partitioning and SMT Solving
To manage the exponential complexity inherent in checking every possible version combination across a large dependency tree, CORAL employs "Vertical" and "Horizontal" partitioning. This strategy breaks the dependency graph into manageable subgraphs based on their distance from the root project.
CORAL then utilizes a Satisfiability Modulo Theories (SMT) solver (Z3) to find an optimal set of versions for all libraries simultaneously. The solver operates under specific constraints:
- Safety: The selected versions must resolve the identified CVEs.
- Compatibility: The combination must not break the build (satisfying version constraints and API requirements).
- Stability: The "version jump" should be minimized to adhere to Semantic Versioning (SemVer) principles and reduce the risk of semantic regression.
Dynamic Ripple Effect Management
As the solver selects versions, CORAL dynamically updates the dependency and call graphs. If a selected version propagates a change that leads to a conflict, the system employs hard and soft backtracking. This allows the tool to revisit previous decisions and explore alternative paths, ensuring it does not settle for a broken or sub-optimal configuration.
Experimental Evaluation
The researchers evaluated CORAL using a robust dataset of 301 popular Maven projects (each with over 1,000 stars on GitHub) and 1,759 associated CVEs. The evaluation also included a manual triage of 300 CVEs to map vulnerable classes and methods for high-precision reachability analysis.
Performance Metrics
CORAL was benchmarked against industry leaders and academic baselines:
- Fix Rate: CORAL successfully fixed 87.56% of vulnerabilities, compared to 75.32% for the next best academic baseline.
- Build Stability: The tool achieved a 98.67% successful compilation rate and a 92.96% unit test pass rate.
- Efficiency: The partitioning strategy allowed CORAL to perform global optimization at speeds suitable for integration into standard CI/CD pipelines, outperforming naive global optimization approaches.
Key Insights
A significant finding of this research is the "78% Rule": approximately 78.45% of vulnerabilities in popular Java projects can be remediated without breaking the build, provided the tool can navigate the complex interdependencies of the project. This suggests that the perceived trade-off between security and stability is often a result of inadequate tooling rather than an inherent conflict.
Limitations and Future Work
Despite its success, CORAL faces limitations common to static analysis tools. It may miss invocations made via Java reflection or dynamic features. Furthermore, while it excels at preventing syntactic breaks, "semantic" breaks—where the code compiles but behaves differently—remain a challenge that requires high test coverage to detect. Future work aims to expand CORAL’s logic to other ecosystems like npm (JavaScript) or PyPI (Python), where dependency management is notoriously complex.
Conclusion
CORAL demonstrates that global dependency graph optimization is a viable and highly effective approach to vulnerability remediation. By prioritizing compatibility alongside security, CORAL provides a path toward automated security updates that developers can trust, ultimately strengthening the security posture of the Java ecosystem.
Summary updated