Description

An SQL injection vulnerability exists in the message moving interface of miniBB (bb_func_movepost.php), available to administrators and moderators. The movedMsgs POST parameter is split with explode() at line 26 and its elements are used in SQL statements without integer casting, reaching db_simpleSelect() (lines 31, 37, 54, 60, 173), updateArray() (line 137) and the $xtr condition built by getClForums(). The same applies to the values of the deleteAll checkbox array (line 272) used to build $xtr for the query at lines 282 and 289. The parallel deletion code in bb_func_delmsg.php line 33 applies $post+=0 to the same kind of data.

Proof of Concept:

curl -b "MODERATOR_COOKIES" -H "Referer: http://HOSTNAME/" \
  --data "action=movepost&step=2&topicid=1&forum_id=1&topictitle=x&movedMsgs=1'+or+sleep(5)--" \
  http://HOSTNAME/index.php

The response is delayed by 5 seconds, confirming injection into WHERE post_id='...'.

Impact

An authenticated moderator can execute arbitrary SQL against the forum database, including extraction of member records and password hashes.

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 element to an integer before use, for example array_map('intval', explode(',', $_POST['movedMsgs'])), and cast each $_POST['deleteAll'] element as bb_func_delmsg.php already does.

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 (post IDs in movedMsgs and deleteAll are now cast to integers, and zero IDs are rejected). Fix verified.
  • 2026-11-20: Fixed in miniBB 3.8. Report published.

References