Skip to content
Misconfiguration Write-up Intermediate

x-up-devcap-post-charset Header in ASP.NET to Bypass WAFs Again!

ASP.NET reads a charset value from the x-up-devcap-post-charset header when the User-Agent starts with 'UP', allowing an attacker to specify a non-standard encoding for POST body parameters. This can bypass WAF rules that only inspect the Content-Type header for charset restrictions, enabling encoded payloads to evade detection.

soroush.me

Published on soroush.me

In the past, I showed how the request encoding technique can be abused to bypass web application firewalls (WAFs). The generic WAF solution to stop this technique has been implemented by only allowing whitelisted charset via the Content-Type header or by blocking certain encoding charsets.

The author, on soroush.me

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely ASP.NET's request parsing logic prioritises the x-up-devcap-post-charset header over the Content-Type charset when the User-Agent begins with 'UP', and WAFs do not account for this alternative header.

Impact

This technique could allow attackers to bypass WAF protections that rely on inspecting the Content-Type charset, potentially enabling other attacks such as request validation bypass, though the text does not demonstrate a specific exploit beyond the bypass itself.

What the attacker needed

Target runs ASP.NET; WAF only checks Content-Type charset; attacker can set User-Agent and custom headers

How it was found

  1. Set the User-Agent header to start with 'UP'.
  2. Set the Content-Type header to application/x-www-form-urlencoded without a charset parameter.
  3. Add the x-up-devcap-post-charset header with a non-standard charset such as ibm500.
  4. Send a POST request with parameters encoded in that charset.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A web application firewall (WAF) is a security filter that inspects incoming requests to block attacks. This post shows that ASP.NET, a web framework, can be told to interpret the body of a request using a different character encoding via a special header, as long as the User-Agent starts with 'UP'. Because many WAFs only check the standard Content-Type header for encoding, they may miss this alternative and fail to decode the request correctly, letting malicious input slip through.

What is Misconfiguration?

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.

Similar reports

View all

Same bug class and techniques, clearest first.

Security misconfiguration

The lesson behind this report.

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.