False positive: "Missing cross-site request forgery token validation" in C# API for endpoint with no cookie/session tokens
- 主要语言
- CodeQL
- 星标
- 10.1k
- 派生
- 2.1k
- 平均合并
- 2 天 15 小时
- 30 天内合并 PR
- 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";
}
```
贡献指南
调研方向
Start by reviewing commit 5bb31afc834f53d5ea719d782744ff9c7ab70fc0 and the C# API example in this issue to understand why the finding applies. Locate the query entry point and its existing tests, then verify that API-key-only server-to-server endpoints are not flagged while endpoints using cookie or token authentication still are.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- csharp
- 领域
- api, security
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100