How does a CSRF attack work?

* User Authentication : The user logs into a legitimate website and remains authenticated.

* Malicious Website : The attacker creates a malicious website containing a hidden form or an image with an embedded request to the vulnerable website.

* User Interaction : The user visits the malicious website.

* Automatic Request : The user's browser automatically sends the hidden request to the vulnerable website, exploiting the user's existing session.