mirror of
https://github.com/github/codeql.git
synced 2026-08-04 01:13:00 +02:00
13 lines
242 B
Go
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
|
|
}
|
|
}
|