Possible insecure use of logger because of tainted, untrusted, or sensitive arguments passed to the logger. Logging invalidated user input can allow an attacker to forge log entries or inject malicious content into the logs.
Recommended secure logging practices:
func foo() {
// input() returns user defined data
sensitiveData := input()
// If unsafe contains characters like '\r', '\n', etc. then it might break the log pattern
// Manual auditing is required
log.Println(sensitiveData )
}
func ExposeSensitiveInfo(url string) error {
resp, err := http.Get(url)
if err != nil {
return err
}
// Logging "resp" could leak some sensitive information
log.Println(resp)
return nil
}