github / github/codeql

False positive: "Missing cross-site request forgery token validation" in C# API for endpoint with no cookie/session tokens

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

説明

**Description of the false positive**

We are using a .NET 10 Api and since commit https://github.com/github/codeql/commit/5bb31afc834f53d5ea719d782744ff9c7ab70fc2 we get a false positive on a server -> server endpoint where we have a ApiKey in the header with no tokens or cookies.

Is it possible to extend the check to look if cookie/token authentication is used instead of a ApiKey?

**Code samples or links to source code**

```
public class Controller()
{

[HttpPost()]
public string Execute()
{
return "test";
}

```

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

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

調査の方向性

まず、コミット 5bb31afc834f53d5ea719d782744ff9c7ab70fc0 とこの issue の C# API の例を確認し、なぜこの検出結果が適用されるのかを理解します。クエリのエントリポイントと既存のテストを特定し、API キーのみを使用する server-to-server エンドポイントは検出対象にならない一方で、cookie または token 認証を使用するエンドポイントは引き続き検出対象になることを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
csharp
領域
api, security
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

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

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