github / github/codeql

False positive: CWE-918

オープン
#9,306 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
acknowledged false-positive Go
主要言語
CodeQL
スター
10.1k
フォーク
2.1k
平均マージ
2日 15時間
マージ済み PR(30日)
141

説明

Test case:
```go
package main

import (
"net/http"
"net/url"
)

func testssrf(req *http.Request) {
host := req.URL.Query().Get("host")

u, _ := url.Parse("http://example")

// The current value of u is "http://example"
http.Get(u.String()) // Expected: negative Actual: positive

u.Host = host
http.Get(u.String())
}
```

The following code may have caused the false positives.
codeql-go/ql/src/semmle/go/security/RequestForgery.qll
```ql
override predicate isAdditionalTaintStep(DataFlow::Node pred, DataFlow::Node succ) {
// propagate to a URL when its host is assigned to
exists(Write w, Field f, SsaWithFields v | f.hasQualifiedName("net/url", "URL", "Host") |
w.writesField(v.getAUse(), f, pred) and succ = v.getAUse()
)
}
```

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。