hunting-dotnet-deserialization-type-injection

hunting-dotnet-deserialization-type-injection is a skill for Claude Code from UnboundCompute/security-agent-skills. It costs 162 tokens per session (1,932 once invoked), scanned A, original, MIT.

A security review guide for finding unsafe .NET deserialization, where data tells a serializer which object type to create. Deserialization converts stored or received data back into program objects.

In plain words
What is it for?
Use it to review BinaryFormatter, SoapFormatter, NetDataContractSerializer, ViewState formatters, and JSON serializers with type-name handling for untrusted input.
Why use it?
It identifies cases where attacker-controlled data can cause a dangerous class to be created and trigger file operations, process launches, or other side effects.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the security-agent-skills plugin — 194 skills shipped together

Good fit Use it to review BinaryFormatter, SoapFormatter, NetDataContractSerializer, ViewState formatters, and JSON serializers with type-name handling for untrusted input.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/unboundcompute/security-agent-skills/hunting-dotnet-deserialization-type-injection
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.

Any agent
npx skills add UnboundCompute/security-agent-skills --skill hunting-dotnet-deserialization-type-injection
Clone the repo
git clone --depth 1 https://github.com/UnboundCompute/security-agent-skills

Made for: Claude Code.

Or install security-agent-skills, the plugin that ships this one along with the rest of its 194 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for hunting-dotnet-deserialization-type-injection

README.md
[![agentmods](https://agentmods.dev/badge/skills/unboundcompute/security-agent-skills/hunting-dotnet-deserialization-type-injection/github.svg)](https://agentmods.dev/skills/unboundcompute/security-agent-skills/hunting-dotnet-deserialization-type-injection)
Your own site
<a href="https://agentmods.dev/skills/unboundcompute/security-agent-skills/hunting-dotnet-deserialization-type-injection"><img src="https://agentmods.dev/badge/skills/unboundcompute/security-agent-skills/hunting-dotnet-deserialization-type-injection/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for hunting-dotnet-deserialization-type-injection

Your own site · 80×15
<a href="https://agentmods.dev/skills/unboundcompute/security-agent-skills/hunting-dotnet-deserialization-type-injection"><img src="https://agentmods.dev/badge/skills/unboundcompute/security-agent-skills/hunting-dotnet-deserialization-type-injection.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 162 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,932 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00162 $0.01932
Opus 5.5 $0.00065 $0.00773
Sonnet 5.5 $0.00032 $0.00386
Haiku 4.5 $0.00016 $0.00193

Measured 1mo ago against content hash 01ccaff34cf1, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

hunting-dotnet-deserialization-type-injection 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 1mo 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.

skills/hunting-dotnet-deserialization-type-injection/SKILL.md · 131 lines

How it starts

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

Hunting .NET deserialization and type injection: when the payload picks the type

.NET deserialization is dangerous for a specific reason: several formatters read the concrete type to instantiate from the serialized data, not from the declared target. When BinaryFormatter, SoapFormatter, NetDataContractSerializer, the ViewState formatters, or a JSON serializer with type-name handling turned on processes attacker data, the attacker chooses which class gets constructed. That lets them instantiate a gadget type whose property setters, deserialization callbacks, or type converters perform a side effect, chaining to a process start, a command, or a file operation. The fix is almost always to stop resolving types from the data. You find these by locating every formatter that honors an embedded or annotated type and asking whether untrusted bytes reach it.

When to use

  • A service reads serialized .NET objects from a request, ViewState, a cookie, a queue, or a cache.
  • A formatter in use resolves the type from the payload or has type-name handling enabled.
  • Reachable assemblies carry a gadget type whose construction or callback has an exploitable side effect.

Scope check

Test deserialization only against services you own or are authorized to assess, on non-production infrastructure. A confirming payload constructs an attacker-chosen type and can run code, so treat every proof as a live intrusion inside the authorized scope. If you can't name the authorization, stop.

The loop

  1. Establish the type-resolving sinks first. Inventory every formatter that reads the type from the data: BinaryFormatter, SoapFormatter, NetDataContractSerializer, LosFormatter and ObjectStateFormatter behind ViewState, and any JSON or XML serializer configured with type-name handling or a permissive binder. This is the false-positive killer: a formatter that deserializes to a fixed known type with no type resolution is not injectable. Name the resolving sinks first.

Read the full file on GitHub · 131 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. 1mo ago First seen · 131 lines · 162 tokens per session scan A 01ccaff34cf1

Subscribe to this mod's changes

hunting-dotnet-deserialization-type-injection is a skill published in the GitHub repository UnboundCompute/security-agent-skills (5 stars, last pushed 1mo ago), licensed MIT. It adds 162 tokens to every session and 1,932 once invoked, about $0.0006 per session on Opus 5.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-09-05.

Related

Other skills, from other repositories

prodcheck-review

Review this codebase against the prodcheck pre-production checklists — security, performance, scale, integrations, post-launch readiness and people. Use when asked to check whether a project is ready to ship, to audit an area before launch, or to work through a specific checklist. Produces evidence with file:line…

FarzamHabibi/pre-production-checklist · 72 tokens

swiftui-expert-skill

Write, review, or improve SwiftUI code following best practices for state management, view composition, performance, macOS-specific APIs, and iOS 26+ Liquid Glass adoption. Use when building new SwiftUI features, refactoring existing views, reviewing code quality, or adopting modern SwiftUI patterns.

Agent-Threat-Rule/agent-threat-rules · 67 tokens

template-validation

Validates custom dotnet new templates for correctness before publishing. Catches missing fields, parameter bugs, shortName conflicts, constraint issues, and common authoring mistakes that cause templates to fail silently. USE FOR: checking template.json files for errors before publishing or testing, diagnosing why a…

dotnet/skills · 131 tokens

template-comparison

Compares two or more dotnet new templates side by side to help users choose between them based on parameters, feature support, frameworks, and classifications. USE FOR: deciding between similar templates (webapi vs webapp, blazor vs blazorwasm, console vs worker), producing a side-by-side comparison of parameters and…

dotnet/skills · 123 tokens

agents-sdk-dotnet-otel

Use when adding, configuring, validating, or troubleshooting OpenTelemetry observability for a Microsoft 365 Agents SDK application in C# / .NET. Trigger when the user mentions OpenTelemetry, OTel, telemetry, traces, metrics, logs, OTLP, Aspire Dashboard, Application Insights, Azure Monitor, distributed tracing…

microsoft/Agents · 86 tokens

opentelemetry-net-instrumentation

Provides guidance for implementing OpenTelemetry instrumentation in .NET codebases, covering tracing (Activities/Spans), metrics, logs, naming conventions, error handling, performance, SDK setup, resources, context propagation, and API design best practices.

Aaronontheweb/dotnet-skills · 56 tokens