Ashrafiucse dotnet security

From jiayaoqijia/cryptoskill · View interactive version

Ashrafiucse dotnet security is an AI agent skill from the GitHub repository jiayaoqijia/cryptoskill. Audits ASP.NET Core / .NET Framework applications — Razor Html.Raw and Blazor MarkupString XSS, EF Core FromSqlRaw/SqlQueryRaw and Dapper/ADO string-concat SQL injection, BinaryFormatter/ObjectStateFormatter deserialization RCE, hardcoded machineKey → ViewState RCE, XXE via DtdProcessing.Parse, Newt

How to use this skill

Skill file

.NET Security (ASP.NET Core / .NET Framework)

Step 0 — Detect

rg --files -g '*.csproj' -g '*.sln' -g 'packages.lock.json' -g 'packages.config' -g 'web.config' -g 'appsettings*.json' | head -10
rg -n "Microsoft.AspNetCore|System.Web|TargetFramework" -g '*.csproj'

Record: TargetFramework (netcoreapp/net5+ = ASP.NET Core; net4x = Web Forms/MVC5), template engine (Razor .cshtml, Blazor .razor, Web Forms .aspx), data access (EF Core, Dapper, ADO.NET). Check NuGet versions against ../cve-research/vuln-db/entries/.

Step 1 — Config & secrets

rg -n "Password=|password\"|machineKey|validationKey|UseDeveloperExceptionPage" -g 'appsettings*.json' -g '*.config' -g 'launchSettings.json' -g 'Program.cs' -g 'Startup.cs'

Step 2 — Authorization & antiforgery

rg -n "AllowAnonymous|Authorize|ValidateAntiForgeryToken|IgnoreAntiforgery" -g '*.cs'
rg -n "AllowAnyOrigin|AllowCredentials|AddCors" -g '*.cs'

Step 3 — SQL injection

rg -n "FromSqlRaw|SqlQueryRaw|ExecuteSqlRaw|\.Query\(|SqlCommand\(" -g '*.cs'

Step 4 — XSS / templates

rg -n "Html\.Raw|MarkupString|<%=" -g '*.cshtml' -g '*.razor' -g '*.aspx' -g '*.ascx'
rg -n "Mode=\"PassThrough\"|Literal" -g '*.aspx' -g '*.ascx' -g '*.cs'

Census, don't sample: disposition every raw sink with privilege direction (../injection-flaws/SKILL.md XSS table).

Step 5 — Deserialization & XML

rg -n "BinaryFormatter|ObjectStateFormatter|LosFormatter|NetDataContractSerializer|TypeNameHandling" -g '*.cs'
rg -n "DtdProcessing\.Parse|ProhibitDtd\s*=\s*false|XmlResolver" -g '*.cs'

Step 6 — Files, commands, redirects

rg -n "Path\.Combine|PhysicalFile\(" -g '*.cs' | rg -i "request|query|param|route|input"
rg -n "Process\.Start|ProcessStartInfo" -g '*.cs'
rg -n "Redirect\(" -g '*.cs' | rg -i "request|query|param|url"

Reporting

Severity table above; fixes localized (bound params, @ encoding, [Authorize] per-route, AutoGenerate machineKey, JSON over BinaryFormatter). Cross-reference NuGet CVEs via ../cve-research/SKILL.md and dependency reachability via ../dependency-vulns/SKILL.md.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.