ldleman / dropcenter

43 stars 4 forks source link

XSS + privilege escalation #41

Closed leblanc-simon closed 11 years ago

leblanc-simon commented 11 years ago

saveSettings isn't protected. Anyone who know a username can change the password and promote the user to admin.

with the last commit, you protect the available usernames.

But there is an XSS and if the cracker send a malicious URL to an legitimate user, you can change the password and the role of this user

See this gist to see the exploit for all versions of dropcenter

ldleman commented 11 years ago

Ooops :) big fail !! Corrected in the latest revision thank you for the information.

leblanc-simon commented 11 years ago

Your commit resolve the problem with the include php script with the img tag, but the XSS is always here and if you change the XSS to add an ajax query for replace the cURL call, you can change the current user and promote it at admin (because the query will be call with the user rights) :

ldleman commented 11 years ago

I dont have understand everything but the topic 2 should be corrected with the lastest commit.

leblanc-simon commented 11 years ago

XSS :

You must safe your datas before to print its to prevent XSS You should protect your session : http://stackoverflow.com/questions/328/php-session-security

Token :

ldleman commented 11 years ago

Ok, i'v secured error variable and added a token for the most sensible forms (add user form and settings forms) thanks for the advices