Description
Koha's guided report builder (reports/guided_reports.pl) reads the `order_by` CGI parameter and, for each value, a dynamically-named `{order}_ovalue` parameter, and concatenates both directly into an SQL ORDER BY clause with no allowlist or validation: `my @order_by = $input->multi_param('order_by'); foreach my $order (@order_by) { my $value = $input->param($order . "_ovalue"); $query_orderby = " ORDER BY $order $value"; }`. The resulting string is appended verbatim to the final query in C4::Reports::Guided (`$query .= $orderby;`) with no escaping. Since ORDER BY columns cannot be bound via prepared-statement placeholders, this requires an explicit allowlist, which does not exist. Any staff account with the low-privilege create_reports or execute_reports permission (commonly granted to non-admin library staff) can perform time-based blind SQL injection against the Koha database, which stores patron PII and staff/LDAP credentials.
Published: 2026-08-05
Score: 8.8 High
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

Koha's guided report builder concatenates the "order_by" CGI parameter and a related "{order}_ovalue" parameter directly into an SQL ORDER BY clause without validation or escaping. This flaw allows a staff user with the create_reports or execute_reports permission to perform timed blind SQL injection against the Koha database, exposing personally identifying information and authentication data.

Affected Systems

Koha, the open-source library management system released by Koha Community. Version information was not supplied in the advisory, so all installations possibly affected until an official patch is released.

Risk and Exploitability

The CVSS score of 8.8 marks this finding as high severity, and the advisory notes that the attack requires only a low‑privilege staff account with report‑generation permissions, which are commonly granted to non‑admin library staff. Because it is a time‑based blind injection, an attacker must perform the attack over multiple queries, which increases effort but is still feasible with automated tools. The EPSS score is not available, and the vulnerability is not listed in CISA KEV, but the potential for data exposure gives it significant risk.

Generated by OpenCVE AI on August 5, 2026 at 15:09 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Check for and apply the latest official Koha update that fixes the SQL injection flaw.
  • Restrict the create_reports and execute_reports permissions to administrative accounts only, reducing the number of users who can trigger guided reports.
  • Modify the guided_reports.pl script to validate "order_by" values against an explicit allowlist of column names and order directions before constructing the ORDER BY clause, or replace the dynamic string with a hard‑coded, safe query when possible.

Generated by OpenCVE AI on August 5, 2026 at 15:09 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

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

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

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

Type Values Removed Values Added
Description Koha's guided report builder (reports/guided_reports.pl) reads the `order_by` CGI parameter and, for each value, a dynamically-named `{order}_ovalue` parameter, and concatenates both directly into an SQL ORDER BY clause with no allowlist or validation: `my @order_by = $input->multi_param('order_by'); foreach my $order (@order_by) { my $value = $input->param($order . "_ovalue"); $query_orderby = " ORDER BY $order $value"; }`. The resulting string is appended verbatim to the final query in C4::Reports::Guided (`$query .= $orderby;`) with no escaping. Since ORDER BY columns cannot be bound via prepared-statement placeholders, this requires an explicit allowlist, which does not exist. Any staff account with the low-privilege create_reports or execute_reports permission (commonly granted to non-admin library staff) can perform time-based blind SQL injection against the Koha database, which stores patron PII and staff/LDAP credentials.
Title Koha SQL Injection via order_by and {order}_ovalue Parameters in guided_reports.pl
Weaknesses CWE-89
References
Metrics 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'}


Subscriptions

Koha-community Koha
cve-icon MITRE

Status: PUBLISHED

Assigner: TuranSec

Published:

Updated: 2026-08-05T15:49:58.066Z

Reserved: 2026-08-05T12:23:34.968Z

Link: CVE-2026-71288

cve-icon Vulnrichment

No data.

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-05T15:30:17Z

Weaknesses
  • CWE-89

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