Incorrect Authorization Checks in /include/findusers.php
The findusers.php script was meant to be admin-only, but an unauthenticated user could bypass the check by supplying a valid security token obtained from a public page. This allowed searching registered users and disclosing usernames and real names.
- Triaged in 11 days
- Fixed in 13 months
- Disclosed after 14 months
Summary:
The vulnerability is located in the /include/findusers.php script:
16. include "../mainfile.php";
17. xoops_header(false);
18.
19. $denied = true;
20. if (!empty($_REQUEST['token'])) {
21. if (icms::$security->validateToken($_REQUEST['token'], false)) {
22. $denied = false;
23. }
24. } elseif (is_object(icms::$user) && icms::$user->isAdmin()) {
25. $denied = false;
26. }
27. if ($denied) {
28. icms_core_Message::error(_NOPERM);
29. exit();
30. }
As far as I can see, I believe this script should be accessible by admin users only (due to line 24). However, because of the if statements at lines 20-23, this script could be accessed by unauthenticated attackers if they will provide a valid security token. Such a token will be generated in several places within the application (just search for the string icms::$security->getTokenHTML()), and some of them do not require the user to be authenticated, like in misc.php at line 181.
ImpressCMS branch :
The vulnerability has been tested and confirmed on ImpressCMS version 1.4.2 (the latest at the time of writing).
Steps To Reproduce:
- Try to access the
/include/findusers.phpscript without being logged into the application - You will see an error message saying "Sorry, you don't have permission to access this area."
- Go to
/misc.php?action=showpopups&type=friendand look at the HTML source code, search the stringXOOPS_TOKEN_REQUESTand copy the value of the token - Go to
/include/findusers.php?token=[TOKEN_VALUE]and you will be able to access the script and e.g. search through the registered users
Impact
This vulnerability might allow unauthenticated attackers to access an otherwise restricted functionality of the application, which in turn might allow an information disclosure about the CMS users (specifically, only the username and real name will be disclosed).
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The authorisation check treated a valid security token as sufficient proof of admin rights, instead of also requiring the user to be an administrator.
Impact
Unauthenticated attackers could access a restricted user-search feature and disclose usernames and real names of registered users.
What the attacker needed
No account needed; a valid token from a public page
How it was found
- Visit the findusers script while logged out and observe the permission error.
- Open the friend popup page and read the token value from the page source.
- Request the findusers script with that token appended and search registered users.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A security token is a random value the site gives out to prove a request came from its own pages. The script that lists users was supposed to be for administrators only, but it also accepted any request that carried a valid token, and tokens were handed out on public pages. So anyone could get a token and then use the user-search feature without logging in.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.