CVE-2026-138395 — Black-coffe Easy-php-cms — CWE-89 · CWE-74
A security flaw has been discovered in Black-coffe easy-php-cms 4ca1f761d05fd819b202daf1355ff46881a8f93a/acbb257b2afbf148c8e193d26f277183773572b5. Impacted is the function selectPostFromPostsWithUsersOnSingle of the file single.php. Performing a manipulation of the argument post results in sql injection. The attack is possible to be carried out remotely. The exploit has been released to the public and may be used for attacks. This product adopts a rolling release strategy to maintain continuous delivery. Therefore, version details for affected or updated releases cannot be specified. The project was informed of the problem early through an issue report but has not responded yet.
A security flaw has been discovered in Black-coffe easy-php-cms 4ca1f761d05fd819b202daf1355ff46881a8f93a/acbb257b2afbf148c8e193d26f277183773572b5. Impacted is the function selectPostFromPostsWithUsersOnSingle of the file single.php. Performing a manipulation of the argument post results in sql injection. The attack is possible to be carried out remotely. The exploit has been released to the public and may be used for attacks. This product adopts a rolling release strategy to maintain continuous delivery. Therefore, version details for affected or updated releases cannot be specified. The project was informed of the problem early through an issue report but has not responded yet.
🎯 What is this vulnerability?
This vulnerability is a SQL Injection (SQLi) flaw classified under CWE-89 (SQL Injection) and CWE-74 (Improper Neutralization of Special Elements in Output Used by a Downstream Component).
Technical Flaw Analysis:
The vulnerability resides in the single.php file of the easy-php-cms application, specifically within the function selectPostFromPostsWithUsersOnSingle. The root cause is the failure to sanitize or parameterize the post argument before it is interpolated into a SQL query.
1. Missing Input Validation: The application accepts user-supplied input via the post parameter (likely a GET or POST parameter) and passes it directly to the database layer without using prepared statements or proper escaping.
2. Unauthenticated Access: The CVSS vector (PR:N) indicates that no authentication is required. This implies that the single.php endpoint is publicly accessible, allowing any remote attacker to manipulate the post parameter.
3. Injection Point: The post argument is likely used to fetch a specific blog post or article. By injecting SQL syntax (e.g., ' OR 1=1 --), an attacker can alter the logic of the query, potentially bypassing intended filters, extracting data, or modifying database contents.
CVSS Vector Breakdown:
- AV:N (Network): Exploitable remotely over the network.
- AC:L (Low Complexity): No special conditions required; standard HTTP request suffices.
- PR:N (None): No privileges required.
- UI:N (None): No user interaction required.
- S:U (Unchanged): Scope remains within the vulnerable component.
- C:L/I:L/A:L (Low Impact): The CVSS score of 7.3 suggests limited impact. This is unusual for SQLi, which often allows full data exfiltration (C:H) or RCE (A:H). The "Low" impact rating may indicate that the specific injection point only allows for limited data retrieval (e.g., reading specific columns) or that the database user has restricted permissions. However, in practice, SQLi often leads to higher impact if the DB user has broader privileges.
- Fingerprinting: An attacker scans for the
easy-php-cmsapplication. Since the project uses a rolling release strategy, version detection is difficult. However, the presence ofsingle.phpand specific error messages or HTML structure can confirm the CMS. - Endpoint Identification: The attacker identifies the
single.phpendpoint, which is typically used to display individual blog posts (e.g.,/single.php?post=1).
⚡ Attack Chain
1. Discovery & Reconnaissance
2. Exploitation
The attacker crafts a malicious HTTP request to thesingle.php endpoint, injecting SQL code into the post parameter.Illustrative PoC (SQL Injection):
Note: The exact parameter name and endpoint path are derived from the CVE description. The payload below is a standard SQLi example.
# Basic Union-Based SQLi to extract database version
curl -X GET "http://target.com/single.php?post=1' UNION SELECT 1,2,3,4,5,6,7,8,9,10-- -"
# Blind SQLi to check for true/false conditions
curl -X GET "http://target.com/single.php?post=1' AND 1=1-- -"
curl -X GET "http://target.com/single.php?post=1' AND 1=2-- -"Detailed Exploitation Mechanics:
1. Error-Based/Union-Based: If the application displays database errors or allows UNION SELECT, the attacker can extract data from other tables (e.g., users, admin_credentials).
2. Blind SQLi: If no data is returned, the attacker uses time-based or boolean-based blind SQLi to infer data character by character.
3. Stacked Queries: If the database driver supports stacked queries (e.g., MySQL with ALLOW_MULTI_QUERIES), the attacker might execute multiple statements, potentially leading to file writes or RCE (though CVSS rates impact as Low, this is a risk).
3. Post-Exploitation
🌍 Real World Impact
SELECT only on specific tables).
* The injection point only allows reading limited data (e.g., post titles, not user passwords).
* However, in real-world scenarios, SQLi often leads to full database compromise if the DB user has broader privileges.
SLEEP(10)), but this is likely limited in scope.Practical Consequences:
🛡️ Remediation & Mitigation
1. Patching
selectPostFromPostsWithUsersOnSingle function in single.php to use prepared statements.Example of Secure Code (PHP with PDO):
// VULNERABLE (Illustrative)
// $query = "SELECT * FROM posts WHERE id = " . $_GET['post'];
// SECURE (Using PDO Prepared Statements)
$stmt = $pdo->prepare("SELECT * FROM posts WHERE id = :post_id");
$stmt->execute([':post_id' => $_GET['post']]);
$posts = $stmt->fetchAll();2. Workarounds
post parameter to ensure it contains only integers (if it represents an ID).if (!ctype_digit($_GET['post'])) {
die("Invalid post ID");
}SecRule ARGS:post "@rx (?i)(union|select|insert|update|delete|drop|alter|create|exec|xp_cmdshell|sleep|benchmark)" \
"id:100001,phase:2,deny,status:403,msg:'SQL Injection Detected in post parameter'"single.php is not required to be publicly accessible, restrict access via IP whitelisting or authentication.3. Detection
post parameter.GET /single.php?post=1' UNION SELECT 1,2,3,4,5,6,7,8,9,10-- - HTTP/1.1* Log Pattern:
post=[^&]*('|\(|\)|%27|%28|%29|UNION|SELECT|SLEEP)single.php or other core files.⚠️ Urgency
Rationale:
1. Public Exploit: The exploit is publicly available, increasing the likelihood of automated scanning and exploitation.
2. Unauthenticated: No login required, making it easy for attackers to exploit.
3. No Vendor Response: The project has not responded, meaning no official patch is available. Users must self-patch or apply workarounds.
4. Rolling Release: The lack of versioning makes it difficult to determine if a specific installation is vulnerable, increasing the risk.
Recommended Actions:
1. Immediate: Apply input validation and prepared statements to single.php.
2. Short-Term: Deploy WAF rules to block SQLi attempts.
3. Long-Term: Monitor the project repository for a fix and update as soon as it is available. Consider migrating to a more actively maintained CMS if the project remains unresponsive.
[🤖 CVE Professor AI Security Engine]
FOFA Query