CVE-2025-51657

5.4 MEDIUM

📋 TL;DR

SemCms v5.0 contains a SQL injection vulnerability in the SEMCMS_Link.php file through the lgid parameter. This allows attackers to execute arbitrary SQL commands on the database. All users running SemCms v5.0 are affected.

💻 Affected Systems

Products:
  • SemCms
Versions: v5.0
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Affects SEMCMS_Link.php specifically via the lgid parameter.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise leading to data theft, data manipulation, or full system takeover via subsequent attacks.

🟠

Likely Case

Database information disclosure, including user credentials, sensitive content, or configuration data.

🟢

If Mitigated

Limited impact with proper input validation and parameterized queries in place.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

SQL injection via GET/POST parameter requires minimal technical skill.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Unknown

Vendor Advisory: http://semcms.com

Restart Required: No

Instructions:

Check vendor website for updates. If unavailable, implement workarounds.

🔧 Temporary Workarounds

Input Validation Filter

all

Add input validation to sanitize lgid parameter before processing.

Edit SEMCMS_Link.php to validate lgid as integer: if(!is_numeric($_GET['lgid'])) { die('Invalid input'); }

WAF Rule

all

Deploy web application firewall to block SQL injection patterns.

ModSecurity rule: SecRule ARGS:lgid "@detectSQLi" "id:1001,phase:2,deny"

🧯 If You Can't Patch

  • Restrict access to SEMCMS_Link.php via firewall rules.
  • Monitor database logs for unusual SQL queries.

🔍 How to Verify

Check if Vulnerable:

Test SEMCMS_Link.php with payload: lgid=1' OR '1'='1

Check Version:

Check SemCms version in admin panel or configuration files.

Verify Fix Applied:

Test with same payload; should return error or no data.

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL errors in web server logs
  • Multiple requests to SEMCMS_Link.php with SQL syntax

Network Indicators:

  • HTTP requests containing SQL keywords like UNION, SELECT, OR

SIEM Query:

source="web.log" AND uri="/SEMCMS_Link.php" AND (lgid="*'*" OR lgid="*OR*" OR lgid="*UNION*")

🔗 References

📤 Share & Export