Join our Newsletter — 33% off our NHI Course
Home› Glossary› Cyber Security› ASP.NET Core Request Decompression
Cyber Security

ASP.NET Core Request Decompression

← Back to Glossary
By NHI Mgmt Group Updated November 16, 2026 Domain: Cyber Security

ASP.NET Core Request Decompression is middleware that decompresses incoming HTTP request bodies before the application reads them. It supports compressed request content such as gzip and is used when servers need to accept compressed uploads or API payloads. The control can increase parsing workload if compression is allowed from untrusted clients.

What request decompression does

Request decompression is an HTTP middleware concern, not a feature of the application’s business logic. It accepts compressed request bodies, expands them before parsing, and lets the rest of the stack treat the payload as if it arrived uncompressed. That can reduce bandwidth and client-side upload cost, but it also changes where size, CPU, and parsing risk are handled.

Because decompression happens before the application sees the body, the middleware effectively becomes part of the trust boundary. If compressed input is accepted from untrusted clients, the server must assume the decompressed body may be much larger, more complex, or more expensive to process than the wire payload suggests.

Why compressed uploads can be useful

Compressed request bodies are most useful when clients send large JSON documents, batch jobs, telemetry, or file-like payloads over constrained links. The server receives fewer bytes on the network, while the application still works with the original logical content after decompression. That can improve throughput and reduce transfer overhead when both sides deliberately support it.

The trade-off is that compression moves work from the network layer into server-side CPU and memory use. If the application depends on predictable request costs, request decompression should be treated as an enabled capability that needs explicit governance, not as a harmless convenience setting.

How decompression changes attack surface

Any feature that expands untrusted input can amplify resource consumption. A small compressed body can decompress into a much larger payload, which may increase parsing time, memory pressure, logging volume, or downstream validation cost. That makes request decompression relevant to availability, especially when the endpoint accepts many concurrent uploads or does further expensive work on the expanded body.

It can also interact badly with parser behavior and request limits. If the decompressed body is allowed to exceed the practical limits of the endpoint, the application may spend significant resources before rejecting it. In shared hosting or API environments, that can affect neighboring workloads as well as the target service.

Where to control and validate it

Use request decompression only on endpoints that genuinely need it, and treat acceptance as an application contract rather than a default. Limit which content encodings are accepted, enforce request size limits after decompression, and ensure the endpoint still validates schema, media type, and business rules on the expanded body. The safest operational pattern is to keep decompression as narrow as possible and pair it with explicit body limits and timeouts.

For .NET-specific hardening, see the .NET Security Guide for related platform controls, the Secure File Upload Handling Guide for layered size and validation limits, and the IIS Hardening Guide for request filtering and server-side baseline controls. For the underlying control model around resource exhaustion, review NIST Cybersecurity Framework 2.0 and the OWASP API Security Top 10, which both reinforce limiting abuse paths that consume service resources.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP API Security Top 10 addresses the attack and risk surface, while CIS Controls v8 and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
CIS Controls v8CIS-5 — Account ManagementRequest decompression should be limited by endpoint and access context.
Recommendation — Restrict decompression to approved services and endpoints that truly need compressed uploads.
NIST CSF 2.0PR.DS-10 — Data in Transit is ProtectedCompressed request bodies are a transport-format choice that affects protected inbound data handling.
Recommendation — Apply inbound request handling controls so compressed data is accepted only where necessary and safely processed.
OWASP API Security Top 10API4 — Unrestricted Resource ConsumptionDecompression can magnify CPU, memory, and parsing cost for a small wire payload.
Recommendation — Bound decompressed request size and processing time to prevent resource-exhaustion abuse.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on November 16, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org