Skip to content
CSRF Write-up Intermediate

@lukejahnke shared an interesting way to still send POST requests without a content type request header

A CSRF protection that rejects requests with a Content-Type header not equal to application/json can be bypassed by sending a POST request with no Content-Type header at all. An attacker can craft a cross-site request using a Blob object without a type, allowing them to send arbitrary data without CORS permission.

nastystereo.com

Published on nastystereo.com

There are many different ways that web applications implement protection against Cross-Site Request Forgery (CSRF) attacks. The protections that are more implicit than explicit are generally riskier, especially when they rely on browsers never adjusting what is permitted.

The author, on nastystereo.com

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 the application only checks that the Content-Type header is not application/json, but does not reject requests where the header is absent entirely.

Impact

An attacker could perform cross-site POST requests with arbitrary body data without needing CORS, bypassing the Content-Type-based CSRF protection.

What the attacker needed

Victim visits attacker's page; browser supports fetch with Blob

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.

Some websites try to stop attackers from making requests on your behalf by only accepting requests that have a specific Content-Type header, like application/json. This article shows that an attacker can use a browser feature to send a request with no Content-Type header at all, slipping past that check. The attacker can then make your browser send data to the site without your knowledge.

What is CSRF?

Another site makes a signed-in user's browser perform an action they did not intend.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site request forgery (CSRF)

The lesson behind this report.

Another site makes a signed-in user's browser perform an action they did not intend.