Skip to main content

Introduction

Owasp.Analyzers is a collection of Roslyn diagnostic analyzers that surface OWASP Top 10 2021 security vulnerabilities as compiler warnings and errors in your C#/.NET projects.

How it works

Roslyn analyzers run inside the compiler pipeline — no external tools, no CI-only scans. Every build checks your code against the rules. Violations appear inline in your IDE (Visual Studio, Rider, VS Code) and as dotnet build output, exactly like ordinary compiler warnings.

warning OWASPA01001: Action 'GetProfile' is not decorated with [Authorize] or [AllowAnonymous]
error OWASPA03001: User-controlled data flows into SQL command without parameterization

Coverage

CategoryRulesTechnique
A01 Broken Access Control5Syntax / Semantic
A02 Cryptographic Failures8Syntax / Semantic
A03 Injection6Taint analysis
A04 Insecure Design1Syntax
A05 Security Misconfiguration6Syntax
A06 Vulnerable Components2MSBuild target
A07 Authentication Failures5Semantic
A08 Data Integrity Failures4Semantic
A09 Logging Failures4Syntax / Taint
A10 SSRF3Taint analysis

What's next?