Files
codeql/go/ql/test/experimental/CWE-840/ConditionalBypassBad.go
2022-05-20 10:07:19 -07:00

13 lines
231 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 {
//do something
}
}