Severity by source
AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
PR:L confirmed by explicit staff-account-plus-reports-permission requirement; AV:N as a web endpoint; C/I/A:H because unrestricted SQL execution exposes full database read and potential write within the Koha DB user's scope.
Primary rating from Vendor (309f9ea4-e3e9-4c6c-b79d-e8eb01244f2c).
CVSS VectorVendor: 309f9ea4-e3e9-4c6c-b79d-e8eb01244f2c
Lifecycle Timeline
7DescriptionCVE.org
Koha's reports/catalogue_stats.pl builds dynamic SQL in sub calculate by interpolating the user-controlled Line and Column request parameters directly into identifier positions of the query (SELECT DISTINCTROW, GROUP BY, ORDER BY) with no whitelist validation. When Line contains itemcallnumber and the cotedigits parameter is truthy, cotedigits is additionally concatenated raw as the numeric argument of a LEFT() call. An authenticated staff user holding the reports module permission can inject arbitrary SQL and read any table reachable by the Koha database user, including borrowers (password hashes, two-factor secrets, personal data), api_keys, and sessions.
AnalysisAI
SQL injection in Koha's reports/catalogue_stats.pl allows an authenticated staff user with the reports module permission to read any table reachable by the Koha database user, including borrowers (password hashes, two-factor secrets, personal data), api_keys, and sessions. Affected releases span all Koha branches prior to 24.11.17, 25.05.12, 25.11.06, and 26.05.01, with vendor-released fixes now available. No public exploit code or active exploitation (CISA KEV) has been identified at time of analysis; the SSVC framework rates exploitation status as none and automatable as no, reflecting the authenticated staff-account prerequisite.
Technical ContextAI
Koha is a widely deployed open-source Integrated Library System (ILS) written in Perl, used by public, academic, and special libraries globally. The vulnerable code path is in reports/catalogue_stats.pl within the calculate subroutine, which constructs dynamic SQL by interpolating the HTTP request parameters Line and Column directly into SQL identifier positions - specifically SELECT DISTINCTROW, GROUP BY, and ORDER BY clauses - without whitelist validation against a permitted set of column names. A secondary injection surface activates when Line equals 'itemcallnumber' and the cotedigits parameter is truthy: cotedigits is concatenated raw as the numeric argument of a SQL LEFT() function call. CWE-89 (Improper Neutralization of Special Elements in an SQL Command) applies precisely: because user input lands at structural identifier positions rather than value positions, standard parameterized query binding would not alone prevent exploitation - the fix must also validate identifier values against a whitelist of permitted column names.
RemediationAI
Upgrade to the first fixed release on your installed branch: Koha 24.11.17, 25.05.12, 25.11.06, or 26.05.01 as appropriate. Release packages are available at https://download.koha-community.org/koha-25.05.12.tar.gz and the community release announcement at https://koha-community.org/koha-25-05-12-released/; consult the Koha bug tracker entry at https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42363 for branch-specific patch details. If immediate patching is not feasible, audit and remove the reports module permission from all staff accounts that do not operationally require it - note this will disrupt legitimate reporting workflows for affected staff. As a secondary compensating control, restrict network access to reports/catalogue_stats.pl at the reverse proxy or web server layer for IP ranges outside trusted library networks, accepting reduced remote reporting capability. Database-level read restrictions on the borrowers, api_keys, and sessions tables for the Koha database user could limit blast radius but risk breaking core Koha functionality and require thorough regression testing before deployment.
Same weakness CWE-89 – SQL Injection
View allShare
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-52672
GHSA-8rx2-c3qm-2mc4