Audits .NET application trust boundaries, authentication/authorization, untrusted input, secrets, injection, serialization, transport, and deployment security. Use for security-specific threat or code assessment; do not use for routine API design or generic code review (use api-contract-review or dotnet-code-review).
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Security Audit?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/k4ndev-security-audit)
---
name: security-audit
description: Audits .NET application trust boundaries, authentication/authorization, untrusted input, secrets, injection, serialization, transport, and deployment security. Use for security-specific threat or code assessment; do not use for routine API design or generic code review (use api-contract-review or dotnet-code-review).
---
# Security Audit
## Purpose
Identify plausible, code-supported security weaknesses and recommend proportionate mitigations without exposing secrets or taking production action.
## Scope
Authentication/token validation, authorization, input-to-sink flows, secrets/PII, SSRF, file handling, serialization, TLS, headers, rate limiting, diagnostics, and dependency/deployment risks.
## When to use
- User asks for a security audit, threat assessment, vulnerability analysis, or secure implementation.
- A concrete code path processes untrusted input, identity, sensitive data, or privileged operations.
## Do not use for
- General endpoint status/versioning review: use `api-contract-review`.
- Full code review across all guideline families: use `dotnet-code-review` and coordinate security findings without duplication.
- Exploit execution, credential rotation, or production configuration changes without explicit authorization.
## Required context
Map assets, attacker-controlled inputs, trust boundaries, identities/roles, deployment exposure, data sensitivity, framework versions, auth configuration, and relevant call chain. Do not assume omitted controls exist or are absent.
## Workflow
1. State the in-scope component, trust boundary, and assumptions; prioritize externally reachable paths and sensitive assets.
2. Trace user-controlled values to SQL, file paths, process arguments, URLs, templates, regular expressions, and deserializers.
3. Verify identity authentication and object/resource authorization on the server; inspect JWT issuer/audience/signature/lifetime validation where applicable.
4. Search for credentials/PII in code, configuration, logs, tests, fixtures, and container layers; redact any discovered secret in output.
5. Check SSRF/redirects, upload size/type/path, unsafe deserialization, TLS validation, CORS vs authorization, security headers, rate limits, production diagnostics, and dependency advisories as relevant.
6. Separate confirmed source evidence from conditions requiring runtime/deployment confirmation. Do not execute exploit payloads against live systems.
7. Give a minimal mitigation and a regression test that proves the boundary is enforced.
## Decision rules
- Report only an exploitable or meaningful risk with a plausible attacker path and impact; label uncertainty and prerequisites.
- Never call a vulnerability “confirmed” unless code flow and conditions support it.
- Client-side checks and CORS are not authorization. Do not reproduce secret material.
- Avoid exposing stack traces/secrets in examples; do not rotate credentials or alter production controls unless asked.
## Severity classification
Use the project's severity system if present. Otherwise classify as Critical/High/Medium/Low based on exploitability, reachable exposure, required privileges, data impact, and blast radius; state assumptions and do not imply a formal CVSS score.
## Expected output format
For each issue: title/severity, affected location, attacker-controlled input and trust boundary, preconditions, impact, confidence, minimal mitigation, and regression test. Summarize coverage and explicitly list excluded/unverified deployment areas.
## Common mistakes
- Treating CORS as access control, reporting a dangerous API without a reachable data flow, printing secrets, confusing a scanner alert with a confirmed exploit, or claiming TLS/security guarantees without configuration evidence.
## Edge cases
- Authorization may require resource-level checks after loading data; role authorization alone may not enforce ownership.
- SSRF controls must consider redirects, DNS/IP resolution, schemes, and internal address ranges; allowlists need a defined normalization policy.
- Test credentials/PII and generated configuration may leak through logs or image layers even if source code appears clean.
## Examples
See [security examples](examples.md) for resource authorization and parameterized SQL.
## Test scenarios
- Positive: “Audit whether a user can fetch another tenant's invoice by changing the route ID.”
- Negative: “Make the JSON response field nullable for compatibility” routes to `api-contract-review`.
- Boundary: a code review focused on an IDOR activates this skill and `dotnet-code-review`; findings should appear once.
## Related skills
`dotnet-code-review`, `api-contract-review`, `aspnetcore-patterns`, `minimal-api-patterns`, `dependency-audit`, `logging-observability`.