False positive: "Missing cross-site request forgery token validation" in C# API for endpoint with no cookie/session tokens
- Lingua principale
- CodeQL
- Stelle
- 10.1k
- Fork
- 2.1k
- Merge medio
- 2g 15h
- PR unite (30g)
- 141
Descrizione
**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";
}
```
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia esaminando il commit 5bb31afc834f53d5ea719d782744ff9c7ab70fc0 e l’esempio di C# API in questo issue per capire perché il rilevamento si applica. Individua il punto di ingresso della query e i relativi test esistenti, quindi verifica che gli endpoint server-to-server che usano esclusivamente una API key non vengano segnalati, mentre continuino a esserlo gli endpoint che usano l’autenticazione tramite cookie o token.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- csharp
- Ambito
- api, security
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100