Content Type Tampering

Content-Type Tampering is a vulnerability where an attacker manipulates the Content-Type header of HTTP requests to bypass security checks or exploit vulnerabilities.

JSON to XML

We can check the behaviour on different Content-Type formats. This could result in:

  • Triggering verbose erros.

  • Bypass flawed defences.

  • Leverage differences in processing logic (e.g. secure with JSON but flawed with XML).

We can easily do that using Burp's Content Type Converter extension (Figure 1).

The below example is based on the crAPI application.

Figure 1: Converting JSON to XML.

Adding Content-Type in the Request

Try adding Content-Type: application/json in the request and send a blank body. This might return a stack trace!

Last updated

Was this helpful?