Skip to main content
Vulnerability Database/CVE-2026-62362

CVE-2026-62362: PeerBanHelper SQL Injection Vulnerability

CVE-2026-62362 is a SQL injection flaw in PeerBanHelper that allows authenticated attackers to read all database data through unsanitized field parameters. This post explains its impact, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-62362 Overview

CVE-2026-62362 is a SQL injection vulnerability [CWE-89] in PeerBanHelper, a tool that automatically blocks unwanted, leeching, and abnormal BitTorrent peers using customizable and cloud rules. The flaw affects versions 5.0.0 through 9.3.14. The /api/statistic/analysis/field endpoint accepts a crafted field query parameter from an authenticated user and passes it to countField or sumField. The mapField() method forwards unrecognized field names without sanitization, allowing them to be interpolated into SQL through ${field} across the SQLite, MySQL, and PostgreSQL mappers. Successful exploitation permits reading all data in the PeerBanHelper database. The issue is fixed in version 9.3.15.

Critical Impact

Authenticated attackers can extract the entire contents of the PeerBanHelper database across SQLite, MySQL, and PostgreSQL backends through a crafted field query parameter.

Affected Products

  • PeerBanHelper versions 5.0.0 through 9.3.14
  • Deployments using SQLite, MySQL, or PostgreSQL backends
  • Fixed in PeerBanHelper version 9.3.15

Discovery Timeline

  • 2026-10-16 - CVE-2026-62362 published to NVD
  • 2026-10-16 - Last updated in NVD database

Technical Details for CVE-2026-62362

Vulnerability Analysis

The vulnerability resides in the PBHMetricsController class, which exposes the /api/statistic/analysis/field REST endpoint. The endpoint accepts a field query parameter from an authenticated client and forwards it to the countField or sumField database operations.

The helper method mapField() is intended to translate caller-supplied field names into safe column identifiers. When a field name is not recognized, the method returns the raw string instead of rejecting it. This untrusted value is then interpolated into MyBatis SQL templates using the ${field} syntax, which performs direct string substitution rather than parameterized binding.

Because the same unsanitized path exists across the SQLite, MySQL, and PostgreSQL mapper XML files, every supported database backend is affected. An attacker with valid credentials can craft a field value that terminates the intended column reference and appends arbitrary SQL to read any table in the application database.

Root Cause

The root cause is a classic failure to separate SQL code from user data. The mapField() whitelist did not treat unknown values as hostile, and the mapper XML files used MyBatis ${} interpolation instead of #{} parameter binding for the column identifier.

Attack Vector

Exploitation requires an authenticated session but no user interaction. The attacker sends an HTTP request to /api/statistic/analysis/field with a field parameter containing SQL syntax. The injected fragment is embedded into the generated query and executed by the configured database engine, returning data through the API response.

java
 package com.ghostchu.peerbanhelper.module.impl.webapi;
 
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.core.toolkit.sql.SqlInjectionUtils;
 import com.ghostchu.peerbanhelper.DownloaderServer;
 import com.ghostchu.peerbanhelper.databasent.dto.UniversalFieldDateResult;
 import com.ghostchu.peerbanhelper.databasent.dto.UniversalFieldNumResult;

Source: GitHub patch commit bec34c8. The patch introduces MyBatis-Plus SqlInjectionUtils to validate the field name before it reaches the mapper layer.

Detection Methods for CVE-2026-62362

Indicators of Compromise

  • HTTP requests to /api/statistic/analysis/field containing SQL metacharacters such as single quotes, parentheses, UNION, or SELECT in the field query parameter.
  • Database query logs showing malformed or unusually long column references originating from PeerBanHelper service accounts.
  • Authenticated API sessions that issue high volumes of statistic analysis requests outside of normal usage patterns.

Detection Strategies

  • Inspect reverse proxy and application logs for field= values that do not match the known whitelist used by the PeerBanHelper UI.
  • Enable database query logging on the SQLite, MySQL, or PostgreSQL backend and alert on queries that reference tables outside the PeerBanHelper schema from the application connection.
  • Correlate authentication events with statistic endpoint activity to identify credential compromise followed by data access attempts.

Monitoring Recommendations

  • Monitor outbound response sizes from /api/statistic/analysis/field, as data exfiltration typically produces larger payloads than legitimate aggregate queries.
  • Track failed and successful logins to the PeerBanHelper web interface and alert on anomalous geographic or temporal patterns.
  • Centralize PeerBanHelper application and database logs in a SIEM to support correlation across authentication, API, and query events.

How to Mitigate CVE-2026-62362

Immediate Actions Required

  • Upgrade PeerBanHelper to version 9.3.15 or later immediately.
  • Rotate credentials for every account authorized to access the PeerBanHelper web interface.
  • Review database audit logs for queries that reference tables outside normal statistic operations since 5.0.0 was deployed.
  • Restrict network exposure of the PeerBanHelper management interface to trusted administrative networks.

Patch Information

The fix is delivered in PeerBanHelper v9.3.15 via commit bec34c8. The patch imports SqlInjectionUtils from MyBatis-Plus and validates the field parameter before it is interpolated into any mapper statement. Additional detail is available in GitHub Security Advisory GHSA-pc89-mfwm-hj9x.

Workarounds

  • If patching cannot be performed immediately, place the PeerBanHelper web interface behind a reverse proxy that blocks requests to /api/statistic/analysis/field or filters SQL metacharacters in the field parameter.
  • Reduce the privilege of the database user configured for PeerBanHelper to the minimum required tables to limit the data accessible through injection.
  • Disable or firewall off the web interface for untrusted users until the upgrade to 9.3.15 is complete.
bash
# Example nginx snippet to block suspicious field parameters until patching
location /api/statistic/analysis/field {
    if ($arg_field ~* "[';()]|union|select|--") {
        return 403;
    }
    proxy_pass http://peerbanhelper_backend;
}

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.