The vulnerability lies in the HAX CMS API endpoints, which fail to perform authorization checks before executing operations on resources. This affects both the Node.js and PHP versions of the CMS. While the API checks for user authentication (i.e., if a user is logged in), it does not verify if the authenticated user has the necessary permissions to perform the requested action on a specific resource (e.g., a site or a node). This allows any authenticated user to perform actions on any site or node within the CMS, even those belonging to other users.
The analysis of the provided patch for the Node.js version (@haxtheweb/haxcms-nodejs) confirms this. The patch consistently adds authorization checks using HAXCMS.validateRequestToken to various API route handlers. For example, in src/routes/deleteNode.js, the patch adds a condition to check for a valid site_token before allowing the deletion of a node. The vulnerable functions are the route handlers in the src/routes directory that were modified to include these checks.
Similarly, the vulnerability description explicitly lists several methods within the Operations.php file of the PHP version (elmsln/haxcms) as being affected. These methods, such as createNode(), deleteNode(), and cloneSite(), lack the necessary authorization logic, making them vulnerable.
An attacker can exploit this vulnerability by authenticating to the application and then sending API requests with the identifiers of other users' sites or nodes. This can lead to unauthorized enumeration, modification, or deletion of content, and in the case of the getConfig or getUserData endpoints, the potential leakage of sensitive configuration data.