/

CVE-2026-45115

Severity:

HIGH RISK

(8.7)

Stored XSS (CWE-79) in MyBB Buddy/Ignore Components

CVE-2026-45115

Deferred

Vulnerability type

Category:

Cross-Site Scripting

CWE:

CWE-79

Impact:

Client-side code execution and user-interface compromise

Severity:

HIGH RISK

(8.7)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

MyBB contains a username-based cross-site scripting vulnerability in the Buddy/Ignore and Private Messages Select Buddies features. A specially crafted username may be rendered with an unescaped single quote, allowing script execution when a victim removes the user or selects the username from the affected interface.

Affected context

The issue occurs in MyBB installations that use the affected Buddy/Ignore and Private Messages workflows to display usernames in HTML or JavaScript event-handler contexts. Risk is higher when an attacker can create or control a username and a victim with an active session interacts with the confirmation dialog or Select Buddies popup.

Exploit preconditions

  • Attack surface: User Control Panel Buddy/Ignore lists and the Private Messages Select Buddies popup
  • Required access: The ability to register or otherwise control a username that is displayed by these features
  • Trigger point: A victim removes the username and confirms the action, or selects it through the popup
  • Why exploitation is possible: Username output is not safely encoded for every surrounding context, allowing a crafted single quote to affect generated markup or an event-handler expression

Why this happens

The vulnerability results from context-incomplete output encoding. Although usernames are passed through htmlspecialchars_uni(), the resulting encoding may leave single quotes unsafe for the JavaScript or quoted-attribute contexts used by the affected Buddy/Ignore and Select Buddies interfaces. This allows attacker-controlled username data to alter client-side code execution paths, mapping to CWE-79: Improper Neutralization of Input During Web Page Generation.

Potential impact

  • An attacker may execute JavaScript in a victim's browser
  • The script could perform actions using the victim's authenticated session
  • Sensitive information displayed in the affected origin could be exposed
  • User-interface content or workflow behavior could be modified
  • Additional accounts or users could be targeted through stored malicious usernames

General mitigation guidance

Mitigation generally focuses on treating usernames as untrusted data in every output context.

Common defensive patterns include:

  • Applying context-appropriate output encoding for HTML text, HTML attributes, and JavaScript values
  • Avoiding direct insertion of user-controlled data into inline event handlers
  • Passing values through data attributes or structured DOM APIs instead of constructing code strings
  • Enforcing server-side username validation and restricting unsafe characters where compatible with application requirements
  • Using a restrictive Content Security Policy to reduce the impact of script injection
  • Applying least privilege to authenticated sessions and sensitive user-management actions

How teams detect issues like this

Organizations can look for this class of issue through:

  • Static analysis rules identifying user-controlled values inserted into HTML attributes, JavaScript strings, or inline event handlers
  • Code review checks for encoding functions that do not match the output context
  • Tests using usernames containing quotes and other delimiter characters across Buddy/Ignore and Private Messages workflows
  • Dynamic testing that observes whether controlled usernames alter generated markup or execute as script in a browser
  • Content Security Policy reporting and web-application monitoring for unexpected inline script activity

Automated security review tools may help identify unsafe output construction, but findings should be validated against the actual rendering context.

Sources

SourceLink
github.comgithub.com/mybb/mybb/releases/tag/mybb_1840
github.comgithub.com/mybb/mybb/security/advisories/GHSA-p766-qqxv-rfc2
mybb.commybb.com/versions/1.8.40

Frequently asked

questions

It can be exploitable through the web application when an attacker can control a username and a victim later interacts with an affected Buddy/Ignore or Select Buddies workflow.

The key requirement is the ability to create or control a username that is subsequently displayed. A victim generally must also have an authenticated session and trigger the vulnerable interface action.

Encode output according to its exact destination context, avoid placing user-controlled values in inline JavaScript, and use safe DOM or structured data APIs for UI interactions.

Combine context-aware output encoding, constrained input validation, browser security policies, security-focused review of event handlers, and automated tests covering delimiter characters in user-controlled fields.

Find out what's already
exploitable in your codebase.