What is reachability analysis?
Reachability analysis checks whether your application can actually run the vulnerable code inside a dependency. A version-matching scanner flags every project that includes a vulnerable package; reachability analysis follows the calls from your code to see whether the vulnerable function is ever used, so teams fix the findings that can matter first.
Updated
Most vulnerable dependencies are never called
Software composition analysis (SCA) tools compare the package versions in your lockfiles with public advisories. That tells you a vulnerable package is installed, not that your code uses the vulnerable part of it, so the same advisory appears in every project that pulls the package in, directly or transitively.
Research that checked the code paths found the gap is large. In 3 million Maven packages, less than 1% had a reachable call path to vulnerable code in their dependencies, far fewer than a dependency-level count suggests. In an earlier npm study, 22 of 30 outdated projects (73.3%) were safe from the vulnerability they carried. The share differs by ecosystem and project, but the direction is the same.
Three levels of reachability
Tools answer the question at different depths. Deeper levels remove more noise but need more from your build or your running system.
Package level
Is the vulnerable package a direct or transitive dependency, and is it in production code rather than tests or build tooling? Cheap and coarse: it removes dev-only packages but keeps every production dependency.
Function level (static call graph)
The tool builds a call graph of your code and its dependencies and checks for a path from your entry points to the vulnerable function. It needs the advisory to name the affected function and the tool to support your language.
Runtime
An agent or instrumentation records which code actually executes in a running environment. It sees real behaviour, but only on the paths that ran while it watched.
Where reachability analysis falls short
Static call graphs approximate. Reflection, dependency injection, plugins and configuration-driven loading can hide real paths or invent false ones, which is why researchers pair static analysis with dynamic analysis.
Reachable does not mean exploitable. An attacker still needs to control the input that reaches the vulnerable function, and the vulnerable condition has to hold in your deployment. Unreachable does not mean safe forever either: the next change can add the call, so treat it as lower priority and recheck when code changes.
Reachability and VEX
When you tell customers or auditors a vulnerability does not affect you, VEX is the standard format. CISA's minimum requirements list five justifications for a not_affected status, one of them Vulnerable_code_not_in_execute_path, which CISA describes as the product including the vulnerable code but not calling or otherwise using it. Reachability evidence is what backs that statement.
How Enclave uses reachability
Enclave's agents take findings from your existing scanners and their own dependency inventory, check whether the vulnerable code is reachable, then test whether it is exploitable in your live environment before ranking it. Each finding that survives gets a fix pull request for your engineers to approve.
Common questions
Is reachability the same as exploitability?
No. Reachability asks whether your code can run the vulnerable function. Exploitability asks whether an attacker can make that happen and cause harm in your environment. A reachable vulnerability may still not be exploitable, for example when the attacker cannot control the input.
Does reachability analysis replace SCA?
No. It runs on top of SCA: the SCA tool finds vulnerable packages, and reachability analysis sorts those findings by whether your code uses the vulnerable part.
Can I ignore unreachable vulnerabilities?
Deprioritize them, don't forget them. Static analysis can miss real paths, and a later change can make the code reachable. Upgrade when it is cheap and recheck when the code changes.
Which languages does reachability analysis support?
It depends on the tool. Function-level reachability needs a call-graph analyzer for each language and advisories that name the vulnerable function, so check a vendor's supported languages against your stack.
Sources
- Mir, Keshani and Proksch, reachability of vulnerable code in 3 million Maven packages (SANER 2023) (arxiv.org)
- Zapata et al., npm clients of vulnerable packages (ICSME 2018) (naist-se.github.io)
- Ponta, Plate and Sabetta, static and dynamic reachability of vulnerable library code (ICSME 2018) (arxiv.org)
- CISA, Minimum Requirements for Vulnerability Exploitability eXchange (VEX), April 2023 (cisa.gov)