Files
codeql/go/ql/test/experimental/CWE-840/ConditionalBypassBad.go
2026-06-11 07:15:54 +02:00

13 lines
242 B
Go

package main
import (
"net/http"
)
func exampleHandlerBad(w http.ResponseWriter, r *http.Request) {
// BAD: the Origin and Host headers are user controlled
if r.Header.Get("Origin") != "http://"+r.Host { // $ Alert
//do something
}
}