Description

An SQL injection vulnerability exists in the ban removal interface of miniBB (bb_func_banip.php), available to administrators and moderators. In the deleteban2 processing step, the ban records to remove are taken from the array keys of the banip POST parameter (lines 47 to 56): each key becomes an element of $delban and is concatenated into the WHERE clause built by getClForums() and passed to db_delete() without integer casting or quoting.

The keys of a crafted POST array are fully attacker-controlled. Because PHP converts spaces and dots in request field names to underscores, SQL keywords are separated with MySQL block comments instead.

Proof of Concept:

curl -b "ADMIN_COOKIES" -H "Referer: http://HOSTNAME/" \
  --data 'action=banip&step=deleteban2&banip[1/**/or/**/sleep(5)#]=x' \
  http://HOSTNAME/index.php

The response is delayed by 5 seconds, confirming injection into DELETE ... WHERE ( id=<key> ... ).

Impact

An authenticated moderator or administrator request with crafted field names can execute arbitrary SQL against the forum database.

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

Solution

Fixed in miniBB 3.8. Upgrade to 3.8 or later. To patch an older install by hand, cast each key to an integer before passing it to getClForums(), for example $delban[$i]=(int)$key;.

Timeline

  • 2026-09-25: Reported to the miniBB maintainer, together with the other miniBB 3.7.2 issues.
  • 2026-10-01: The maintainer sent a pre-release with the fix (the banip[] keys are now cast to integers, and zero values are rejected). Fix verified.
  • 2026-11-20: Fixed in miniBB 3.8. Report published.

References