Open ankushgoel27 opened 3 weeks ago
The issue is that there's no check json.Unmarshal
succeeded. Just because err == nil
doesn't mean unmarshalling was successful; if you provide it garbage data, the unmarshaller happily returns an empty struct :).
Hence why [:3]
is out of range:
https://github.com/trufflesecurity/trufflehog/blob/e81ff7630cc44f9ceefda31cb7659343961c51ff/pkg/detectors/gcpapplicationdefaultcredentials/gcpapplicationdefaultcredentials.go#L83
Fixed by #3535.
Please review the Community Note before submitting
TruffleHog Version
Dev
Trace Output
To obtain the trace output, run trufflehog with the --trace flag. --->
Expected Behavior
should cause a panic error
Actual Behavior
caused error while verifying GCP credentials
Steps to Reproduce
Environment
Ubuntu latest
Additional Context
References
0000