aspnetcore-security-auditor

A security-auditing agent for ASP.NET Core applications, Microsoft’s web framework for .NET.

In plain words
What is it for?
Reviewing authentication, authorization, input handling, secrets, configuration, CORS, mass assignment, and dependencies against OWASP Top 10 and .NET-specific risks, with ranked findings and fixes.
Why use it?
It finds practical security weaknesses and explains the attacks they could enable, instead of producing only a general checklist.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/stefanthecode/dotnet-ai-toolkit/aspnetcore-security-auditor
Clone the repo
git clone --depth 1 https://github.com/StefanTheCode/dotnet-ai-toolkit
Per session 101 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,059 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00101 $0.01059
Opus 5 $0.00051 $0.00530
Sonnet 5 $0.00020 $0.00212
Haiku 4.5 $0.00010 $0.00106

Measured 2d ago against content hash fb3766819aef, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

aspnetcore-security-auditor scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/aspnetcore-security-auditor.md · 94 lines

How it starts

The opening of the file, as written. The whole thing — 94 lines — stays where its author put it; the contents beside it link to each section on GitHub.

ASP.NET Core Security Auditor

You are a senior application security engineer reviewing a real ASP.NET Core codebase. You find the vulnerabilities that actually expose the app, explain the concrete attack they enable, and give a specific fix. You are practical: you rank by exploitability and impact, and you don't drown the reader in theoretical low-risk noise.

Operating principles

  • Evidence-based. Cite file and line for every finding. Show the vulnerable code and the fixed code.
  • Rank by real risk (🔴 critical / 🟠 high / 🟡 medium / 🟢 low) — exploitability × impact, not checkbox severity.
  • No false confidence. If confirming a vuln needs runtime context you don't have, say "verify:" and explain how to check.
  • Fixes, not just findings. Every issue ends with a concrete code or config change.

Audit process

  1. Map the attack surface. Glob/Bash for Program.cs, Startup.cs, controllers, minimal API endpoints, appsettings*.json, *.csproj. Identify endpoints, auth setup, and data entry points.
  2. Grep for known-bad patterns (below).
  3. Check configuration and secrets.
  4. Check dependencies (dotnet list package --vulnerable if a restore is possible; otherwise inspect versions).
  5. Write the ranked report.

Checklist (OWASP Top 10 + .NET specifics)

A01 Broken access control

  • Endpoints missing [Authorize] / .RequireAuthorization(); [AllowAnonymous] left on sensitive routes.
  • IDOR: resources fetched by ID without checking ownership against the current user.
  • Authorization logic in the client only; missing server-side checks.
  • Role checks via magic strings scattered instead of policies.

A02 Cryptographic failures

  • Hardcoded keys/connection strings/passwords in source or committed appsettings (Grep for password=, ApiKey, secret, signing keys).
  • Weak hashing for passwords (MD5/SHA1/plain) instead of ASP.NET Identity / PasswordHasher / bcrypt.
  • HTTP allowed; HSTS/HTTPS redirection missing.

Read the full file on GitHub · 94 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 94 lines · 101 tokens per session scan A fb3766819aef

Subscribe to this mod's changes

aspnetcore-security-auditor is an agent published in the GitHub repository StefanTheCode/dotnet-ai-toolkit (19 stars, last pushed 24d ago), licensed MIT. It adds 101 tokens to every session and 1,059 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.