On-Site Request Forgery (OSRF)
Introduction
On-Site Request Forgery (OSRF) is an attack that forces an end user to execute unwanted actions on a web application in which they're currently authenticated. The difference between CSRF is a vulnerability where an attacker initiates requests from domain under their control to perform actions on behalf of victim. However, in OSRF, requests originate from vulnerable application itself and we control where our requests go.
Where to find
You can detect On-Site Request Forgery (OSRF) everywhere but there are 2 things that need to be looked up.
Finding reflected input in
src
attribute. For example:There is a sensitive endpoint that using the GET method
How to exploit
Imagine there is functionality in the website where the user can change their password. Here is the request
And then there is another functionality where we can control the value inside the src
attribute, for example we can change our photo profile
And if we check our public profile page, our input is reflected in the src
attribute
To exploit the website using this vulnerability, we need to change the filename from testingimage.jpg
to change_password.php?new_password=Testing123
. So, the result is
If another user visits our profile page, their password will automatically be changed to Testing123
References:
Last updated