🇰🇷 한글 설명
Koha 커뮤니티 시스템의 보고서 모듈에서 인증된 사용자가 Filter URL 매개변수를 통해 SQL 인젝션을 수행할 수 있는 취약점입니다. 공격자는 이를 통해 데이터베이스의 임의 데이터를 읽거나 민감한 정보(비밀번호 해시, PII 등)를 유출할 수 있습니다.
💡 쉬운 설명
도서관 관리 시스템인 Koha의 보고서 기능에서 해커가 데이터베이스를 조작해 중요한 정보를 빼갈 수 있는 구멍이 있습니다. 이 취약점은 시스템 관리자로 로그인한 상태에서 특정 검색 조건을 조작하여 발생합니다.
🇺🇸 원문 (English)
SQL Injection in reports/catalogue_out.pl in Koha Community Koha through 22.11.37, 23.x, 24.x before 24.11.16, 25.05.x before 25.05.11, 25.11.x before 25.11.05, 26.05.x before 26.05.01, and 26.11.x before 26.11.00 allows an authenticated staff user with the Reports module flag to read arbitrary data from the Koha application database via the Filter URL parameter when the Criteria parameter matches /branchcode/.
The vulnerable sink in sub calculate concatenates the unmodified Filter request parameter directly into a LIKE clause of the auxiliary $strsth2 statement and executes it via DBI without bound parameters:
my $f = @$filters[0];
$f =~ s/\*/%/g;
$strsth2 .= " AND $column LIKE '$f' ";
This enables error-based SQL injection (e.g., via EXTRACTVALUE) and full read access to sensitive tables including borrowers (password hashes, 2FA secrets, PII), borrower_password_recovery, api_keys, and sessions.
Proof of concept (error-based, single request):
GET /cgi-bin/koha/reports/catalogue_out.pl?do_it=1&output=screen&Limit=10&Criteria=branchcode&Filter=x'+AND+EXTRACTVALUE(1,CONCAT(0x7e,VERSION(),0x7c,USER(),0x7c,DATABASE(),0x7e))--+-
Cookie: CGISESSID=<LIBRARIAN_SESSION>
The response body contains the DBI exception leaking the MariaDB version, database user, client IP, and database name, after which arbitrary data can be paged out using LIMIT n,1 / SUBSTRING(...).
The vulnerable sink was introduced in commit 6bb77ae3e4 (2008-07-09); CVE-2015-4633 patched the same class in sibling files but did not generalise the fix to reports/catalogue_out.pl. Fixed in Koha 22.11.38, 24.11.16, 25.05.11, 25.11.05, 26.05.01, and 26.11.00 by replacing the raw concatenation with a parameterised placeholder.
📍 영향받는 시스템
Koha Community Koha 22.11.37 이하, 23.x, 24.x (24.11.16 미만), 25.05.x (25.05.11 미만), 25.11.x (25.11.05 미만), 26.05.x (26.05.01 미만), 26.11.x (26.11.00 미만)
⚔️ 공격 벡터
인증된 스태프 사용자가 Reports 모듈 권한으로 catalogue_out.pl의 Filter 매개변수에 악의적인 SQL 코드를 삽입하여 데이터베이스 쿼리를 조작합니다.
🛡️ 대응 방법
Koha를 22.11.38, 24.11.16, 25.05.11, 25.11.05, 26.05.01, 또는 26.11.00 이상으로 업그레이드하여 매개변수화된 쿼리로 교체해야 합니다.