github / github/codeql

Codeql to detect CORS misconfiguration in go webapp

Aperta
#9,303 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Go
Lingua principale
CodeQL
Stelle
10.1k
Fork
2.1k
Merge medio
2g 15h
PR unite (30g)
141

Descrizione

Here is how a sample go code vulnerable to CORS misconfiguration looks like

```
import(
"github.com/go-chi/cors"
)

var corsOpts = cors.Options{
AllowedOrigins: []string{"*"},
AllowCredentials: true
}
```

It does not validate the origin header and allows authenticated cross-origin requests. I was testing codeql on a popular GitHub repo and unfortunately, it was not able to detect it using lgtm.com website. So I thought this query can be added to codeql for detecting this kind of bugs.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.