is putting token in URL secure to prevent CSRF attacks in PHP applications? -


i want use token prevent csrf attacks on website (written php). i've used in forms , works well. logout link not form; hyperlink.
secure if put token in query string this:

<a href="logout.php?token=9ae328eea8a72172a2426131a6a41adb">logout</a> 

if has problem, suggestions , solutions ?

i think 1 of main disadvantages of using csrf-token in requests possibility of incompetent user disclose token copying link token , paste in public content comment/post/etc... query parameters including csrf-tokens logged http servers/proxies , introduces risk.

so suggest implement csrf-secure links using this:

<form name="logout" action="logout.php" method="post"> <input type="hidden" name="token" value="9ae328eea8a72172a2426131a6a41adb"/> </form> ... <a href="/nojs.html" onclick="document.logout.submit(); return false">logout</a> 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -