CVE-2026-70371

Koha - SQL Injection in reports/issues_avg_stats.pl

Published Aug 4, 2026 CVSS 3.1 · 8.8 High EPSS < 1% KEV · Not listed
Description
Koha's reports/issues_avg_stats.pl builds dynamic SQL in sub calculate by concatenating several user-controlled request parameters directly into the query string. The Line and Column parameters are not validated against any whitelist and land verbatim in identifier positions (SELECT DISTINCTROW, GROUP BY, ORDER BY), and each Filter slot is concatenated raw into single-quoted LIKE, BETWEEN, and comparison fragments with no bound parameters.

Analysis

AI-generated

Technical impact

Koha’s reports/issues_avg_stats.pl constructs SQL queries by concatenating user‑supplied request parameters directly into the query string. The Line and Column parameters are inserted verbatim into the SELECT, GROUP BY, and ORDER BY clauses, and each Filter slot is concatenated into literal LIKE, BETWEEN, and comparison fragments without using bound parameters. This technique of building dynamic SQL without input validation or parameterization creates a vulnerability that can be exploited to inject arbitrary SQL. The description does not explicitly state whether authentication is required; it is inferred that a user with access to the reports feature could supply the relevant parameters, allowing malicious queries that may read or modify any database objects that the Koha database user has permissions to access.

Affected Systems

The flaw is present in any Koha Community installation that includes the reports/issues_avg_stats.pl file. No specific version range is delineated in the advisory, but the issue was addressed in the 25‑05‑12 release as indicated by the provided download and release URLs.

Risk and Exploitability

The vulnerability carries a CVSS score of 8.8, indicating high severity. Its EPSS score is less than 1 %, suggesting a low probability of exploitation at this time. The flaw is not listed in the CISA KEV catalog. The description does not explicitly state an authentication requirement; it is inferred that a user with access to the reports feature could supply the relevant parameters. Once those conditions are met, exploitation can lead to the execution of arbitrary SQL statements, potentially exposing sensitive data or altering database contents.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Koha to a release that includes the SQL injection fix, such as the 25-05-12 version or newer.
  • If upgrading is not immediately possible, replace the reports/issues_avg_stats.pl file with a version that implements proper parameterized queries or validates and sanitizes the Line, Column, and Filter inputs.
  • Restrict or remove staff user permissions for the reports module until a patch is applied, and monitor logs for suspicious query activity.

Generated by OpenCVE AI on August 10, 2026 at 23:41 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Description Koha's reports/issues_avg_stats.pl builds dynamic SQL in sub calculate by concatenating several user-controlled request parameters directly into the query string. The Line and Column parameters are not validated against any whitelist and land verbatim in identifier positions (SELECT DISTINCTROW, GROUP BY, ORDER BY), and each Filter slot is concatenated raw into single-quoted LIKE, BETWEEN, and comparison fragments with no bound parameters. 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. Koha's reports/issues_avg_stats.pl builds dynamic SQL in sub calculate by concatenating several user-controlled request parameters directly into the query string. The Line and Column parameters are not validated against any whitelist and land verbatim in identifier positions (SELECT DISTINCTROW, GROUP BY, ORDER BY), and each Filter slot is concatenated raw into single-quoted LIKE, BETWEEN, and comparison fragments with no bound parameters.
Type Values Removed Values Added
Title Koha: SQL Injection in reports/issues_avg_stats.pl Koha - SQL Injection in reports/issues_avg_stats.pl
Type Values Removed Values Added
Metrics cvssV3_1

{'score': 6.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N'}

cvssV3_1

{'score': 8.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H'}

Type Values Removed Values Added
Metrics cvssV3_1

{'score': 6.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N'}

ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Koha-community
Koha-community koha
Vendors & Products Koha-community
Koha-community koha
Type Values Removed Values Added
Description Koha's reports/issues_avg_stats.pl builds dynamic SQL in sub calculate by concatenating several user-controlled request parameters directly into the query string. The Line and Column parameters are not validated against any whitelist and land verbatim in identifier positions (SELECT DISTINCTROW, GROUP BY, ORDER BY), and each Filter slot is concatenated raw into single-quoted LIKE, BETWEEN, and comparison fragments with no bound parameters. 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.
Title Koha: SQL Injection in reports/issues_avg_stats.pl
Weaknesses CWE-89
References
Weaknesses
  • CWE-89

    Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')

Sources

Status
PUBLISHED
Assigner
TuranSec
Published
Updated
Aug 10, 2026, 11:44 AM
Reserved
Aug 4, 2026, 7:13 AM
Status
Deferred
Published
Aug 4, 2026, 1:18 PM
Modified
Oct 23, 2026, 11:10 PM