Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Possible values for X-Requested-With header?

The x-requested-with header is kind of confusing to me. I know it can be used to defend against CSRF attacks, and that it is used to identify Ajax calls...but what is it really?

It just tells you what the request was...requested with?

Could there ever be a reasonable situation in which the header is present but set to some value other than "XMLHttpRequest"? I would imagine so, but I've never seen it set to anything else.

like image 972
ineedahero Avatar asked Oct 15 '25 10:10

ineedahero


1 Answers

Just like the User-Agent header, it is provided by the client and can contain literally anything.

It is not at all reliable for any server-side security check.

like image 75
Narf Avatar answered Oct 17 '25 00:10

Narf