🇰🇷 한글 설명
HAXcms Node.js 백엔드의 `hmacBase64()` 함수는 HMAC 서명 키로 리터럴 '0'을 사용하고 실제 비밀 키를 해시 결과에 직접 포함하는 심각한 암호학적 결함을 지닙니다. 이로 인해 비인증 공격자는 `/system/api/connectionSettings` 엔드포인트를 통해 단일 HTTP 요청으로 시스템의 개인 서명 키를 추출하고 임의의 관리자 JWT를 위조할 수 있습니다.
💡 쉬운 설명
이 결함은 시스템의 비밀번호와 같은 핵심 비밀 정보를 암호화 과정 중에 그대로 노출시키는 치명적인 오류입니다. 공격자는 이를 이용해 관리자 권한을 탈취하고 시스템 전체를 장악할 수 있습니다.
🇺🇸 원문 (English)
HAX CMS helps manage microsite universe with PHP or NodeJs backends. Prior to version 26.0.0, the `hmacBase64()` function in the HAXcms Node.js backend contains two critical cryptographic implementation errors that together allow any 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. First, the function passes the literal string "0" as the HMAC signing key instead of the key parameter, making every HAXcms instance compute identical HMACs for the same input. Then, after computing the HMAC, the function concatenates the real key parameter which is "this.privateKey + this.salt", the system’s master signing secret is directly onto the output. The combined buffer is base64-encoded and returned as the token. Every base64url token produced has the same structure: 32 bytes HMAC keyed with "0" and N bytes of `privateKey+salt`. An attacker base64-decodes any token, discards the first 32 bytes, and reads the private key directly. The `/system/api/connectionSettings` endpoint is unauthenticated and returns multiple tokens generated by this function. A single GET request to this endpoint exposes the private key. The PHP backend implements this function correctly with the actual key and returns only the hash. The PHP version produces 44-character tokens whereas the broken Node.js version produces 139+ character tokens. Version 26.0.0 fixes the issue.
📍 영향받는 시스템
HAXcms Node.js backend version < 26.0.0
⚔️ 공격 벡터
비인증 `/system/api/connectionSettings` 엔드포인트에 GET 요청을 보내 토큰을 추출한 후 Base64 디코딩하여 비밀 키를 읽음
🛡️ 대응 방법
HAXcms를 버전 26.0.0 이상으로 즉시 업그레이드하여 결함이 수정된 Node.js 백엔드를 적용하십시오.
🔧 검증 코드
출력된 토큰 길이가 139자 이상이면 결함이 있는 Node.js 버전을 사용 중이므로 즉시 패치해야 합니다.
curl -s http://<target>/system/api/connectionSettings | grep -oP '"[A-Za-z0-9+/=]{139,}"' | head -n 1 | wc -c