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 }}
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.
is always considering 0 length Untrusted_Source's to be an invalid finding, the actual notice gets filterred out.
There are no unit tests for util/finding.go or integration tests for analyzers/scan.go, so this is missed (since the tests in analyzers/scan.go only test that the returned results contains the expected number of results, not the correct number of "ValidFindings").
Workaround
I found that by adding []util.TaintedCode{{SourceCode: vulnFunc.Instr.Call.Value.String()}} to the result, that gokart prints it. It doesn't feel entirely correct since it's not necessarily "Untrusted Input", but at least it is bringing attention to it (hence the workaround, not actual fix).
New Output
(CWE-326: Inadequate Encryption Strength) Danger: RSA key length is too short, recommend 2048
/tmp/rsa/main.go:9
Vulnerable Function: [ main(...) ]
8: func main() {
> 9: rsa.GenerateKey(rand.Reader, 100)
10: }
:0
Source of Untrusted Input: [ (...) ]
-1:
> 0: crypto/rsa.GenerateKey
1:
------------------------------------------------------------------------------
Race Complete! Analysis took 81.617933ms and 24 Go files were scanned (including imported packages)
GoKart found 1 potentially vulnerable functions
Identified 1 potential CWE-326: Inadequate Encryption Strength
Result
Expected
To Reproduce
Exploration
Since
gokart/analyzers/rsa.go
Line 178 in 4b43e9f
nil
as theuntrusted_source
, andgokart/util/finding.go
Line 54 in a5aab4c
Untrusted_Source
's to be an invalid finding, the actual notice gets filterred out.There are no unit tests for
util/finding.go
or integration tests foranalyzers/scan.go
, so this is missed (since the tests inanalyzers/scan.go
only test that the returned results contains the expected number of results, not the correct number of "ValidFindings").Workaround
I found that by adding
[]util.TaintedCode{{SourceCode: vulnFunc.Instr.Call.Value.String()}}
to the result, that gokart prints it. It doesn't feel entirely correct since it's not necessarily "Untrusted Input", but at least it is bringing attention to it (hence the workaround, not actual fix).New Output
Patch
The text was updated successfully, but these errors were encountered: