CVE-2026-71288

Koha SQL Injection via order_by and {order}_ovalue Parameters in guided_reports.pl

Published Aug 5, 2026 CVSS 3.1 · 8.8 High EPSS < 1% KEV · Not listed
Description
Koha's guided report builder (reports/guided_reports.pl) reads the CGI parameter and, for each value, a dynamically-named parameter, and concatenates both directly into an SQL ORDER BY clause with no allowlist or validation. Since ORDER BY columns cannot be bound via prepared-statement placeholders, this requires an explicit allowlist, which does not exist.

Analysis

AI-generated

Technical impact

Koha’s guided report builder reads CGI parameters and concatenates them directly into an ORDER BY clause without any validation or allowlist. Because ORDER BY columns cannot be parameterized, the script must build the clause as a string, and the absence of sanitization allows an attacker to inject arbitrary SQL. This flaw can be used to execute read or even destructive SQL commands, potentially exposing patron information, staff credentials, or other sensitive database contents.

Affected Systems

All installations of Koha Community’s Koha database management system that include the guided_reports.pl script are potentially affected, as the advisory does not specify a version range. Any version that ships with this script could be vulnerable.

Risk and Exploitability

The CVSS score of 8.8 flags the flaw as high severity, and the EPSS score of less than 1 percent indicates a very low likelihood of exploitation at this time. The vulnerability is not listed in the CISA KEV catalog. An attacker would need the ability to submit crafted requests to guided_reports.pl – for example, via the web interface – but the advisory does not specify user privilege requirements, leaving the attack reach uncertain. Nonetheless, if exploitation occurs it could allow unauthorized database access with potentially high impact.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply the latest Koha update that fixes the SQL injection flaw.
  • Restrict or remove access to the guided_reports.pl functionality for users who do not require report generation capabilities.
  • If no patch is available, modify guided_reports.pl to enforce an explicit allowlist of permitted order_by and order_ovalue values, and escape or validate these parameters before including them in the ORDER BY clause.

Generated by OpenCVE AI on August 10, 2026 at 21:20 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
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. Koha's guided report builder (reports/guided_reports.pl) reads the CGI parameter and, for each value, a dynamically-named parameter, and concatenates both directly into an SQL ORDER BY clause with no allowlist or validation. Since ORDER BY columns cannot be bound via prepared-statement placeholders, this requires an explicit allowlist, which does not exist.
Title Koha - SQL Injection via order_by and {order}_ovalue Parameters in guided_reports.pl Koha SQL Injection via order_by and {order}_ovalue Parameters in guided_reports.pl
Type Values Removed Values Added
Title Koha SQL Injection via order_by and {order}_ovalue Parameters in guided_reports.pl Koha - SQL Injection via order_by and {order}_ovalue Parameters in guided_reports.pl
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, '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 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'}

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:47 AM
Reserved
Aug 5, 2026, 12:23 PM
Status
Deferred
Published
Aug 5, 2026, 1:24 PM
Modified
Oct 23, 2026, 9:10 PM