VULNARCHIVE

GCVE-1988-2026-0586

miniBB 3.7.2 `movedMsgs` SQL Injection Vulnerability

Description (en)

# miniBB 3.7.2 `movedMsgs` SQL Injection Vulnerability

**Author:** Khashayar Fereidani
**Disclosure Date:** 2026-11-20
**Advisory:** https://fereidani.com/minibb-372-movedmsgs-sql-injection-vulnerability
**Contact:** https://fereidani.com/contact

## 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:**

```bash
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

- [miniBB 3.7.2 `deleteAll` Cross-Site
Scripting](https://fereidani.com/minibb-372-deleteall-cross-site-scripting-vulnerability)
- [CWE-89: Improper Neutralization of Special Elements used in an SQL
Command ('SQL Injection')](https://cwe.mitre.org/data/definitions/89.html)
- [miniBB - official website](https://www.minibb.com/)
_______________________________________________
Sent through the Full Disclosure mailing list
https://nmap.org/mailman/listinfo/fulldisclosure
Web Archives & RSS: https://seclists.org/fulldisclosure/

References

Raw JSON
{
  "containers": {
    "cna": {
      "affected": [
        {
          "product": "Minibb",
          "vendor": "Minibb",
          "versions": [
            {
              "status": "affected",
              "version": "unknown"
            }
          ]
        }
      ],
      "credits": [
        {
          "lang": "en",
          "type": "finder",
          "value": "Khashayar Fereidani"
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "# miniBB 3.7.2 `movedMsgs` SQL Injection Vulnerability\n\n**Author:** Khashayar Fereidani\n**Disclosure Date:** 2026-11-20\n**Advisory:** https://fereidani.com/minibb-372-movedmsgs-sql-injection-vulnerability\n**Contact:** https://fereidani.com/contact\n\n## Description\n\nAn SQL injection vulnerability exists in the message moving interface\nof miniBB (bb_func_movepost.php), available to administrators and\nmoderators. The `movedMsgs` POST parameter is split with `explode()`\nat line 26 and its elements are used in SQL statements without integer\ncasting, reaching `db_simpleSelect()` (lines 31, 37, 54, 60, 173),\n`updateArray()` (line 137) and the `$xtr` condition built by\n`getClForums()`. The same applies to the values of the `deleteAll`\ncheckbox array (line 272) used to build `$xtr` for the query at lines\n282 and 289. The parallel deletion code in bb_func_delmsg.php line 33\napplies `$post+=0` to the same kind of data.\n\n**Proof of Concept:**\n\n```bash\ncurl -b \"MODERATOR_COOKIES\" -H \"Referer: http://HOSTNAME/\"; \\\n  --data \"action=movepost&step=2&topicid=1&forum_id=1&topictitle=x&movedMsgs=1'+or+sleep(5)--\"\n\\\n  http://HOSTNAME/index.php\n```\n\nThe response is delayed by 5 seconds, confirming injection into `WHERE\npost_id='...'`.\n\n## Impact\n\nAn authenticated moderator can execute arbitrary SQL against the forum\ndatabase, including extraction of member records and password hashes.\n\nCVSS 3.1 base score: 5.5 Medium\n(`CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:L/A:N`).\n\n## Solution\n\nFixed in miniBB 3.8. Upgrade to 3.8 or later. To patch an older\ninstall by hand, cast each element to an integer before use, for\nexample `array_map('intval', explode(',', $_POST['movedMsgs']))`, and\ncast each `$_POST['deleteAll']` element as bb_func_delmsg.php already\ndoes.\n\n## Timeline\n\n- 2026-09-25: Reported to the miniBB maintainer, together with the\nother miniBB 3.7.2 issues.\n- 2026-10-01: The maintainer sent a pre-release with the fix (post IDs\nin `movedMsgs` and `deleteAll` are now cast to integers, and zero IDs\nare rejected). Fix verified.\n- 2026-11-20: Fixed in miniBB 3.8. Report published.\n\n## References\n\n- [miniBB 3.7.2 `deleteAll` Cross-Site\nScripting](https://fereidani.com/minibb-372-deleteall-cross-site-scripting-vulnerability)\n- [CWE-89: Improper Neutralization of Special Elements used in an SQL\nCommand ('SQL Injection')](https://cwe.mitre.org/data/definitions/89.html)\n- [miniBB - official website](https://www.minibb.com/)\n_______________________________________________\nSent through the Full Disclosure mailing list\nhttps://nmap.org/mailman/listinfo/fulldisclosure\nWeb Archives & RSS: https://seclists.org/fulldisclosure/"
        }
      ],
      "problemTypes": [
        {
          "descriptions": [
            {
              "cweId": "CWE-89",
              "description": "CWE-89",
              "lang": "en",
              "type": "CWE"
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-12-01T21:45:48Z",
        "orgId": "4e2abfbf-4a2a-4b76-a4e0-d77c18ba156c",
        "shortName": "VULNARCHIVE"
      },
      "references": [
        {
          "tags": [
            "technical-description",
            "exploit"
          ],
          "url": "https://vuln.freearchive.org/archive/full-disclosure/2026/Dec/10"
        },
        {
          "tags": [
            "technical-description"
          ],
          "url": "https://seclists.org/fulldisclosure/2026/Dec/10"
        },
        {
          "url": "http://HOSTNAME/\""
        },
        {
          "url": "http://HOSTNAME/index.php"
        },
        {
          "url": "https://cwe.mitre.org/data/definitions/89.html"
        },
        {
          "url": "https://fereidani.com/contact"
        },
        {
          "url": "https://fereidani.com/minibb-372-deleteall-cross-site-scripting-vulnerability"
        },
        {
          "url": "https://fereidani.com/minibb-372-movedmsgs-sql-injection-vulnerability"
        },
        {
          "url": "https://nmap.org/mailman/listinfo/fulldisclosure"
        },
        {
          "url": "https://seclists.org/fulldisclosure/"
        },
        {
          "url": "https://www.minibb.com/"
        }
      ],
      "source": {
        "defect": [
          "https://seclists.org/fulldisclosure/2026/Dec/10"
        ],
        "discovery": "EXTERNAL"
      },
      "title": "miniBB 3.7.2 `movedMsgs` SQL Injection Vulnerability",
      "x_gcve": [
        {
          "recordType": "advisory",
          "relationships": [],
          "vulnId": "GCVE-1988-2026-0586",
          "x_vulnarchive": {
            "archiveUrl": "https://vuln.freearchive.org/archive/full-disclosure/2026/Dec/10",
            "automated": true,
            "contentSha256": "991a5bc5ace0e9b3dc11a2f7c313cd2a0727545e0373f641b6fa08c9c73210a5",
            "evidenceScore": 11,
            "messageId": "",
            "originalUrl": "https://seclists.org/fulldisclosure/2026/Dec/10",
            "policy": "vulnarchive-1",
            "sourceFormat": "text/html",
            "sourcePublishedAt": "2026-11-20T13:23:40Z"
          }
        }
      ]
    }
  },
  "cveMetadata": {
    "assignerOrgId": "4e2abfbf-4a2a-4b76-a4e0-d77c18ba156c",
    "assignerShortName": "VULNARCHIVE",
    "datePublished": "2026-12-01T21:45:48Z",
    "dateUpdated": "2026-12-01T21:45:48Z",
    "state": "PUBLISHED",
    "vulnId": "GCVE-1988-2026-0586"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2"
}