I'm trying to do some csrf attack test on a site.
I found that the site protect itself from csrf by checking the http Origin header.
But I guess maybe under some conditions I can bypass the protection. The website just check if the request has the Origin: header set to https://example.com -
Is it possible to set a custom Origin header in the browser using some php code?
I was thinking to use something like this:
<?php header('Origin: https://example.com'); ?> +csrf-codeHow can i spoof the origin header myself or convince victim browser to do that?
The server checks the
– apex Apr 03 '20 at 01:42Origin:header and if it's notexample.comthrows a 500 error message while if it's set tohttps://example.comthe csrf works fine.