CSRF is the vulnerability where a website thinks:
“If this request comes from the user’s browser, it must be legit!”
Meanwhile an attacker is sitting behind the screen like:
“Perfect. Let's weaponize that trust.”
Cross-Site Request Forgery (CSRF) forces a victim’s browser to send unwanted, authenticated requests to a website — without the victim realizing it.
Your browser automatically sends cookies. The website automatically trusts them. The attacker automatically smiles.
Let’s say you’re logged into:
You visit a malicious website while still logged in.
The attacker can make your browser auto-submit a hidden request:
<img src="https://bank.com/transfer?to=attacker&amount=5000">
The browser sends your cookies because… that’s what browsers do.
Congratulations, you just “donated” money without clicking anything.
Victim is logged in. Normal request:
POST /change-password
password=newpass123
Attacker hosts a page with this:
<form action="https://website.com/change-password" method="POST">
<input type="hidden" name="password" value="hacked123">
</form>
<script>document.forms[0].submit();</script>
Victim opens attacker’s webpage → browser instantly submits the form.
The victim’s password gets changed to the attacker’s chosen value without the victim doing anything.
Any action that changes something:
If an action is important and the app doesn’t ask for confirmation… assume CSRF is probably possible.
Here’s your one-size-fits-all test:
<img src="https://target.com/sensitive-action?param=value">
Place it in a self-controlled website. If the request succeeds while the victim is logged in → **Vulnerable**.
<form action="https://target.com/update" method="POST">
<input type="hidden" name="email" value="attacker@evil.com">
</form>
<script>document.forms[0].submit();</script>
Add autoplaying JavaScript, hidden iframes, or clickjacking to make the attack even smoother.
If the browser is automatically trusted, an attacker can weaponize it.
A single successful forged request = full CSRF.