☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
Instantcms logo [ WEBSITE ] [ VENDOR STATS ]
CVSS: 6.7 CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H 🐛 CWE-89
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2024-31212

CVE-2024-31212 SQL Injection in Instantcms
📅 PUBLISHED: 2024-04-04 23:02 UTC 🔄 UPDATED: 2026-08-12 09:02 UTC
[ ZERO-DAY / UNPATCHED ] [ DEFENSE PATCH ↓ ]
💣 PoC: Public
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.42%
👁️
0.42% probability
10.5× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
🥷 MITRE: T1190
👁️
MITRE ATT&CK Tactic - Describes the strategy hackers use to execute this attack.
Country: Russia License: Open Source
VULNERABLE: 2.16.2
CVSS VECTOR BREAKDOWN 6.7
AV: N Attack Vector Network
AC: L Attack Complexity Low
PR: H Privileges Required High
UI: N User Interaction None
S: U Scope Unchanged
C: H Confidentiality High
I: H Integrity High
A: H Availability High
6.7
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2024-31212 is a SQL injection vulnerability in InstantCMS v2.16.2, a free and open-source content management system. The flaw resides in the index_chart_data action, where user-supplied input is passed unsanitized to the core model filterFunc function, which then embeds this data directly into an SQL statement. An attacker with administrative privileges can exploit this to execute unauthorized SQL code, potentially leading to data exfiltration, modification, or privilege escalation. The CVSS score is 6.7 (Medium), and no official patch is currently available. This report provides a comprehensive technical analysis, detection rules, and mitigation strategies.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

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.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Supply Chain & Package Security

InstantCMS is a PHP-based CMS. The vulnerability is in the core application code, not in a third-party package. However, administrators should verify the integrity of their InstantCMS installation and monitor for any unofficial patches or updates from the vendor.

CVSS Breakdown & Threat Level

  • CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
  • Base Score: 6.7 (Medium)
  • Attack Vector: Network (AV:N) – The vulnerability can be exploited remotely.
  • Attack Complexity: Low (AC:L) – No special conditions are required.
  • Privileges Required: High (PR:H) – The attacker must have administrative privileges.
  • User Interaction: None (UI:N) – No user interaction is required.
  • Scope: Unchanged (S:U) – The exploit cannot affect other components.
  • Confidentiality Impact: High (C:H) – Full database read access possible.
  • Integrity Impact: High (I:H) – Database modification possible.
  • Availability Impact: High (A:H) – Potential for denial of service via SQL manipulation.

Threat Level: Medium. While the CVSS score is moderate, the requirement for administrative privileges reduces the attack surface. However, once an admin account is compromised, the impact is severe.

Deep Dive & Mechanics

The vulnerability is in the index_chart_data action of InstantCMS. This action is designed to generate chart data for administrative dashboards. It receives a period parameter from the user (likely via GET or POST request) and passes it to the core model's filterFunc function without proper sanitization or parameterization.

The filterFunc function then constructs an SQL query using this unsanitized input. For example, the query might look like:

SELECT * FROM table WHERE date_column BETWEEN 'user_input' AND 'another_date'

If the period parameter is not escaped, an attacker can inject SQL commands. For instance, a payload like:

' OR 1=1; -- 

Could be injected to bypass intended filtering or extract data.

The vulnerability is specifically in the lack of input validation and the use of string concatenation in SQL query construction. The period parameter should be validated against a whitelist of allowed values (e.g., 'day', 'week', 'month') or properly escaped using prepared statements.

Vulnerable vs. Patched Code

Vulnerable Code (InstantCMS v2.16.2):

The vulnerable code likely resides in a controller file (e.g., controllers/admin.php) or a model file. A simplified representation:

// Vulnerable: Direct concatenation of user input
$period = $_GET['period'];
$sql = "SELECT * FROM stats WHERE date >= NOW() - INTERVAL $period";
$result = $db->query($sql);

Patched Code (Hypothetical):

A patched version would use parameterized queries or whitelist validation:

// Patched: Use prepared statement
$period = $_GET['period'];
$allowed_periods = ['day', 'week', 'month'];
if (in_array($period, $allowed_periods)) {
    $sql = "SELECT * FROM stats WHERE date >= NOW() - INTERVAL :period";
    $stmt = $db->prepare($sql);
    $stmt->bindParam(':period', $period);
    $stmt->execute();
} else {
    // Handle invalid input
}

Since no official patch is available, administrators must implement their own input validation or apply a WAF rule.

Exploitation & Lab Setup

Red Team (Exploitation)

Prerequisites:

  • Administrative credentials to InstantCMS.
  • Network access to the admin panel.

Exploitation Steps:

  1. Login to the InstantCMS admin panel.

  2. Navigate to the vulnerable endpoint, e.g., /admin/index_chart_data?period=INJECTION.

  3. Inject SQL to extract data. Example payloads:

    • Time-based blind injection:
      period=1' AND SLEEP(5)--
      
    • Union-based extraction:
      period=1' UNION SELECT username,password FROM users--
      
    • Error-based extraction:
      period=1' AND EXTRACTVALUE(1,CONCAT(0x7e,(SELECT @@version)))--
      
  4. Observe the response for timing delays or error messages to confirm injection.

Lab Setup:

  • Install InstantCMS v2.16.2 on a local server (e.g., XAMPP, LAMP).
  • Create an admin user.
  • Use a tool like Burp Suite or SQLMap to automate exploitation.

Example SQLMap command:

sqlmap -u "http://target/admin/index_chart_data?period=1" --cookie="PHPSESSID=your_session" --batch --dbs

Blue Team (Detection & Defense)

Detection:

  • Monitor for unusual SQL queries in database logs.
  • Look for requests to /admin/index_chart_data with suspicious period parameters (e.g., containing SQL keywords like UNION, SLEEP, OR).
  • Use WAF rules to block SQL injection patterns.

Defense:

  • Implement input validation for the period parameter (whitelist allowed values).
  • Use parameterized queries in the code.
  • Apply a virtual patch via WAF (e.g., ModSecurity rule).
  • Restrict admin panel access to trusted IPs.

Indicators of Compromise (IOCs)

  • Network IOCs:

    • HTTP requests to /admin/index_chart_data with period parameter containing SQL keywords (e.g., UNION, SELECT, SLEEP, OR).
    • Unusual database error messages in HTTP responses (e.g., MySQL syntax errors).
    • Anomalous database queries in logs (e.g., SELECT * FROM users from the admin user).
  • Host IOCs:

    • Unexpected database entries or modifications.
    • New admin users created.
    • Suspicious files in the web root (e.g., webshells).
  • Log IOCs:

    • Web server logs showing repeated requests to /admin/index_chart_data with varying period values.
    • Database logs showing queries with injected SQL.

Detection Engineering

YARA Rule

rule CVE_2024_31212_SQLi_InstantCMS {
    meta:
        description = "Detects SQL injection attempts targeting CVE-2024-31212 in InstantCMS"
        author = "Valters IT"
        date = "2024-01-01"
        reference = "https://nvd.nist.gov/vuln/detail/CVE-2024-31212"
    strings:
        $sqli1 = "period=" nocase
        $sqli2 = "UNION" nocase
        $sqli3 = "SLEEP" nocase
        $sqli4 = "OR 1=1" nocase
        $sqli5 = "EXTRACTVALUE" nocase
    condition:
        all of ($sqli1, $sqli2, $sqli3, $sqli4, $sqli5)
}

Sigma Rule

title: CVE-2024-31212 SQL Injection Attempt
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects SQL injection attempts against InstantCMS index_chart_data endpoint
author: Valters IT
date: 2024/01/01
logsource:
    category: webserver
    product: apache
detection:
    selection:
        cs-method: 'GET'
        cs-uri-query|contains: '/admin/index_chart_data'
        cs-uri-query|contains: 'period='
        cs-uri-query|contains|all:
            - 'UNION'
            - 'SELECT'
            - 'SLEEP'
    condition: selection
falsepositives:
    - Legitimate use of SQL keywords in period parameter (unlikely)
level: high

Suricata Rule

alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-31212 SQL Injection Attempt"; flow:to_server,established; content:"/admin/index_chart_data"; http_uri; content:"period="; http_uri; pcre:"/(UNION|SLEEP|OR\s+1=1|EXTRACTVALUE)/i"; sid:1000001; rev:1;)

Remediation & Mitigation

Immediate Actions:

  1. Disable the vulnerable endpoint if not needed: Remove or comment out the index_chart_data action in the admin controller.
  2. Apply a WAF rule to block SQL injection patterns in the period parameter.
  3. Restrict admin panel access to trusted IP addresses only.

Long-term Fix:

  • Patch the code: Implement input validation (whitelist) and use parameterized queries for the period parameter.
  • Monitor for updates: Check the InstantCMS GitHub repository for any official patches.
  • Upgrade to a newer version if available.

Workaround:

  • If patching is not possible, consider using a reverse proxy with SQL injection detection (e.g., ModSecurity).

Valters IT Signature: This report is provided for educational and defensive purposes only. Unauthorized exploitation of this vulnerability is illegal.

👁️ SHODAN DORKS (THREAT HUNTING)

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.

http.title:"InstantCMS"
http.html:"instantcms"

💣 PoC CODE AVAILABLE

Exploit code for this CVE is tracked in our database. Access poc_code via API Pro.

[ API_PRO ] →
◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2024-31212/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.