Description

A variable scope pollution vulnerability (CWE-621) exists in the IP banning interface of miniBB (bb_func_banip.php), available to administrators and moderators. At line 23, in the banUsr2 processing step, every POST field name is extracted into a PHP variable of the same name:

foreach($_POST as $key=>$val) $$key=operate_string($val);

The field names are not restricted to the expected banip and banreason fields, so a crafted request can overwrite arbitrary script variables before the ban record is written, including the table name $Tb used by insertArray() at line 33. The comparable code in bb_admin.php (lines 193 and 347) already restricts the assignment with in_array($key, $defFields).

Proof of Concept:

curl -b "ADMIN_COOKIES" -H "Referer: http://HOSTNAME/" \
  --data 'action=banip&step=banUsr2&banip=1.2.3.4&Tb=attacker_controlled' \
  http://HOSTNAME/index.php

The ban insert statement is directed at attacker_controlled instead of the bans table.

Impact

An authenticated administrator or moderator request with an extra crafted field can corrupt script state and redirect database writes. Exploitation requires moderator or administrator privileges, which limits severity, but the pattern is unsafe and should not be relied on.

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

Solution

Fixed in miniBB 3.8. Upgrade to 3.8 or later. To patch an older install by hand, restrict the extraction to the expected field names, for example if(in_array($key, array('banip','banreason'))) $$key=operate_string($val);, as bb_admin.php already does with $defFields.

Timeline

  • 2026-09-25: Reported to the miniBB maintainer, together with the other miniBB 3.7.2 issues.
  • 2026-10-01 to 2026-10-02: The maintainer sent pre-releases with the fix.
  • 2026-10-09: Fix verified.
  • 2026-11-20: Fixed in miniBB 3.8. Report published.

References