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.
Published: 2026-08-04
Score: 8.8 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

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.

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

Remediation

No vendor fix or workaround currently provided.

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 yet.

History

Mon, 10 Aug 2026 12:00:00 +0000

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.

Mon, 10 Aug 2026 11:30:00 +0000

Type Values Removed Values Added
Title Koha: SQL Injection in reports/issues_avg_stats.pl Koha - SQL Injection in reports/issues_avg_stats.pl

Wed, 05 Aug 2026 13:15:00 +0000

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'}


Tue, 04 Aug 2026 18:30:00 +0000

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'}


Tue, 04 Aug 2026 15:00:00 +0000

Type Values Removed Values Added
First Time appeared Koha-community
Koha-community koha
Vendors & Products Koha-community
Koha-community koha

Tue, 04 Aug 2026 13:15:00 +0000

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

Subscriptions

Koha-community Koha
cve-icon MITRE

Status: PUBLISHED

Assigner: TuranSec

Published:

Updated: 2026-08-10T11:44:42.609Z

Reserved: 2026-08-04T07:13:07.992Z

Link: CVE-2026-70371

cve-icon Vulnrichment

Updated: 2026-08-04T17:21:52.111Z

cve-icon NVD

Status : Received

Published: 2026-08-04T13:18:57.930

Modified: 2026-08-10T12:17:22.610

Link: CVE-2026-70371

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-10T23:45:04Z

Weaknesses
  • CWE-89

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