---
title: "Reachability"
description: "Whether a vulnerable package is used: a Go call graph and JS/TS and Python imports from your repository, dev dependencies, and what an image loads."
---

A vulnerable package that your software never calls is less urgent than one
it calls on every request. TRUSTIVAN records three signals for that and uses
them to **lower a finding's priority** when they positively show the code is
not used. None ever hides a finding: it stays in the backlog, counted, with the
reason on it.

## Reachability from your source

When a repository or a filesystem is scanned for vulnerabilities, TRUSTIVAN
reads the source while it is checked out and gives each Go, npm and PyPI
finding `detail.reachability`:

| Field | Meaning |
|---|---|
| `status` | `reachable`, `not_reachable` or `unknown`. Unknown is an answer, never read as either of the others |
| `level` | `function` when the advisory names the vulnerable functions and the analysis looked for calls to them; `import` when it looked for imports of the package |
| `method` | `go-callgraph`, `js-imports` or `python-imports` |
| `evidence` | The reason, in a sentence you can check |
| `chain` | The call or import path that reaches the code, outermost first: `main.main (main.go)` → `config.Load (config/config.go)` → `config.parse (config/config.go)` → `gopkg.in/yaml.v3.Unmarshal` |
| `symbols` | The vulnerable functions the advisory names, when it names any |

The finding page shows it as a **Reachability** card, and the backlog filters
on it (`reachability=reachable,not_reachable,unknown` in the API). A container
image or an SBOM has no source to read, so its findings carry no verdict and
score as before.

### How deep it goes, per language

| Language | What is analysed | When it says "not reachable" |
|---|---|---|
| **Go** | A call graph of the repository's Go code, built from the syntax with no compiler or module download: calls through imports and within a package resolve exactly, function values passed by name count as calls, and a method call resolves **by name only** (any method `Decode` counts as `Decoder.Decode`, which errs toward reachable). Entry points follow `govulncheck`'s source mode: `main` and `init` of every main package, every exported function and method of the other packages, and the initialisers of everything they import. The vulnerable functions come from the Go vulnerability database (`GO-` records), matched by CVE and GHSA alias | Only when the repository **vendors** its dependencies (`vendor/modules.txt`): then dependency code is in the graph too and no path reaching the function means none exists. Without `vendor/`, a function the project's own code never calls is **unknown**, because a dependency could call it |
| **JavaScript / TypeScript** | `import`, `require`, `export … from` and dynamic `import()` in source files (tests, `node_modules`, `dist` and minified files are skipped), and the names taken from each package (`import { merge } from "lodash"`, `_.template`). A package not imported directly is reached through any imported package that depends on it, along the lock file's dependency edges, on the assumption that a package loads what it depends on. A package named in `package.json` `scripts`, a Dockerfile, a Procfile, a Makefile or a shell script counts as used | When no file imports the package or any package that depends on it, and no script runs it. At function level, when the advisory names functions and the code takes only other names from a package it imports without a namespace that escapes |
| **Python** | `import` and `from … import` statements (tests, virtual environments and `site-packages` are skipped) and the dotted names used from each module. Distributions imported under another name (`PyYAML` as `yaml`, `beautifulsoup4` as `bs4`) are mapped for the common cases | As for JavaScript, and only when the module name is known: a distribution with a `-` in its name that the mapping does not cover is **unknown** when no import is found. A package `requirements.txt` lists with no dependency edges is unknown, never unreachable, because nothing says what pulls it in |

Python and JavaScript are import-level analyses, not call graphs: a file that
imports a package counts whether or not anything runs that file. Advisories
for npm and PyPI rarely name functions, so most of their verdicts are import
level. A tree larger than the analysis reads (30,000 source files) withholds
every "not reachable".

A malicious package or a suspected typosquat never gets a verdict: its install
script runs wherever it is installed, imported or not.

### What it does to the score

`not_reachable` multiplies the [risk score](/concepts/risk-scoring) by **0.5**
at function level and **0.6** at import level. `reachable` and `unknown` leave
it at 1.0. The factor is `reachability`, with the evidence as its note.

## Runtime or development dependency

Each vulnerability finding carries `detail.dependency_scope`:

| Value | Meaning |
|---|---|
| `runtime` | The lockfile records development dependencies, and this package is not one |
| `development` | The lockfile marks it development or test only (an npm `devDependency`, a Poetry dev group) |
| absent | The manifest format does not record the distinction, so it is unknown |

The formats that record it, per the scanning engine's parsers: npm
`package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`, Bun lockfiles,
`composer.lock`, `poetry.lock`, `uv.lock`, Gradle lockfiles and
`pubspec.lock`. Every other format the scanner supports (`requirements.txt`,
`Pipfile.lock`, `go.mod`, Maven `pom.xml`, `Cargo.lock`, NuGet, Bundler, and
OS packages) leaves the scope absent, and the risk score treats the package
as shipped.

For the formats that record it, TRUSTIVAN's scans leave development
dependencies out, so a package in your `devDependencies` is normally not
reported at all and the findings you see on those formats are `runtime`. If a
finding does carry `development`, it scores at **× 0.6**: lower, not zero, because a development
dependency still runs in CI and on developers' machines.

## What the image's entrypoint can load

For a container image, the scanner reads the image's configuration
(entrypoint, command, working directory, environment) and marks a finding
`detail.not_loaded_by_entrypoint: true`, with the reason in
`detail.entrypoint_note`, only when the configuration **positively** shows the
entrypoint process cannot load the package:

- **Node.js.** The entrypoint is `node <script>` and the package is installed
  outside every `node_modules` directory `require()` searches from the
  script's directory. The common case is npm's own bundled dependencies in
  `/usr/local/lib/node_modules/npm`, which every official Node.js image ships
  and an application started with `node /app/server.js` never loads.
- **Compiled binaries.** The entrypoint is a Go or Rust binary the scanner
  identified, and the dependency is compiled into a *different* binary in the
  image, or is an interpreted-language package (npm, Python, Ruby, Java, PHP,
  .NET) that a compiled process does not load.

Nothing is determined, and nothing is marked, when the entrypoint is a shell
or a script (`sh -c ...`, `docker-entrypoint.sh`), when a flag comes before
the Node.js script (`node -r ...`), when `NODE_PATH` is set, or for OS
packages, whose shared libraries may be loaded by anything. An init wrapper
(`tini`, `dumb-init`) is looked through to the program it starts.

A package marked this way scores at **× 0.7** (the `entrypoint` factor in the
[risk score](/concepts/risk-scoring)). It is still in the image, and anything
that executes it, such as a shell in the container, a scheduled job, or the
entrypoint spawning it, runs it.

## When it takes effect

All three signals are recorded at scan time. A finding scanned before them
shows no verdict, the scope as absent and no entrypoint mark until the asset's
next scan.
