Skip to main content
Contract note: the interim report holds findings metadata only (source, dependency_info, finding_id, and optional occurrence_key). The finding-centric reachability slices, such as call_chains, entry_call, and crypto_call, are in the separate --export-callgraph artifact, not in the interim report.

Overview

With --scan-dependencies, crypto-finder scans more than the user’s source code. It resolves the project’s dependency tree, scans each dependency for cryptographic usage, builds a cross-package call graph, and traces each finding back to the user’s code. The question it answers is “Does my code actually reach this crypto function?”

The six-step pipeline

The sections below explain what each step does and what it means for your results.

Step 1: Resolve dependencies

Crypto-finder asks the ecosystem’s own tooling which dependencies the project uses, at which versions, and where each dependency’s source code is on disk: the Go module cache, source JARs extracted to ~/.scanoss/crypto-finder/cache/sources/, node_modules, the Python site-packages directory, or the Cargo registry. See Supported ecosystems for the details of each one. The project’s own code is the user code; everything else is a dependency. For Go, user code is every package under the main module’s path (for example github.com/myorg/app). Since 0.46.0, Java user code is the set of packages that the project’s own source files declare, all modules of a multi-module build under the scanned root included. A dependency that shares the application’s groupId, such as an in-house com.myorg:crypto-utils, therefore stays a dependency, and a package declared only by dependency files is never user code.

Which ecosystems are resolved

With --dep-ecosystem auto, the default, crypto-finder resolves the dependencies of every ecosystem it can read. Since 0.53.0 it no longer takes only the language with the most files:
  • Candidates. The ecosystems of the detected languages come first, the language with the most files first, then every other ecosystem whose manifest sits at the target.
  • Readable ones are resolved. An ecosystem is resolved when its resolver can read the target or a module directory below it, for example a go.mod, a pom.xml, a package.json with its package-lock.json, or a requirements.txt. The first one is the primary ecosystem. Each of the others is resolved beside it and gets its own call graph with its dependencies, so its dependency findings carry the same dependency block, call chains and reachability as when it is the primary.
  • Python needs a manifest to join. Python reads the packages installed in an interpreter rather than a manifest. It is resolved beside or ahead of the dominant language only when the target has a pyproject.toml, requirements.txt, Pipfile or setup.py, so a stray script does not pull in the host interpreter’s packages.
  • An explicit --languages limits the ecosystems. A manifest adds an ecosystem only for a requested language: --languages java on a root that also holds a package.json and a requirements.txt resolves Java alone.
  • A secondary ecosystem cannot fail the scan. When the resolution or dependency scan of an ecosystem other than the primary fails, the scan logs it, reports it in ecosystems_skipped with reason resolution_failed, and keeps the other ecosystems’ results. A failure of the primary ecosystem or of an explicit --dep-ecosystem, a timeout and an interruption still stop the scan.
For example, a Flask application with a requirements.txt, whose browser JavaScript outnumbers its Python files and which has no package.json, resolves its Python dependencies; before 0.53.0 it picked Node and skipped the dependency phase with manifest_absent. A repository with a package.json, a package-lock.json and a requirements.txt gets the dependency findings of both Node and Python. When no ecosystem can be resolved, the phase is skipped for the language with the most files, as before. An explicit --dep-ecosystem resolves that ecosystem alone.

Installing Node and Python dependencies

Node and Python dependencies are read from what is already installed, so by default a project must be installed before it is scanned. Since 0.49.0, add --install-dependencies together with --scan-dependencies to have the scan install them itself, for example in a clean build container. The flag is off by default and needs network access to the package registries.
  • Node. When package-lock.json names production packages that node_modules does not hold, the scan installs from the lockfile in the project directory. Without node_modules it runs npm ci --ignore-scripts --no-audit --no-fund, with --omit=dev unless --include-dev-dependencies is set. With an existing node_modules it runs npm install --no-save --ignore-scripts --no-audit --no-fund instead, which keeps the installed packages the lockfile lists and adds the missing ones. Neither command changes package.json or package-lock.json, and no package install script runs. A complete node_modules is used as it is.
  • Python. An environment you set up yourself still wins: an activated VIRTUAL_ENV, or a .venv or venv directory in the project. Otherwise the scan creates a virtual environment outside the scanned tree and installs the project’s dependencies into it with the pip of the python3 on PATH, which must be pip 22.3 or later. It installs requirements.txt when there is one, else the dependencies listed in the [project] table of pyproject.toml (without building the project), else the project directory through pyproject.toml, setup.py or setup.cfg. A project that cannot be built yields no Python dependencies, with a warning. When requirements.txt fails to install as a whole, each requirement is retried on its own. Later scans reuse the environment unless it had to build a local project directory. With the flag, the packages of the ambient interpreter are never reported as the project’s dependencies.
Building a Python package that is published only as a source distribution runs its build backend, which executes code from that package. Enable --install-dependencies only where that is acceptable, such as an isolated sandbox.

Step 2: Load and filter rules

Crypto-finder loads the rules once and keeps only those for the ecosystem’s languages. A Go project keeps only go rules, and a Java project only java rules. Rules for other languages never run against dependency source. Rule IDs in dependency findings are the same as in a scan of your own code.

Step 3: Scan dependencies in parallel

Each dependency is scanned once per module@version, in a stable order, so repeated scans of the same project give the same results. A dependency whose results are already in the findings cache is not scanned again. The others are scanned in parallel; --dep-workers sets the number of workers (by default half the CPU cores, up to 8). Each dependency’s report is what a scan of that dependency alone produces, and a dependency whose scan fails does not affect the findings of the others. With an API key, crypto-finder can use the findings SCANOSS has already published for a dependency version instead of scanning it locally; each lookup sends the package’s purl and version. --no-dependency-findings-api scans every dependency locally. Either way, the call graph and reachability are always built from the local sources. Which files of a dependency are scanned:
  • npm dependencies are the production tree. Packages the lockfile marks as development-only are neither scanned nor put in the dependency graph. devOptional packages and workspace members stay. --include-dev-dependencies restores the development-only packages. Missing dev packages, as after npm install --omit=dev, are never an error.
  • Go dependencies scan only the files their imported packages compile. A Go program contains only the packages it imports, and of each package only the files its build compiles. The scan therefore reads only those files: not the module’s other packages, and not files that build constraints exclude for the scanning host, such as a file for another GOOS or GOARCH, a //go:build ignore generator or, with CGO_ENABLED=0, a file that imports "C" (see Go-specific limitations). Finding paths are still relative to the module directory.
  • Python namespace distributions scan only their own files. Several distributions can install into one namespace directory: protobuf, googleapis-common-protos, google-auth and google-api-core all install into site-packages/google. Each one scans only the files its *.dist-info/RECORD lists, so each file is reported under the one distribution that installed it.
  • Python distributions scan every top-level package and module they installed. A distribution such as configobj (which installs configobj/ and validate/), PyYAML (yaml/ and _yaml/) or six (six.py) scans all of them, and its finding paths start with the package (validate/__init__.py, six.py).
Dependency scans use their own exclusions. A published package is not a checkout, and often ships its only code in dist/ or build/, so the exclusions of the main scan do not apply inside a dependency. A dependency scan skips only the built-in test patterns (test/, tests/, src/test/, src/tests/, __tests__/, **/*Test.java, **/*Tests.java, **/*_test.go, **/test_*.py), and for npm the dependency’s own nested node_modules/, whose packages are scanned under their own identity. None of these apply inside a dependency:
  • --exclude and settings.skip.patterns.scanning from scanoss.json. --exclude is not a way to hide dependency findings.
  • The built-in skipped directories (dist, build, vendor, target, docs, shaded, …) and the generated-stub globs (*.pb.go, *_pb2.py, …). --no-default-exclusions has nothing to remove here.
  • .gitignore files.
--include-tests leaves the test patterns out, so a dependency scan then reads its test files too. Go dependencies never include _test.go files, because only the files the program compiles are scanned. Dependencies without a usable local source directory are not scanned. They are logged as Skipping dependency source scan: no local source directory. For Java, such a dependency can still contribute type information to step 4 when its compiled JAR is available.

Step 4: Build the call graph

Crypto-finder builds a call graph of which function calls which, across the user code and the dependencies. It parses source code syntactically, so it needs no compiler, Go toolchain, Python interpreter or Rust toolchain for this step. User code and the dependencies with crypto findings are parsed in full. For Java, the other dependencies contribute only the type signatures of their compiled JARs (class names, method signatures, return types), which is enough to follow chained calls such as Jwts.builder().setId(id).signWith(algo, key) across libraries. These signatures are cached per artifact under ~/.scanoss/crypto-finder/cache/bytecode/. The Java JDK used for platform signatures can be set per scan with java_jdk_major (auto, 8, 11, 17, 21) and java_jdk_homes. Go and Python dependencies are parsed over the same files that step 3 scans, so the graph holds exactly the code the program contains. Some cases the call graph follows that affect reachability:
  • Calls through an npm package name (since 0.46.0). require('pkg'), import { fn } from 'pkg', a default import, a scoped @scope/pkg and a subpath pkg/sub reach the function the package’s entry module exports, chosen from package.json (exports, then main, then index.js). An exports entry with a * pattern, a value a factory builds at run time, and a method on an instance a package function returns are left unlinked rather than guessed; a finding reached only through one of them reports unreachable.
  • Calls on a factory’s result (since 0.53.1). A method called on a local variable bound once to what a function returns reaches the method of the class that function builds, when every return builds that one class. Otherwise the call is dispatched by the declared type.
  • Rust macro arguments (since 0.46.0). A call inside a macro’s parenthesized or bracketed arguments, such as println!("{:?}", digest(data)), is a call from the enclosing function. Brace-delimited macro bodies, macro_rules! bodies, procedural macro expansion, build.rs and include! are not visible to the call graph.
For each call, the call graph also records where the argument values come from: literal constants, local variables, class fields, method parameters, or call results. This is what the call graph export reports as source_nodes, and what the scan uses to resolve algorithm arguments.

Algorithm arguments resolved across files

A rule can select an algorithm by the value of an argument (for example param[0]==SHA-256). When the scan builds a call graph (--export-callgraph, --export-graph-fragment or --scan-dependencies), it follows the argument to the value it holds and reports one per-value asset for each value it finds, with conditioned_value set. For Java, Python, JavaScript and TypeScript, the value can come from:
  • A function parameter. A helper such as def digest(data, alg): return hashlib.new(alg, data) is reported with the algorithm each caller passes, also when the caller is in another file or module, and for a Python keyword argument.
  • A local variable or a constant. A string local bound once, a module or class constant, and a constant imported from another file, such as a Java static final String, a Python module constant or a JavaScript or TypeScript export const.
  • An enum member. For example Java AlgoName.EC.name(), Python Alg.SHA.value, a string member of a TypeScript enum, or a member of an Object.freeze({..}) object.
  • A getter of a field the constructor sets. new Holder("SHA256withECDSA").getAlg() gives the constructor’s argument, when the getter only returns the field.
When a caller passes a value the scan cannot determine, the generic finding stays next to the per-value assets of the other callers. If that value comes from an environment variable, a system property or a program argument, the generic finding names it in algorithmSource (see Algorithms read at run time). The scan reports no value rather than a value that can be wrong. It drops a value when the name can be rebound, when another module can write the value at run time (for example settings.ALG = os.environ["HASH_ALG"]), or when something other than the constructor can write the field. Python method parameters, default parameter values, f-strings and template literals with a substitution, and attribute or property reads such as h.alg are not resolved yet. A class patched from another module, or a field written by reflection such as Java Field.set, is not detected.

Step 5: Trace and attribute findings

For each crypto finding in a dependency, crypto-finder finds the function that contains it and walks the call graph backward through its callers until it reaches functions that nothing calls, such as main. A chain is kept only when it passes through user code; chains that stay inside dependency code are discarded. Every path that qualifies is kept, so no reachability information is lost. Each chain is an ordered array, [program_entry_point, ..., intermediate, ..., crypto_call_site], where position [i] calls position [i+1].

Attribution output

After tracing, each finding gets structured attribution metadata in the interim report, and the detailed reachability slices are emitted by the separate call graph export. A dependency finding:
Dependency finding file_path values are relative to the dependency root. The artifact identity stays in dependency_info, so consumers do not need to parse module@version back out of the path string. A user code finding:
A call graph export slice:

Step 6: Merge reports

Crypto-finder merges dependency findings into the interim report and leaves reachability slicing to the call graph export. A finding appears in the interim report whether or not it later produces an exported call chain. User code findings are always included and marked with source: "direct".

Practical walkthrough

This section traces the entire pipeline using the test project at testdata/projects/go_with_crypto_dep/. Every value shown is real output from running crypto-finder scan --scan-dependencies against this project.

The source code

Three files make up the project: go.mod declares one direct dependency:
main.go is the entry point. It does not use crypto directly:
mypkg/crypto.go is the user’s wrapper package. It uses crypto from a dependency:

Step 1: Scan user code (the normal scan)

The orchestrator runs Semgrep/OpenGrep rules against user code. It finds 3 assets in mypkg/crypto.go: This produces the user report. At this point there are no source, call_chain, or dependency_info fields, only raw findings.

Step 2: Resolve dependencies

The Go resolver lists the main module with go list -m -json, then runs go list -e -deps over the main module’s packages and keeps every module that provides a package in that non-test import closure. Build constraints are evaluated for the scanning host: on amd64, chacha20poly1305 imports golang.org/x/sys/cpu, so both modules below are in the closure, while on arm64 only golang.org/x/crypto is. On amd64 it returns:
The RootModule (example.com/crypto-test) is the Go user-code prefix. Any package whose import path starts with it is user code. For Java, user code is the packages declared in project source files (see Step 1), even when RootModule is a Gradle project name rather than a package prefix. A package declared only by dependency files is a dependency for every ecosystem, even when it sits under the user-code prefix (a nested Go module such as example.com/crypto-test/tools). Everything else is a dependency.

Step 3: Scan dependencies in parallel

Each dependency gets scanned with the same rules, limited to Go rules only, and only in the packages the program imports: chacha20poly1305, chacha20, internal/alias and internal/poly1305 of golang.org/x/crypto, and cpu of golang.org/x/sys. With the rule set of 2026-10-02: Total: 4 dependency findings. Only golang.org/x/crypto has findings, so it proceeds to step 4 together with the user code.

Step 4: Build the call graph

The call graph covers the user code and the crypto-bearing dependency, limited to the files of its imported packages (chacha20/chacha_generic.go, chacha20poly1305/chacha20poly1305.go, internal/poly1305/sum_generic.go, …). The parser processes each of these .go files and extracts function declarations with their calls. From main.go:
From mypkg/crypto.go:
From golang.org/x/crypto/...: hundreds more function declarations. Then the builder creates a reverse index (callee → who calls it):
Backward tracing depends on this reverse index.

Step 5: Trace and attribute

The system now traces each finding back through the call graph to user code. Three different scenarios play out:

Scenario A: user finding at chacha20poly1305.New, line 13

This finding is in mypkg/crypto.go (user code). The enrichment flow: 5a-1. Find the containing function. Crypto-finder looks for the function in mypkg/crypto.go whose lines span line 13. It finds SecureEncrypt (lines 12 to 25). 5a-2. Trace back to the entry point. Tracing back from SecureEncrypt, with example.com/crypto-test as the user code:
5a-3. Export the slice.
Note: main’s line is 14 (the line where main calls SecureEncrypt), not line 10 where main is declared. Each step of a chain records the line of the call to the next step.

Scenario B: user finding at chacha20poly1305.New, line 29

Same logic, but traces through SecureDecrypt:
Note: main’s line is now 19, the line where main calls SecureDecrypt, not 14.

Scenario C: unreachable dependency finding in deep x/crypto internal functions

Take any internal function in golang.org/x/crypto, say ssh.newAESCTR:
Result: call_chains is empty. The finding may still be in the interim report, but it adds no useful reachability slice to the call graph export. So the useful downstream signal stays narrow even when a dependency uses a lot of crypto internally. The vast majority of golang.org/x/crypto’s internal crypto usage is not reachable from the user’s main().

Step 6: Merge

In this test project, the useful reachability slices all start from user code findings, because the user code calls chacha20poly1305.New directly inside mypkg/crypto.go, a file in the user’s own module. The crypto usage is already captured as source: "direct". There’s no intermediate dependency wrapper that the user calls which then reaches crypto. With a longer chain, such as main → mypkg.Encrypt → someMiddleware.Process → chacha20poly1305.New where someMiddleware is a dependency, a dependency-backed reachability slice would appear in the call graph export.

Actual interim report output

The final interim report looks like this:
The corresponding reachability slices are emitted by the separate call graph export and joined through finding_id.

Visual summary


Walkthrough 2: multi-hop dependency chain

In the first walkthrough, user code calls crypto directly, so the useful reachability slices start from direct findings. This second walkthrough uses testdata/projects/go_with_dep_chain/ to show a multi-hop chain, where the crypto usage sits deep inside a dependency and the dependency-backed reachability slices are the useful output.

The source code

Here, user code never touches chacha20poly1305 directly. Instead, it calls through a wrapper dependency (cryptowrapper_dep/), which has an internal function layer. main.go is the entry point and calls mypkg:
mypkg/crypto.go is user code that delegates to the dependency. It has no crypto imports.
../cryptowrapper_dep/wrapper.go is the dependency, a separate module. It has a public API and an internal function:
The intended call chains:

What the scan produces

Running with --scan-dependencies:
Only a small subset of the traced findings produce meaningful exported slices. Deep x/crypto and x/sys internals may still be scanned and identified, but they do not help downstream stitching unless the graph can connect them back to component-owned or user-owned entry points.

Tracing the 3-step chain

The finding at chacha20poly1305.New (line 59 of wrapper.go) produces a 3-step chain. This is the backward trace:
The trace found two complete chains. Both are stored in call_chains:

Full trace to main

The trace walks all the way to root functions (functions with no callers, like main). This means the full chain main → SecureEncrypt → Encrypt → newAEAD is preserved. A chain is valid if it passes through at least one user-package function, so chains that only traverse dependency code are discarded.

Visual summary

What this shows:
  • User code has 0 crypto findings, because mypkg has no crypto imports.
  • 2 dependency findings survive reachability, because the call graph proves that user code reaches them.
  • 492 dependency findings are dropped, because they are deep x/crypto internals that user code can’t reach.
  • main is at the head of each chain, because the trace walks to root functions, which have no callers.
  • Both the Encrypt and Decrypt paths are kept, because every chain is stored in call_chains.

Interim report contract (v1.7)

Version 1.7 keeps the attribution fields needed to join findings to the separate reachability export and adds an optional AST-anchored structural identity when callgraph evidence is available. Dependency-backed paths are dependency-root-relative; dependency_info remains the canonical place for dependency module, version, and package URL. Direct findings may additionally expose a valid rule package URL at the asset-level purl; it is version-enriched only when one unambiguous direct dependency match exists.

Call graph export

When --export-callgraph is enabled, Crypto Finder emits a finding-centric JSON export that uses the same relative-path convention as the main report. Schema note: since call graph export version 6.12 (the default is now 6.18; see the output formats page for the version history), the export carries optional direct finding purl values at the finding level, optional occurrence_key structural identities, canonical dependency package URLs inside dependency_info.purl, and contract-scoped supporting_calls[].supporting_call.resolved_key_length evidence for structurally derived Java key-generation configuration calls, including the rule_declared_bits value and rule_conflict marker when a rule-declared key length disagrees with the resolved one. Java runtime provenance remains available in scan_metadata for JDK-aware platform signature enrichment.
  • Each top-level record stays keyed by finding_id, which is the join key back to the interim report. occurrence_key, when present, is a separate structural identity and does not replace that join.
  • call_chains is the primary value-flow structure. Each chain is ordered from the first reachable caller to the function that contains the matched crypto call.
  • Each chain node contains a fully qualified function_name, a normalized file_path, start_line, optional dependency_info, and optional entry_call.
  • entry_call describes how execution entered the current function from the previous step. Its file_path and line are the call-site location in the previous node’s source file.
  • The last node in a chain carries crypto_call, which is the matched crypto-relevant call that triggered the finding.
  • entry_call.parameters[] and crypto_call.parameters[] both export parameter_index (always 0-based), best-effort type, argument_expression, resolved_value, variable_name for simple identifiers only, and recursive source_nodes.
  • For Java scans, scan_metadata may also include java_requested_jdk_major, java_runtime_version, java_platform_signatures_used, java_platform_signature_source, and java_platform_signature_unavailable_reason to show which JDK major was requested and whether JDK platform signatures were available for enrichment.
  • source_nodes can now carry interprocedural provenance across wrapper hops, for example PARAMETER -> PARAMETER -> VALUE, and propagated nested nodes keep location.file_path plus location.line when known.
  • Method-call expressions are preserved as CALL_RESULT nodes instead of flattening away their receivers. When the invoked method can be resolved, the node also exports call_target, and receiver provenance stays nested under the CALL_RESULT (for example CALL_RESULT -> PARAMETER alg -> VALUE SignatureAlgorithm.HS256).
  • Findings that cannot be resolved to a containing function or a specific crypto call remain in the export with finding_location and unresolved_reason.

Call chains ordering

The call_chains field in the call graph export contains all traced paths from program entry points to the crypto call site. Each inner array is one complete path, ordered from program entry point (index 0) to crypto call site (last index). Entry [i] calls entry [i+1]. Example:

Progress output

With --progress, the scan writes lifecycle events as JSONL to stderr. Since 0.48.0, the completed dependencies phase also names the dependencies behind three of its counts: deps_skipped_list (no local source), deps_failed_list, and deps_incomplete_list (the scan stopped at a time or memory limit). Each list is as long as its count, sorted by module, version and purl, and empty when the count is zero. An entry carries module, version, reason (no_local_source, scan_failed or time_or_memory_limit), the purl the dependency’s findings carry in cryptographic_assets[].dependency_info.purl when the module has one, and, for a failed scan, its failure error_code when the error has one. The fields are optional within scan-progress schema v1, published in schemas/scan-progress-schema.json. Since 0.53.0, one dependencies phase covers every ecosystem it resolves: its counts and lists add up over all of them, and the nested callgraph events repeat once per ecosystem with dependencies. The completed event also carries:
  • ecosystems: the resolved ecosystems, in resolution order, the primary first, for example ["node", "python"].
  • ecosystems_skipped: the ecosystems the target has something to resolve for that were not resolved, sorted by ecosystem, each as {"ecosystem": ..., "reason": ...}. Reasons include lockfile_absent (a package.json with no package-lock.json) and resolution_failed (a secondary ecosystem’s resolution or scan failed). A language with no manifest, such as browser JavaScript with no package.json, is not listed. The list is [] when there is none.
A skipped dependencies event carries ecosystem, the ecosystem its reason is about (for example {"reason": "lockfile_absent", "ecosystem": "node"}), except for ecosystem_unknown and not_requested. All three fields are optional within schema v1, so a consumer must read their absence as not reported.

Findings cache

A dependency’s scan results depend only on the dependency version and the rules, so crypto-finder caches them. On a second scan with the same dependencies and rules, the dependencies are not scanned again and the dependency scanning phase drops from minutes to near-zero. Before scanning, crypto-finder checks each dependency for a cached result. Dependencies without one are scanned, and each one’s report is then stored, unless its scan stopped at a time or memory limit. Findings published by SCANOSS (see Step 3) are not written to the cache. The cache is a directory of JSON files, one per dependency version and ruleset:
To clear the cache, delete that directory.

Cache key design

An entry is reused only when a new scan would give the same result. The entry is no longer used, and the dependency is scanned again, when any of these change:
  • The dependency’s module or version.
  • The rules: editing, adding or removing any rule file invalidates every entry.
  • The scanner and its configuration, including the OpenGrep mode and the rule prefilter, and the crypto-finder version when it changes how results are keyed.
  • The dependency’s source, for installs whose package store does not verify what it holds (node_modules, site-packages, extracted source JARs, Maven -SNAPSHOT versions). A git fork or a patched install of a version therefore never reuses the entry of the published version.
Entries do not depend on the home directory, host or checkout, so CI runs and hosts that share a findings cache reuse each other’s entries.
The key changed in v0.37.0, in every OpenGrep mode. Entries written by earlier versions no longer match, so the first --scan-dependencies run after upgrading scans every dependency again with a cold cache. Later runs hit the cache as before.

Supported ecosystems

These ecosystems are supported today:

Go

Java (Maven / Gradle)

Since 0.49.0, a library rebuilt at the same version (a -SNAPSHOT, or a module reinstalled with mvn install) is re-extracted, so its new sources are scanned without deleting the cache by hand. An interrupted extraction (a killed scan, a full disk) no longer leaves a partial cache entry, and scans running side by side on one host do not read an entry another scan is still extracting.

Maven resolution details

The Maven resolver uses a three-tier fallback strategy to recover as many dependencies as it can, especially in multi-module projects. Since 0.46.0, Crypto Finder asks Maven which local repository it uses, once per scan, from the project directory (maven-help-plugin:3.5.1:evaluate -Dexpression=settings.localRepository). The answer honors localRepository in settings.xml, -Dmaven.repo.local in MAVEN_OPTS and .mvn/maven.config. Every later Maven invocation receives -Dmaven.repo.local=<that repository>, so Maven writes artifacts to the same repository that Crypto Finder reads. When Maven cannot report it, the scan logs a warning and uses ~/.m2/repository (the operating-system user home is HOME on Unix and USERPROFILE on Windows). The scan logs which repository it used. In the rest of this section, ~/.m2/repository stands for the Maven local repository the scan uses. Tier 1: reactor with --fail-never (always attempted):
  • Runs mvn dependency:list --fail-never -DappendOutput=true -DincludeScope=compile
  • The --fail-never flag continues past module failures; -DappendOutput=true accumulates results from all succeeding modules into a single output file
  • If some modules resolve successfully, their dependencies are collected even if other modules fail
Tier 2: per-module resolution (if Tier 1 yields zero dependencies on a multi-module project):
  • Detects modules from <modules> in the parent pom.xml
  • Runs mvn dependency:list -pl <module> for each module independently
  • Modules that fail are skipped; dependencies from succeeding modules are deduplicated and collected
Tier 3: local install and retry (if Tier 2 yields zero dependencies and inter-module failure is detected):
  • Runs mvn install -DskipTests --fail-never to build all modules locally, populating ~/.m2/repository with inter-module artifacts
  • Retries Tier 1 after install
  • This is expensive (requires compilation) but is the only way to resolve inter-module transitive dependencies
After dependency listing, the resolver also runs:
  • mvn dependency:sources downloads -sources.jar files to ~/.m2/repository/ (best-effort; not every Java library publishes source JARs)
  • mvn dependency:tree --fail-never -DappendOutput=true builds the dependency graph (best-effort)
Dependencies without source JARs are included in the resolution results but without a source directory. They are skipped for source scanning and logged explicitly; if the compiled artifact is present in ~/.m2/repository, it can still contribute type information to the call graph.

Gradle resolution details

The Gradle resolver asks Gradle itself for a machine-readable dependency model via a temporary init script:
  • Prefers ./gradlew and falls back to gradle from PATH
  • Uses the caller’s GRADLE_USER_HOME when set; otherwise defaults it to <user-home>/.gradle using the same operating-system user home
  • Resolves the main Java compile classpath for single-project and multi-project builds
  • Treats included Gradle subprojects as user code rather than external dependencies
  • Captures external module coordinates, versioned dependency edges, compiled JAR paths, and best-effort source archive paths
  • Uses the same source extraction cache as Maven
  • Reachability still traces from application Java packages when the project has no group

Multi-module project support

Crypto-finder detects multi-module Maven projects (a parent POM with <modules>) automatically. For these projects:
  • All modules are treated as user code for call chain tracing (same as Cargo workspace members)
  • The three-tier fallback strategy handles common multi-module failures:
    • Inter-module dependencies (one module depending on another module of the same build) are resolved through Tier 3.
    • HTTP mirror blocks (Maven 3.8.1+ blocks insecure HTTP repositories) still yield partial results through Tier 1.
    • Missing parent POMs or private repositories fall back to the partial results of Tier 1 or Tier 2.

Node (npm)

A package.json without a package-lock.json is not resolved, and the dependencies progress event reports it in ecosystems_skipped with reason lockfile_absent. Install the project first, or pass --install-dependencies (see Installing Node and Python dependencies).

Python (pip)

Python resolution details

The pip resolver executes the following steps:
  1. Root module detection reads pyproject.toml for [project] name or [tool.poetry] name; with neither, the project’s own code is keyed at the scan root, never by the directory name
  2. python -m pip list --format=json lists all installed packages with versions
  3. python -m pip show <packages> gets location and dependency info for each package
  4. Distribution-to-import mapping uses that same interpreter’s importlib.metadata.packages_distributions() (Python 3.10+) to map distribution names to import names. Falls back to the *.dist-info directories (top_level.txt, RECORD) for older Python versions
  5. Package root resolution finds every top-level package directory and module file of the distribution (see Step 3). C-extension packages are skipped
Since 0.49.0, every PyPI dependency finding’s file_path, in the findings report and in the callgraph export (functions[].file_path, chain frames), is relative to the environment’s package directory (site-packages) and starts with the top-level package, as the wheel RECORD names the file: libb/codec.py. Before, a distribution with one top-level package, or a share of a namespace package such as google/, was reported relative to that package directory (codec.py, protobuf/message.py), so two packages of one distribution could report the same path. Dependency identity and callgraph symbols are unchanged, but the finding_id and occurrence_key of those findings change with the path.

Rust (Cargo)

Rust resolution details

cargo metadata --format-version=1 provides:
  1. All packages with name, version, and manifest path
  2. Resolve graph with dependency edges between packages
  3. Workspace detection: local and workspace crates are treated as user code; all others are dependencies
Workspace members count as user code, so in a multi-crate workspace every workspace crate is “user code” for reachability analysis. Callgraph symbols of a Cargo dependency or workspace member are keyed by the crate’s library name, the name source code writes: my_crate for package my-crate, or the [lib] name the manifest sets. Since 0.48.0, a call such as my_crate::digest(..) from another crate therefore resolves; before, every finding in such a crate read unreachable. Dependency identity (dependency_info.module, purl, dependency.path) keeps the package name.

Limitations

General

  • Static analysis. The call graph is built from syntactic call expressions. It cannot resolve interface dispatch, reflection-based calls, or function values passed as arguments.
  • One module at two versions. A finding’s dependency.relationship and dependency.path come from the resolved dependency graph. When a module resolves at more than one version (npm installs a package twice when versions conflict), a resolver that records versioned edges (npm, Maven, Gradle, Cargo) gives each copy its own route. For a resolver that does not, the finding in such a module, and any dependency reached through one, carries no relationship or path; its purl and version stay.
  • All paths stored. When several call chains exist, all of them are stored in call_chains, so no reachability information is lost.

Go-specific

  • Production import closure only. The inventory holds the modules that provide a package imported, directly or transitively, by a non-test package of a main module. Modules required only by _test.go files or by build-tagged tool files such as tools.go, and requirements nothing imports, are not resolved or scanned. --include-tests does not widen the inventory.
  • Host build configuration. go list -deps evaluates build constraints for the scanning host’s GOOS, GOARCH and build tags (including any in GOFLAGS), so a module imported only on another platform is not inventoried, and within an imported package only the files that build compiles are scanned and parsed. CGO_ENABLED decides whether files that import "C" count.
  • Packages that fail to load. A package the go tool cannot load, such as a directory that mixes two package names or imports a module missing from the module cache while offline, is skipped with a warning. Modules imported only through it are not inventoried; the rest of the closure is.
  • No cross-module method resolution. Method calls on variables (e.g., cipher.Encrypt()) are recorded with the variable name as the type, not the resolved type. Cross-package type resolution would require full type analysis.

Java-specific

  • Gradle source archives are best-effort. Gradle dependency resolution provides binary artifact paths deterministically, but source archive availability still depends on what upstream repositories publish.
  • Missing source JARs. Dependencies without sources are skipped for source scanning, but they can still contribute Java bytecode types if the compiled JAR is present locally. They cannot produce source-level findings until sources are available. Their code has no calls in the graph, so no call chain crosses them: in the callgraph export such a dependency on a finding’s dependency.path carries without_source: true, and a finding whose every route from the application crosses one, with no chain reaching it, reads unknown (dependency_without_source) instead of unreachable.
  • Wildcard import resolution. When multiple wildcard imports could match a class name, resolution is best-effort.
  • Limited inheritance and polymorphism. Variable types are tracked syntactically, but interface method call sites and abstract-class method call sites are fanned out to same-name/arity concrete implementations and subclass overrides within the same namespace root. This is a name+arity heuristic, not full type resolution, so it can over-match unrelated overloads across sibling implementations.
  • Multi-module Maven partial resolution. Multi-module Maven projects are supported through a three-tier fallback strategy. Tier 3 (mvn install -DskipTests) requires compilation and may fail if the project needs specific JDK versions or build tools not available in the scan environment.

Python-specific

  • Requires a Python interpreter with pip. The resolver runs python -m pip and importlib.metadata through the same interpreter. If VIRTUAL_ENV is set, that environment’s Python is preferred; otherwise it falls back to python3 then python from PATH.
  • Dependencies must be installed. The resolver reads installed distributions. Install the project first, or pass --install-dependencies (see Installing Node and Python dependencies).
  • C-extension packages are skipped. Packages without Python source on disk (compiled C extensions) cannot be scanned.
  • Distribution-to-import mapping. The resolver relies on importlib.metadata (Python 3.10+) or *.dist-info fallback; packages with non-standard layouts may not be resolved.
  • No dynamic dispatch. Calls resolved through getattr, __getattr__, or metaclass magic are not tracked.

Rust-specific

  • Requires cargo in PATH. The resolver shells out to cargo metadata.
  • No trait dispatch. Method calls on trait objects (e.g., dyn Cipher) are resolved syntactically by type name; trait implementations are not followed.
  • Macro-generated code. Functions generated by macros (e.g., proc_macro) are invisible to syntactic parsing.
  • src/ transparency assumption. The parser assumes src/ is the crate root; non-standard [lib] path configurations may produce incorrect module paths.