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, apom.xml, apackage.jsonwith itspackage-lock.json, or arequirements.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 samedependencyblock, 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,Pipfileorsetup.py, so a stray script does not pull in the host interpreter’s packages. - An explicit
--languageslimits the ecosystems. A manifest adds an ecosystem only for a requested language:--languages javaon a root that also holds apackage.jsonand arequirements.txtresolves 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_skippedwith reasonresolution_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.
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.jsonnames production packages thatnode_modulesdoes not hold, the scan installs from the lockfile in the project directory. Withoutnode_modulesit runsnpm ci --ignore-scripts --no-audit --no-fund, with--omit=devunless--include-dev-dependenciesis set. With an existingnode_modulesit runsnpm install --no-save --ignore-scripts --no-audit --no-fundinstead, which keeps the installed packages the lockfile lists and adds the missing ones. Neither command changespackage.jsonorpackage-lock.json, and no package install script runs. A completenode_modulesis used as it is. - Python. An environment you set up yourself still wins: an activated
VIRTUAL_ENV, or a.venvorvenvdirectory 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 thepython3on PATH, which must be pip 22.3 or later. It installsrequirements.txtwhen there is one, else the dependencies listed in the[project]table ofpyproject.toml(without building the project), else the project directory throughpyproject.toml,setup.pyorsetup.cfg. A project that cannot be built yields no Python dependencies, with a warning. Whenrequirements.txtfails 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.
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 onlygo 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 permodule@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.
devOptionalpackages and workspace members stay.--include-dev-dependenciesrestores the development-only packages. Missing dev packages, as afternpm 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
GOOSorGOARCH, a//go:build ignoregenerator or, withCGO_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/RECORDlists, 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 installsconfigobj/andvalidate/),PyYAML(yaml/and_yaml/) orsix(six.py) scans all of them, and its finding paths start with the package (validate/__init__.py,six.py).
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:
--excludeandsettings.skip.patterns.scanningfromscanoss.json.--excludeis 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-exclusionshas nothing to remove here. .gitignorefiles.
--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 asJwts.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/pkgand a subpathpkg/subreach the function the package’s entry module exports, chosen frompackage.json(exports, thenmain, thenindex.js). Anexportsentry 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 reportsunreachable. - 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.rsandinclude!are not visible to the call graph.
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 exampleparam[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 finalString, a Python module constant or a JavaScript or TypeScriptexport const. - An enum member. For example Java
AlgoName.EC.name(), PythonAlg.SHA.value, a string member of a TypeScriptenum, or a member of anObject.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.
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 asmain. 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: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:
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 withsource: "direct".
Practical walkthrough
This section traces the entire pipeline using the test project attestdata/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 inmypkg/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 withgo 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:
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:
mypkg/crypto.go:
golang.org/x/crypto/...: hundreds more function declarations.
Then the builder creates a reverse index (callee → who calls it):
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:
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:
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:
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
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: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 usestestdata/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 toucheschacha20poly1305 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:
What the scan produces
Running with--scan-dependencies:
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 atchacha20poly1305.New (line 59 of wrapper.go) produces a 3-step chain. This is the backward trace:
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
- User code has 0 crypto findings, because
mypkghas 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/cryptointernals that user code can’t reach. mainis 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_chainsis 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 normalizedfile_path,start_line, optionaldependency_info, and optionalentry_call. entry_calldescribes how execution entered the current function from the previous step. Itsfile_pathandlineare 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[]andcrypto_call.parameters[]both exportparameter_index(always0-based), best-efforttype,argument_expression,resolved_value,variable_namefor simple identifiers only, and recursivesource_nodes.- For Java scans,
scan_metadatamay also includejava_requested_jdk_major,java_runtime_version,java_platform_signatures_used,java_platform_signature_source, andjava_platform_signature_unavailable_reasonto show which JDK major was requested and whether JDK platform signatures were available for enrichment. source_nodescan now carry interprocedural provenance across wrapper hops, for examplePARAMETER -> PARAMETER -> VALUE, and propagated nested nodes keeplocation.file_pathpluslocation.linewhen known.- Method-call expressions are preserved as
CALL_RESULTnodes instead of flattening away their receivers. When the invoked method can be resolved, the node also exportscall_target, and receiver provenance stays nested under theCALL_RESULT(for exampleCALL_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_locationandunresolved_reason.
Call chains ordering
Thecall_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 includelockfile_absent(apackage.jsonwith nopackage-lock.json) andresolution_failed(a secondary ecosystem’s resolution or scan failed). A language with no manifest, such as browser JavaScript with nopackage.json, is not listed. The list is[]when there is none.
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: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-SNAPSHOTversions). A git fork or a patched install of a version therefore never reuses the entry of the published version.
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-neverflag continues past module failures;-DappendOutput=trueaccumulates results from all succeeding modules into a single output file - If some modules resolve successfully, their dependencies are collected even if other modules fail
- Detects modules from
<modules>in the parentpom.xml - Runs
mvn dependency:list -pl <module>for each module independently - Modules that fail are skipped; dependencies from succeeding modules are deduplicated and collected
- Runs
mvn install -DskipTests --fail-neverto build all modules locally, populating~/.m2/repositorywith inter-module artifacts - Retries Tier 1 after install
- This is expensive (requires compilation) but is the only way to resolve inter-module transitive dependencies
mvn dependency:sourcesdownloads-sources.jarfiles to~/.m2/repository/(best-effort; not every Java library publishes source JARs)mvn dependency:tree --fail-never -DappendOutput=truebuilds the dependency graph (best-effort)
~/.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
./gradlewand falls back togradlefromPATH - Uses the caller’s
GRADLE_USER_HOMEwhen set; otherwise defaults it to<user-home>/.gradleusing 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:- Root module detection reads
pyproject.tomlfor[project] nameor[tool.poetry] name; with neither, the project’s own code is keyed at the scan root, never by the directory name python -m pip list --format=jsonlists all installed packages with versionspython -m pip show <packages>gets location and dependency info for each package- 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-infodirectories (top_level.txt,RECORD) for older Python versions - Package root resolution finds every top-level package directory and module file of the distribution (see Step 3). C-extension packages are skipped
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:
- All packages with name, version, and manifest path
- Resolve graph with dependency edges between packages
- Workspace detection: local and workspace crates are treated as user code; all others are dependencies
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.relationshipanddependency.pathcome 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 norelationshiporpath; itspurlandversionstay. - 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.gofiles or by build-tagged tool files such astools.go, and requirements nothing imports, are not resolved or scanned.--include-testsdoes not widen the inventory. - Host build configuration.
go list -depsevaluates build constraints for the scanning host’sGOOS,GOARCHand build tags (including any inGOFLAGS), 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_ENABLEDdecides 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.pathcarrieswithout_source: true, and a finding whose every route from the application crosses one, with no chain reaching it, readsunknown(dependency_without_source) instead ofunreachable. - 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 runspython -m pipandimportlib.metadatathrough the same interpreter. IfVIRTUAL_ENVis set, that environment’s Python is preferred; otherwise it falls back topython3thenpythonfrom 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-infofallback; 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
cargoin PATH. The resolver shells out tocargo 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 assumessrc/is the crate root; non-standard[lib] pathconfigurations may produce incorrect module paths.