@@ -41,6 +41,9 @@ To control which files are processed, use the -tags flag to provide a
41
41
comma-separated list of build tags, and the -test flag to indicate that test
42
42
files should be included.
43
43
44
+ To include more detailed stack traces, pass -show=traces, this will cause it to
45
+ print the full call stack for each entry.
46
+
44
47
To run govulncheck on a compiled binary, pass it the path to the binary file
45
48
with the -mode=binary flag:
46
49
@@ -50,36 +53,9 @@ Govulncheck uses the binary's symbol information to find mentions of vulnerable
50
53
functions. Its output omits call stacks, which require source code analysis.
51
54
52
55
Govulncheck exits successfully (exit code 0) if there are no vulnerabilities,
53
- and exits unsuccessfully if there are. It also exits successfully if -json flag
56
+ and exits unsuccessfully if there are. It also exits successfully if the -json flag
54
57
is provided, regardless of the number of detected vulnerabilities.
55
58
56
- # Flags
57
-
58
- A few flags control govulncheck's behavior.
59
-
60
- The -C flag causes govulncheck to change its working directory to the provided
61
- directory before running. Any patterns or files named on the command line are
62
- interpreted after changing directories.
63
-
64
- The -db flag causes govulncheck to read from the specified database, which must
65
- implement the specification at https://go.dev/security/vuln/database. By
66
- default, govulncheck fetches vulnerability data from https://vuln.go.dev.
67
-
68
- The -json flag causes govulncheck to print its output as a JSON object
69
- corresponding to the type [golang.org/x/vuln/internal/govulncheck.Result]. The
70
- exit code of govulncheck is 0 when this flag is provided.
71
-
72
- The -mode flag causes govulncheck to run source or binary analysis. By default,
73
- govulnchecks runs source analysis.
74
-
75
- The -tags flag accepts a comma-separated list of build tags to control which
76
- files should be included in loaded packages for source analysis.
77
-
78
- The -test flag causes govulncheck to include test files in the source analysis.
79
-
80
- The -v flag causes govulncheck to output more information when run on source.
81
- It has no effect when run on a binary.
82
-
83
59
# Limitations
84
60
85
61
Govulncheck has these limitations:
@@ -88,16 +64,13 @@ Govulncheck has these limitations:
88
64
which may result in false positives or inaccurate call stacks in some cases.
89
65
- Calls to functions made using package reflect are not visible to static
90
66
analysis. Vulnerable code reachable only through those calls will not be
91
- reported.
67
+ reported. Use of the unsafe package may result in false negatives.
92
68
- Because Go binaries do not contain detailed call information, govulncheck
93
69
cannot show the call graphs for detected vulnerabilities. It may also
94
70
report false positives for code that is in the binary but unreachable.
95
- - There is no support for silencing vulnerability findings.
71
+ - There is no support for silencing vulnerability findings. See https://go.dev/issue/61211 for
72
+ updates.
96
73
- Govulncheck only reads binaries compiled with Go 1.18 and later.
97
- - Govulncheck only reports vulnerabilities that apply to the current Go
98
- version. For example, a standard library vulnerability that only applies for
99
- Go 1.18 will not be reported if the current Go version is 1.19. See
100
- https://go.dev/issue/54841 for updates to this limitation.
101
74
- For binaries where the symbol information cannot be extracted, govulncheck
102
75
reports vulnerabilities for all modules on which the binary depends.
103
76
0 commit comments