Description

A reflected Cross-Site Scripting (XSS) vulnerability exists in miniBB due to insufficient sanitization of user-supplied input in the banreason parameter of the IP banning interface (bb_func_banip.php). The value is read from $_GET['banreason'] without encoding and printed inside the value="..." attribute of the ban form:

$banreason=(isset($_GET['banreason'])?$_GET['banreason']:'');

An attacker can craft a malicious URL that, when visited by an authenticated admin/moderator user, executes arbitrary JavaScript in the context of the victim's browser session.

Proof of Concept:

http://HOSTNAME/index.php?action=banip&banreason="%20autofocus%20onfocus="alert(1)

Impact

A successful exploitation of this vulnerability allows an attacker to execute arbitrary JavaScript in the victim's browser. This could lead to session hijacking, credential theft, defacement of the web interface, or further attacks against authenticated users.

CVSS 3.1 base score: 6.1 Medium (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N).

Solution

Fixed in miniBB 3.8. Upgrade to 3.8 or later. To patch an older install by hand, pass the value through operate_string():

$banreason=(isset($_GET['banreason'])?operate_string($_GET['banreason']):'');

Timeline

  • 2026-05-12: Reported to the miniBB maintainer. CVE ID requested.
  • 2026-05-14: The maintainer confirmed the issue and proposed a fix: pass $_GET['banreason'] through operate_string().
  • 2026-09-25: CVE-2026-52222 shared with the maintainer. Proposed fix tested and confirmed.
  • 2026-11-20: Fixed in miniBB 3.8. Report published.

References