Agora logo
Welcome to Agora!
 → 

There is a flaw in the forum !! (CSRF)



«  [1]  »
VignacSecond
Quote from: Wikipedia
Cross-site request forgery, also known as one-click attack or session riding and abbreviated as CSRF (sometimes pronounced sea-surf[1]) or XSRF, is a type of malicious exploit of a website where unauthorized commands are submitted from a user that the web application trusts.[2] There are many ways in which a malicious website can transmit such commands; specially-crafted image tags, hidden forms, and JavaScript XMLHttpRequests, for example, can all work without the user's interaction or even knowledge. Unlike cross-site scripting (XSS), which exploits the trust a user has for a particular site, CSRF exploits the trust that a site has in a user's browser.

In a CSRF attack, an innocent end user is tricked by an attacker into submitting a web request that they did not intend. This may cause actions to be performed on the website that can include inadvertent client or server data leakage, change of session state, or manipulation of an end user's account.


Example with Agora : [img]https://agora.evalyn.app/?action=promote&id=1527[/img]


How to solve it :
-You have to add
Code
if(isSet($_GET['as'])) if($_SESSION['actionSecret'] == $_GET['as'])
everywhere.
-Possibly a longer token, otherwise it would be "easy" to "bruteforce" by generating
VignacSecond
Pecon
Administrator
Thanks for pointing this out. I had intended to do this to all the action links back when I added that to the logout function like you noticed, but I forgot to actually do it :V
VignacSecond
Okay :)
«  [1]  »