You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Go call analysis marks called vulnerabilities as uncalled when an uncalled finding comes last (last-wins aggregation) #3161
matchAnalysisWithPackageVulns aggregates govulncheck findings per (vulnerability, module) with a plain map assignment, so the last finding wins instead of OR-ing. govulncheck emits one finding per vulnerable symbol, and multi-symbol advisories routinely mix called findings (trace frame with a function name) and uncalled findings (single frame, empty function). If the uncalled finding comes last, a vulnerability whose code IS executed is marked Called=false.
Location: internal/sourceanalysis/go.go, in matchAnalysisWithPackageVulns (the idToModuleToCalled assignment loop).
Expected behavior
A vulnerability with ANY called finding must be reported as called, regardless of finding order. This matches the in-repo semantics elsewhere: internal/sourceanalysis/rust.go ("Once one advisory marks this vuln as called, always mark as called", OR-ing), and internal/scalibrenricher/govulncheck/source/govulncheck.go where reachability is ANY finding with a function frame. The Go path is the odd one out.
Actual behavior (order-dependent verdict)
Same finding set, different outcome depending only on order:
order [called, uncalled] -> Called=false (wrong: the false negative)
order [uncalled, called] -> Called=true
Impact
A misclassified vulnerability goes to the hidden (uncalled) bucket in output (internal/output/output_result.go), and determineReturnErr (pkg/osvscanner/osvscanner.go) returns no error (exit 0) when only uncalled vulnerabilities are found with --show-all-vulns off. Go call analysis is ON by default. Net effect: a Go project calling a vulnerable symbol can get a clean scan purely because of finding order. (Exit 0 for genuinely uncalled vulnerabilities is by design; the defect is the misclassification feeding it.)
Minimal reproduction
Call matchAnalysisWithPackageVulns with package github.com/gogo/protobuf v1.3.1, vulnerability GO-2021-0053 (with an imports field), and two findings for the same OSV and module: one with Trace[0].Function set (called) and one with Trace[0].Function empty (uncalled). In order [called, uncalled] the resulting ExperimentalAnalysis["GO-2021-0053"].Called is false; in the reversed order it is true. Verified against the real function with a unit test in both orders.
Suggested fix shape (not applied)
OR instead of overwrite in the aggregation loop: idToModuleToCalled[f.OSV][modulePath] = idToModuleToCalled[f.OSV][modulePath] || called
Dup-screen note
Searched existing issues and the web for this aggregation flaw and found no existing issue describing it. No repo TODO or comment acknowledges last-wins behavior here.
Activity
VIRUSBABAA commentedon Oct 23, 2026
Closing this — re-filing the same report from the correct account (Subhan1794).