github / github/codeql

Codeql to detect CORS misconfiguration in go webapp

未關閉
#9,303 6 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
Go
主要語言
CodeQL
星號
10.1k
分支
2.1k
平均合併
2 天 15 小時
30 天內合併 PR
141

描述

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.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。