HAXcms Node.js Backend Private Key Disclosure via Broken HMAC Implementation
The HAXcms Node.js backend contains two cryptographic implementation errors in the `hmacBase64()` function that allow an unauthenticated attacker to extract the system’s private signing key and forge arbitrary admin-level JSON Web Tokens (JWTs) allowing them to get full admin access with a single HTTP request.
The hmacBase64() function in the HAXcms Node.js backend contains two critical cryptographic implementation errors. First, the function passes the literal string “0” as the HMAC signing key instead of the intended key parameter, resulting in identical HMACs across all HAXcms instances for the same input. Second, after computing the HMAC, the function concatenates the actual signing secret (this.privateKey + this.salt) directly onto the output. This design flaw allows any unauthenticated attacker to extract the system’s private signing key, forge arbitrary admin-level JSON Web Tokens (JWTs), and gain full admin access with a single HTTP request. The vulnerability affects @haxtheweb/haxcms-nodejs versions 25.0.0 and earlier. This vulnerability is tracked as CVE-2026-46395.
Attack Chain
- The attacker sends an unauthenticated GET request to the
/system/api/connectionSettingsendpoint. - The server responds with JSON data containing multiple tokens generated by the flawed
hmacBase64()function. - The attacker extracts one of these tokens from the response.
- The attacker base64-decodes the token.
- The attacker discards the first 32 bytes of the decoded token (the HMAC).
- The attacker reads the remaining bytes as a UTF-8 string, which contains the
privateKey+saltsecret. - The attacker uses the extracted
privateKey+saltto forge a JWT with admin privileges usingJWT.sign(payload, this.privateKey+this.salt). The forged JWT contains a payload specifyingid,user(set to “admin”),iat(current timestamp), andexp(expiration timestamp). - The attacker uses the forged JWT to access authenticated endpoints, performing actions such as creating, modifying, or deleting sites, and uploading files.
Impact
Successful exploitation allows an unauthenticated attacker to gain full administrative control over a HAXcms instance. The attacker can create, modify, or delete sites, upload arbitrary files, and modify content without any login events being recorded. This attack bypasses any strong passwords set by the administrator. The vulnerability affects @haxtheweb/haxcms-nodejs versions 25.0.0 and earlier.
Recommendation
- Deploy the Sigma rule to detect requests to the
/system/api/connectionSettingsendpoint as an early warning of exploitation attempts. - Apply patches or updates provided by HAXtheWeb for
@haxtheweb/haxcms-nodejsto address CVE-2026-46395. - Monitor web server logs for abnormally long tokens which can indicate exploitation, correlate with the
HAXcms Node.js Token Length AnomalySigma rule.
Detection coverage 2
HAXcms Node.js Connection Settings Access
mediumDetects access to the `/system/api/connectionSettings` endpoint, which exposes the private key due to CVE-2026-46395.
HAXcms Node.js Token Length Anomaly
highDetects abnormally long tokens generated by the vulnerable Node.js backend, indicative of private key exposure due to CVE-2026-46395.
Detection queries are available on the platform. Get full rules →