github / github/codeql

False positive: "Missing function level access control" where public endpoint name contains "Edit"

Ouverte
#21,042 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
C# false-positive
Langage dominant
CodeQL
Étoiles
10.1k
Forks
2.1k
Merge moyen
2 j 15 h
PR mergées (30 j)
141

Description

**Description of the false positive**

We have a .NET 8 Api.

We have a controller method that has the characters 'Edit' in it, but the whole word is not Edit. This causes the method to be marked with the rule cs/web/missing-function-level-access-control. The method even has the 'AllowAnonymous' attribute on it.

**Code samples or links to source code**

```
[AllowAnonymous]
public async Task TestEditionAsync(){

}
```

Is there a way to get this alert resolved?

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Start with the CodeQL rule cs/web/missing-function-level-access-control and reproduce the report using the provided .NET 8 controller example. The issue is resolved when a public method named TestEditionAsync with AllowAnonymous is no longer flagged solely because its name contains Edit.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
csharp
Domaine
security
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.