# CVE-2023-46251: Visual editor persistent Cross-site Scripting (XSS) in MyBB

> Attackers can execute arbitrary scripts in victims' browsers via malicious MyCode in the visual editor, potentially leading to account takeover.

- **Severity:** High 7.5 (`CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 6 Nov 2023
- **Updated:** 4 Sep 2024
- **Also known as:** BIT-mybb-2023-46251, GHSA-wj33-q7vj-9fr8

## What is CVE-2023-46251?

CVE-2023-46251 is a high-severity cross-site scripting vulnerability in Mybb Mybb, published on 6 Nov 2023. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

MyBB is a free and open source forum software. Custom MyCode (BBCode) for the visual editor (_SCEditor_) doesn't escape input properly when rendering HTML, resulting in a DOM-based XSS vulnerability. This weakness can be exploited by pointing a victim to a page where the visual editor is active (e.g. as a post or Private Message) and operates on a maliciously crafted MyCode message. This may occur on pages where message content is pre-filled using a GET/POST parameter, or on reply pages where a previously saved malicious message is quoted. The impact is be mitigated when: 1. the visual editor is disabled globally (_Admin CP → Configuration → Settings → Clickable Smilies and BB Code: [Clickable MyCode Editor](https://github.com/mybb/mybb/blob/mybb_1836/install/resources/settings.xml#L2087-L2094)_ is set to _Off_), or 2. the visual editor is disabled for individual user accounts (_User CP → Your Profile → Edit Options_: _Show the MyCode formatting options on the posting pages_ checkbox is not checked). MyBB 1.8.37 resolves this issue with the commit `6dcaf0b4d`. Users are advised to upgrade. Users unable to upgrade may mitigate the impact without upgrading MyBB by changing the following setting (_Admin CP → Configuration → Settings_):
- _Clickable Smilies and BB Code → [Clickable MyCode Editor](https://github.com/mybb/mybb/blob/mybb_1836/install/resources/settings.xml#L2087-L2094)_: _Off_. Similarly, individual MyBB forum users are able to disable the visual editor by diabling the account option (_User CP → Your Profile → Edit Options_) _Show the MyCode formatting options on the posting pages_.

Weakness: CWE-79 (Improper Neutralization of Input During Web Page Generation)

## Which versions are affected by CVE-2023-46251?

1 open source package ship an affected version, including mybb. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `mybb` | Bitnami | All versions | 1.8.37 |

Products: Mybb Mybb.

## How do I fix CVE-2023-46251?

Upgrade mybb to 1.8.37 or later.

## Is CVE-2023-46251 being exploited?

There is no known exploitation of CVE-2023-46251 in the wild and no public exploit code.

## Other vulnerabilities in Mybb Mybb

- [CVE-2011-10018](https://insights.sbomify.com/CVE-2011-10018/): myBB 1.6.4 Backdoor Arbitrary Command Execution (critical 10.0)
- [CVE-2015-2786](https://insights.sbomify.com/CVE-2015-2786/): Information disclosure in n/a (critical 10.0)
- [CVE-2011-5133](https://insights.sbomify.com/CVE-2011-5133/): Cross-site scripting in n/a (critical 10.0)
- [CVE-2006-0218](https://insights.sbomify.com/CVE-2006-0218/): SQL injection in n/a (critical 10.0)
- [CVE-2020-22612](https://insights.sbomify.com/CVE-2020-22612/): Code injection in n/a (critical 9.8)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-46251 and fix it if it is affected.

What it is: CVE-2023-46251 is a high-severity cross-site scripting vulnerability in Mybb Mybb, published on 6 Nov 2023. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2023-46251 in the wild and no public exploit code.

Affected packages and fixed versions:
- mybb (Bitnami): affected all versions; fixed in 1.8.37

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2023-46251/ (Markdown: https://insights.sbomify.com/CVE-2023-46251/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2023-46251
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2023-46251
- OSV: https://osv.dev/vulnerability/CVE-2023-46251

---
From sbomify Insights: https://insights.sbomify.com/CVE-2023-46251/
Summaries are generated and may contain mistakes; the official description above is the record.
