The SCA scan says we ship a vulnerable version. Does our code call the vulnerable function? Dependency reachability at package, import and symbol level, where the vulnerable-symbol data comes from, what call graphs miss, and what a not-reachable verdict can conclude

DedSec Application Security ·

Here is a hypothetical. A Go service's dependency scan lists four advisories against golang.org/x/text v0.3.5. A reachability column sorts them: one is "called", one is "imported, not called", and two are "module required, package not imported". A developer proposes closing the last three as not affected, and points out that the tool will even write the VEX document that says so.

We rebuilt that situation in a lab with govulncheck, the Go project's own reachability-aware scanner, using a handful of small programs that all depend on that version. For most of them the report matched what each program does. For one it did not. In that program the vulnerable function, language.Parse, runs whenever the program is asked for that handler by name: we ran it that way and watched it parse a language tag. It runs because the method that calls it is selected by name through Go's reflect package. govulncheck's source scan reported no vulnerability for that program, and its OpenVEX output stated not_affected for GO-2021-0113 with the justification vulnerable_code_not_in_execute_path.

That is documented behaviour. The govulncheck documentation says that "Calls to functions made using package reflect are not visible to static analysis." The tool did what it says it does. The statement it produced was still false for that program, and anyone who accepted it without reading the limitations would have filed a vulnerability that runs whenever that handler is selected as one that never runs.

This post is about the question underneath that column: does our code actually call the vulnerable function? It covers:

It builds on earlier posts rather than repeating them. The reachability post introduces taint analysis and CVE reachability in a few paragraphs; this is the long version of the dependency half. Why vulnerability databases disagree covers how an advisory gets matched to a package and version in the first place, which is the step before anything here. The SBOM and VEX post covers what a not_affected statement has to prove. CVSS, EPSS and KEV covers urgency, malicious packages covers the dependency risk that reachability does not address at all, and SAST false positives in mechanism covers the same precision problems in first-party code.

Sources, and how each was checked. On 14 November 2026 we retrieved the OSV schema (docs/schema.md in the ossf/osv-schema repository on GitHub); the Go vulnerability database documentation at go.dev/doc/security/vuln/database; the govulncheck command documentation at pkg.go.dev/golang.org/x/vuln/cmd/govulncheck; the govulncheck tutorial at go.dev/doc/tutorial/govulncheck; and, from the OSV API at api.osv.dev, the records GO-2021-0113, GO-2022-1059, GO-2022-0969, RUSTSEC-2019-0033, GHSA-ppp9-7jff-5vj2, GHSA-69ch-w2m2-3vjp, GHSA-x7vr-c387-8w57, GHSA-8q59-q68h-6hv4 and GHSA-jfh8-c2jp-5v3q. Quotations are from those copies. We also read the source of govulncheck v1.9.0 (the internal/vulncheck package of golang.org/x/vuln) for how it builds a call graph and chooses entry points.

The lab ran on 14 November 2026, between 07:20 and 07:30 UTC, on Ubuntu 24.04.4 with two vCPUs of an AMD EPYC 9354P. We downloaded Go 1.27.4 from go.dev/dl and checked it against the published SHA-256, installed govulncheck v1.9.0 with go install, and used the default database at vuln.go.dev, which govulncheck reported as updated at 2026-11-11 02:51:11 UTC. The test module depends on golang.org/x/text v0.3.5, the version the Go tutorial uses, and contains one small package per case plus a local module used as a dependency. These are deliberately constructed programs a few lines long, not real applications. Statements about ecosystems other than Go, and about frameworks, are general mechanism, not lab results. The scenario above is hypothetical, and no number in this post is a measurement of any team, codebase or tool, ours included.

Five claims that all get called "reachable"

Between "the lockfile names an affected version" and "an attacker can trigger this bug" there are five separate predicates. Each is strictly narrower than the one before, and each needs different evidence. When a tool, an advisory or a colleague says "reachable", the first question is which of the five they mean.

LevelThe claimEvidence that establishes itWhat it cannot tell you
1. PresentAn affected version is resolved in the lockfile or manifestLockfile entry matched to the advisory's identity and version rangeWhether the package ships at all
2. ShippedThe package is in the built artifact or the runtime, not only in dev, test, optional or build-tool dependenciesInspection of the final artifact (image, binary, bundle) and the dependency's scopeWhether any of its code is loaded
3. ImportedYour code, or a dependency you ship, imports the package or module that contains the vulnerable codeThe import graph, built from source or from the artifactWhether the vulnerable function is ever called
4. Symbol reachableA call path exists from an entry point to a vulnerable functionA call graph from modelled entry points, with the pathWhether the data on that path is attacker-influenced, or whether configuration enables the vulnerable behaviour
5. Exploitable pathAttacker-influenced data reaches the function in a configuration where the vulnerable behaviour is activeDataflow from sources, configuration review, or a reproductionNothing further from static analysis: this is the claim itself

Level 1 is what conventional composition analysis reports, and the advisory matching post is about getting even that right.

Level 2 is where dev dependencies, test frameworks and build tooling separate from runtime code. A lockfile records them all. npm separates devDependencies, Maven has a test scope, Python projects put test tools in extras or separate requirement files, and many ecosystems have optional dependencies that install only on some platforms. A dependency of a bundler plugin or a code generator never ships, but it does run, on a build machine that usually holds more credentials than production does. That is a different threat from runtime reachability, and the malicious packages post covers code that runs at install time, where no call from your code is needed at all.

Level 3 means different things in different ecosystems. In Go a package that nothing imports is not compiled into the binary, so "required but not imported" is close to "absent". In Python an installed but unimported package sits on disk and is not loaded, but imports can be computed from strings at runtime, so "no import statement" is weaker evidence. On a Node server everything in node_modules is loadable by anything that calls require, while a browser bundle contains only what the bundler included.

Level 4 is what most tools mean by "function-level reachability". Level 5 is what the reachability post calls taint analysis, applied across the dependency boundary. Most dependency reachability stops at level 4.

Where function-level data comes from

A call graph can tell you which functions your program might call. To turn that into a vulnerability verdict, something has to say which functions are vulnerable. That is data, it lives in the advisory record or nowhere, and it is often nowhere.

The OSV field, and what goes in it

The OSV schema gives each affected package an ecosystem_specific object. The schema says "The meaning of the values within the object is entirely defined by the ecosystem and beyond the scope of this document", and gives one example: "the Go ecosystem includes here information about the affected functions and which modules the packages were found in". There is no common schema field for vulnerable functions. Each database that records them chooses its own layout, and a consumer has to understand each one.

The Go vulnerability database

The Go database documents its layout. ecosystem_specific "will always be an object with a single field, imports", and each entry in imports has a path ("the import path of the package containing the vulnerability"), symbols ("the names of the symbols (function or method) that contains the vulnerability"), and goos and goarch, the operating systems and architectures where the symbols appear, "if known".

The records we retrieved show what that buys. GO-2021-0113, an out-of-bounds read in golang.org/x/text/language, lists the symbols MatchStrings, MustParse, Parse and ParseAcceptLanguage. GO-2022-1059, a denial of service through a crafted Accept-Language header in the same package, lists MatchStrings and ParseAcceptLanguage. Same module, same package, overlapping but different symbol lists. A program that calls only Parse reaches the first advisory and not the second, and package-level matching cannot tell those apart.

GO-2022-0969, an HTTP/2 denial of service, lists in net/http both exported functions such as ListenAndServe, Serve and Server.Serve, and unexported ones such as http2Server.ServeConn and http2serverConn.goAway. Whatever process produced that list, its effect is that a program can be matched on the exported function it calls, even though the defect sits several calls deeper.

The Go database also records a review status. An UNREVIEWED report "was automatically generated based on another source, such as a CVE or GHSA. Its data may be limited and has not been verified by the Go team." The documentation adds that when a module's versioning cannot be mapped, a report "may conservatively list all Go versions as affected", trading false negatives for false positives. Both are worth knowing before treating a record's symbol list as complete.

Other databases, and the same vulnerability without symbols

RustSec records affected functions too. The live OSV copy of RUSTSEC-2019-0033, an integer overflow in the http crate, carries ecosystem_specific.affects.functions with the single entry http::header::HeaderMap::reserve. The OSV schema's own example of the same record shows functions directly under ecosystem_specific, so the layout differs between the documentation and the data. A consumer that parsed the shape shown in the schema's example would find nothing.

The more useful observation is about aliases. GO-2021-0113's alias GHSA-ppp9-7jff-5vj2, GO-2022-1059's alias GHSA-69ch-w2m2-3vjp, and RUSTSEC-2019-0033's alias GHSA-x7vr-c387-8w57 had no ecosystem_specific data at all in the copies we retrieved. Neither did GHSA-8q59-q68h-6hv4 (CVE-2020-14343, in PyYAML) or any of the affected entries in GHSA-jfh8-c2jp-5v3q (Log4Shell). Nine records are not a survey, and we make no claim about how often symbol data exists in any ecosystem. What they establish is narrower and more useful: for the same vulnerability, whether a tool can do symbol-level reachability at all depends on which record it reads.

When there is no symbol list, a tool has two honest options. It can fall back to package or module level and say so, or it can derive symbols itself. The dishonest option is to run a call graph with no vulnerable symbols to look for, find nothing, and report "not reachable".

Deriving symbols from the fix

The usual derivation is to find the commit that fixed the vulnerability, diff it, and treat the changed functions as vulnerable. It is a reasonable heuristic that fails in specific ways:

So a derived symbol list is a hypothesis about where the vulnerable code is. It should carry its provenance (advisory symbol list, derived from commit X, or none), because a reachability verdict is only as good as the list it searched for.

govulncheck as a worked example

govulncheck is a useful public reference because its behaviour, data and limitations are all documented, and its source is readable. Its documentation says it "uses static analysis of source code or a binary's symbol table to narrow down reports to only those that could affect the application."

How it builds the call graph

In v1.9.0, the function that builds the call graph (callGraph in internal/vulncheck/utils.go) is commented "callGraph builds a call graph of prog based on VTA analysis". It first builds a class-hierarchy (CHA) call graph of the whole program, keeps only the functions reachable from the entry points in that graph, builds a variable type analysis (VTA) call graph over that slice, then repeats the slice-and-refine step once more using the VTA graph as the base. That is the general pattern described in the next section in miniature: start with a cheap over-approximation, then use type flow to remove edges that cannot happen.

The entry points are chosen explicitly. A comment in internal/vulncheck/entries.go says that for a main package the only valid entry points are the main function and any init# functions, "even if there are other exported functions or types." For any other root package, every exported function and method is an entry point, along with the package initialiser. A comment notes that generic entry functions are not currently considered entry points.

Three levels of answer

The -scan flag takes symbol (the default), package or module. With -show verbose, the output has three sections, "Symbol Results", "Package Results" and "Module Results", which map onto levels 4, 3 and 1 above. The default text output reports only symbol results in full and summarises the rest in a sentence. For our import-only program it read: "Your code is affected by 0 vulnerabilities. This scan also found 2 vulnerabilities in packages you import and 2 vulnerabilities in modules you require, but your code doesn't appear to call these vulnerabilities."

There is also a binary mode, -mode binary, which reads the binary's symbol information instead of source. The documentation says the output on binaries "omits call stacks, which require source code analysis", and that it "may also report false positives for code that is in the binary but unreachable".

Documented limitations

The documentation lists them, and three matter here:

What the lab showed

Each program below is a few lines long, depends on golang.org/x/text v0.3.5, and was scanned with govulncheck v1.9.0 in source mode and, where noted, in binary mode. The last column is what the program actually does when run.

ProgramWhat the code doesSource scan, symbol levelBinary scanAt runtime
directmain calls language.Parse on a command-line argumentGO-2021-0113 reported, trace direct.main calls language.ParseReportedParse runs
importonlyImports the package, uses only the variable language.EnglishNothing; 2 package-level and 2 module-level matchesNot reportedParse never runs
reflectcallA method that calls Parse is chosen by name with reflect.Value.MethodByNameNothingReportedParse runs when that handler is selected
funcmapA map of function values, one of which calls Parse; main only ever calls the otherGO-2021-0113 reported, trace funcmap.init calls language.ParseReportedParse never runs
transitivemain calls Normalize in a local dependency, which calls ParseReported, trace transitive.main calls wrap.Normalize, which calls language.ParseNot runParse runs
buildtagParse is called only from a file built for WindowsNothing on Linux; reported with GOOS=windowsNot runRuns only in the Windows build
testonlyParse is called only from a _test.go fileNot established; see belowNot runRuns whenever the package's tests run

What each row shows:

reflectcall is a false negative, and an ordinary one. Dispatch by name is not contrived: Go's own net/rpc package finds the method to call by name through reflection. We then moved the same handler into a separate non-main package and called it by reflection from a main package. Scanned with the main package as the root, govulncheck reported nothing. Scanned with the handler package as the root, it reported GO-2021-0113, because that package's exported method is an entry point. The verdict depended on which packages we named on the command line. Scanning ./... included the handler package as a root and so did report the vulnerability, but the default output showed a single example trace, through the direct program, not the reflection path.

funcmap is an over-approximation. The closure that calls Parse is created when the map is initialised, and the analysis treats it as callable. It never is. The trace names funcmap.init, where the closure is defined, not a caller of it: init builds the map and never calls the closure. That is the "false positives or inaccurate call stacks" the documentation warns about.

Binary mode answers a different question. It reported the reflection case that source mode missed, because the code is in the binary, and it also reported the never-called closure, for the same reason. It is closer to "is the vulnerable code linked in" than to "is it called". Running both and comparing is more informative than either alone.

buildtag shows the verdict belongs to one build configuration. On Linux the Windows-only file is not compiled, so the call does not exist. With GOOS=windows it was reported. A service built for several platforms needs a verdict per platform. The Go database's goos and goarch fields exist for the same reason.

testonly is a scope decision. The documentation says test files are included only with -test. In our run, -test did not change the result, and the verbose output listed only our own module, not golang.org/x/text, among the modules scanned. We did not establish why, and it may be a property of our setup rather than of the tool, so we do not offer it as a finding about govulncheck. The general point stands: test code typically runs in CI, often with CI credentials, and before trusting a negative, read the line that says what was actually scanned.

Exit codes and generated VEX

Two more observations matter for anyone wiring this into a pipeline.

The documentation says govulncheck "exits successfully (exit code 0) if there are no vulnerabilities, and exits unsuccessfully if there are", and that it also exits successfully with JSON, SARIF or OpenVEX output "regardless of the number of detected vulnerabilities." We saw exactly that on the direct program: exit code 3 with text output, and 0 with each of the other three formats. A pipeline that switched to JSON output for a dashboard and kept gating on the exit code would pass every build. The scan ran, found a reachable vulnerability, and reported success. That is the failure the scan-passed post is about.

The scan level changes the gate too. On the import-only program, -scan symbol exited 0, and -scan package exited 3 with "Your code may be affected by 2 vulnerabilities." Which level gates the pull request is a policy decision, and it should be written down rather than inherited from a default.

The OpenVEX output maps the levels onto VEX justifications. In our runs, a symbol-level finding became affected; a package imported but not called became not_affected with vulnerable_code_not_in_execute_path; and a module required whose vulnerable package was not imported became not_affected with vulnerable_code_not_present. Each not_affected statement carried the impact statement "Govulncheck determined that the vulnerable code isn't called". For reflectcall, GO-2021-0113 came out as not_affected, vulnerable_code_not_in_execute_path. A machine-generated VEX statement is exactly as strong as the call graph that produced it, and the statement does not carry the call graph's limitations with it. Those are in the documentation.

How call graphs are built, and which way each is wrong

Every reachability tool builds some approximation of "which functions can call which". The differences are in how it resolves calls whose target is not written in the source: interface and virtual method calls, function values, callbacks.

Every one of these needs separate models for the features in the next section, because none of them is visible as a call.

Static analysis people describe the trade-off as soundness against precision. A sound analysis never misses a real call; a precise one never reports a call that cannot happen. Practical tools are neither. They aim for soundness except for a documented list of language features (reflection, native code, dynamic loading), and buy as much precision as they can afford. The two errors cost different things:

The costs are not symmetric. An over-report is visible and annoying. An under-report is invisible until something exploits it.

One more property is easy to miss: tools usually show one path, not all of them. govulncheck's output says "Example traces found". Removing the call site in the example does not make the vulnerable function unreachable if other paths exist. The fix for a reachable vulnerable dependency is to upgrade the dependency, not to edit the path in the report.

What a static call graph cannot see

The reachability post lists these briefly. Here is the mechanism of each, and why it matters for dependencies in particular.

For each of these the honest output is not "not reachable" but "not determined". A tool that cannot say "not determined" will say "not reachable" instead.

Through other people's code

The transitive row in the lab is the common case, not the edge case. Your code calls a function in a dependency you chose, which calls the vulnerable function in a dependency it chose. If reachability stops at your boundary, asking only "does our code call anything in the vulnerable package", it misses that path. The analysis has to include the code of every dependency between your entry points and the vulnerable symbol.

Three practical consequences follow:

Reached is not exploitable, and unreached is not safe

Level 4 says a path exists. It does not say the vulnerable behaviour happens on it. Many vulnerabilities depend on something besides the call:

Log4Shell is the well-known example of how far apart reached and exploitable can be. The logging call was reachable in practically every application that used the library. What decided exploitability was whether an attacker-controlled string, such as a header or a username, reached a log message where lookup processing was active, and what the environment then allowed. At least one widely circulated configuration mitigation was later found not to cover every path, which is the general lesson: a configuration argument is a claim about every way the code can be reached, not just the obvious one.

So a "reachable" verdict needs a second look at inputs and configuration before it becomes an incident, and a "not reachable" verdict needs a look at everything in the previous two sections before it becomes a closure. Taint analysis across the dependency boundary is how level 5 gets answered statically; the reachability post explains taint and sanitiser modelling.

What a "not reachable" verdict can conclude

A careful "not reachable" means: no path was found, in this call graph, from these entry points, for this build configuration, at this commit, to the symbols in this version of this advisory record. Every one of those qualifiers is a way the verdict goes stale.

In VEX terms, the levels map onto different justifications, and the SBOM and VEX post covers the burden each one carries:

VerdictCISA and OpenVEX justificationCycloneDX justification
The package is not in what ships (level 2)component_not_presentcode_not_present
The package ships but the vulnerable code is built out or not compiled in (level 2 to 3)vulnerable_code_not_presentcode_not_present
The vulnerable code ships but no path reaches it (level 4)vulnerable_code_not_in_execute_pathcode_not_reachable
A path exists but attacker input cannot drive it (level 5)vulnerable_code_cannot_be_controlled_by_adversaryrequires_configuration, requires_environment or a protection justification, depending on why

A level-4 verdict supports vulnerable_code_not_in_execute_path and nothing stronger. The CISA justification guidance quoted in the VEX post warns that "A single path of execution should not be assumed since the attacker may be able to divert the path of execution", which is the reflection and deserialisation problem in one sentence.

As general practice, a not-reachable finding should be handled like this:

  1. De-prioritise it, never dismiss it. Keep it in the queue, visible, ageing, with its verdict and evidence attached.
  2. Patch it on the normal cadence. The next routine dependency upgrade removes the question entirely, which is cheaper than maintaining the argument.
  3. Re-evaluate on every code change. One new call flips the verdict, and the commit that adds it is the cheapest place to notice. A pull-request gate that blocks newly reachable vulnerabilities is doing its job when it fires on such a commit. If the gate compares against a stale baseline, it will also fire on calls that were already there; the stale baseline post covers that failure.
  4. Re-evaluate when the advisory changes. A record that gains a symbol list, changes one, moves from unreviewed to reviewed or widens its affected range changes what was searched for. Store the record's modified timestamp with the verdict.
  5. Re-evaluate when the dependency, the build or the tool changes. A new version of the dependency, a new target platform, or a new version of the analyser or its database can all change the graph.
  6. Raise the bar for known exploitation. A not-reachable entry that appears in CISA KEV has not changed technically, but it deserves a human check of the dynamic-dispatch list before anyone relies on the verdict.

Checking one advisory by hand

When the tooling has no symbol data, or the verdict matters enough to check, this is the procedure.

  1. Confirm levels 1 and 2. The affected version is resolved, and the package is in the artifact you ship, not only in dev, test or build dependencies. Check the artifact, not the manifest.
  2. Look for symbol data in the advisory. For Go, ecosystem_specific.imports in the GO- record; for Rust, the affected functions in the RUSTSEC record. If you are reading a GHSA or CVE record, check whether an ecosystem database has a record for the same vulnerability with more detail.
  3. If there is none, find the fix. Use references typed FIX if present; otherwise the release notes, the changelog and the commit history between the last affected and first fixed versions. Read the diff.
  4. Turn the diff into a symbol list. Separate where the defect is from where the check was added. Walk up the library's own call graph from the changed functions to the public functions that reach them. That public list is what you search for. Record that you derived it, and from which commit.
  5. Find the callers, including in dependencies. Find which of your dependencies import the vulnerable package (go mod why, npm ls with the package name, mvn dependency:tree, or a dependency-tree tool for Python), then search your code and theirs for the public symbols. Include vendored and shaded copies.
  6. List the dynamic mechanisms in play. Reflection, string-based imports, dependency injection, framework registration, deserialisation of untrusted data with polymorphic types, plugin loaders. For each, either show it cannot reach the symbols or treat the vulnerability as reachable.
  7. Check every entry point. Request handlers, message consumers, scheduled jobs, command-line tools, import-time and class-load code, and, for build-time dependencies, the build and test scripts that run in CI.
  8. Check configuration and input. Read the advisory's preconditions. Establish whether the configuration that enables the vulnerable behaviour is on in any deployment, and whether attacker-influenced data reaches the call.
  9. Record the evidence. Advisory ID and record modified time, symbol list and its source, commit analysed, build configurations, tool and database versions, dynamic mechanisms checked, the level of the conclusion, and what would reopen it.
  10. Schedule the upgrade anyway.

Where AppSecD fits

AppSecD's composition analysis runs Trivy and OSV across npm, PyPI, Go, Maven, RubyGems, Cargo, Packagist and NuGet, with typosquat detection, malicious-package detection, provenance checking and CISA KEV correlation, and correlates every advisory against the versions, manifests and repositories actually present in your software estate, with a blast-radius view per CVE. Alongside interprocedural taint analysis, its CVE-reachability answers whether the vulnerable code path can be reached at all. That is the whole claim. This post does not say which call-graph construction AppSecD uses, which ecosystems its reachability covers or how often it is right, and every limit described above applies to any reachability analysis, ours included. Put the checklist below to us as you would to anyone else.

A checklist for a reachability verdict

QuestionIf the answer is no or unknown
Which of the five levels does this verdict claim?It is not a verdict yet
Is the package in the artifact that ships, for every build target?Check the artifact, per platform
Where did the vulnerable-symbol list come from: the advisory, a derived fix diff, or nowhere?With no list, the most a tool can say is package level
If derived, was it propagated from changed helpers up to public functions?Callers of public functions may have been missed
Did the analysis include dependency code, not only first-party code?Transitive paths are missing
Which entry points were modelled, including framework handlers, init and import-time code?Unmodelled handlers make whole subtrees look unreachable
Which dynamic mechanisms are in the code, and how was each handled?Treat as reachable until each is resolved
Does the verdict name the commit, build configuration, tool version and advisory record version?It cannot be re-checked or aged
Does the pipeline gate on the right exit code and scan level for the output format it uses?A clean exit may mean nothing
Are configuration and input preconditions recorded for reachable findings?"Reachable" may be over- or under-stated
Is the not-reachable finding still visible, ageing and scheduled for upgrade?It has been dismissed, not de-prioritised
What reopens it: a new call, a new advisory revision, a new dependency version, a new platform?It will go stale silently

Back to the four advisories against golang.org/x/text. The reachability column was a useful ordering. It put the called vulnerability first, and for most programs it was right about the rest. For the program that selected its handler by name, it was wrong in exactly the way the tool documents, and the VEX statement it generated would have carried that error into someone else's scanner with no trace of the caveat. A "not reachable" verdict is worth keeping as a reason to fix something later rather than now. It is not a reason to stop looking, and the cheapest way to make it go away is still to upgrade the dependency.

More about AppSecD · All posts