/

CVE-2026-45116

Severity:

HIGH RISK

(8.7)

Stored XSS (CWE-79) in MyBB User Profile Field Data

CVE-2026-45116

Deferred

Vulnerability type

Category:

Cross-Site Scripting

CWE:

CWE-79

Impact:

Stored Cross-Site Scripting and unauthorized browser-side actions

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 stored cross-site scripting vulnerability in checkbox and multiselect profile fields because certain malformed values bypass specialized validation and are stored as text. When the affected profile data is later rendered, an attacker may cause JavaScript to execute in the browsers of users viewing the content.

Affected context

The issue occurs in MyBB installations using profile fields configured as checkbox or multiselect types. It becomes risky when profile-field input can be submitted or altered in a form that produces a scalar value instead of the expected array structure, allowing the value to bypass specialized validation before being rendered by profile and post-related application code.

Exploit preconditions

  • Attack surface: MyBB profile-field input and subsequent profile or post rendering
  • Required access: An account or other permitted path able to submit a profile-field value; the exact requirement depends on forum configuration
  • Trigger point: Validation and storage of a checkbox or multiselect profile-field value, followed by display to another user
  • Why exploitation is possible: Scalar input falls through to generic text handling, is stored without the intended field-specific verification, and is later rendered without an appropriate safe output context

Why this happens

The underlying bug is an input-type validation failure mapped to CWE-79, Cross-Site Scripting. UserDataHandler::verify_profile_fields() performs specialized validation only when the supplied profile-field value is an array. A scalar value therefore follows a generic text-processing path even when the configured field expects an array, and the resulting data can be rendered directly rather than safely encoded for its output context. The insecure pattern is trusting request shape to select validation logic and treating stored user-controlled data as safe markup or script-capable output.

Potential impact

  • JavaScript could execute in the browsers of users viewing affected content
  • An attacker could perform actions through a victim's authenticated session
  • Account or forum data could be exposed or modified
  • Administrative users could be targeted for privilege-impacting actions
  • Malicious content could persist and affect multiple viewers

General mitigation guidance

Mitigation generally focuses on validating profile-field values according to

their configured type regardless of whether the submitted value is scalar or

array-shaped.

Common defensive patterns include:

  • Enforcing strict type, cardinality, and allowed-value checks before storage
  • Applying context-appropriate output encoding at every rendering sink
  • Treating all profile-field data as untrusted, including previously stored values
  • Avoiding direct insertion of user-controlled values into HTML or script-capable contexts
  • Using secure-by-default templating and encoding APIs
  • Limiting profile-field modification rights according to least privilege
  • Reviewing and safely handling legacy stored values during display and maintenance workflows

How teams detect issues like this

Organizations can look for this weakness through:

  • Static analysis rules that identify user-controlled values reaching HTML-rendering sinks without contextual encoding
  • Code review checks comparing configured field types with validation branches and accepted request shapes
  • Tests that submit scalar, array, empty, repeated, and unexpected values to multiselect and checkbox fields
  • Policy enforcement requiring output encoding at template and response boundaries
  • Monitoring stored profile-field content for unexpected markup or script-like patterns, while recognizing that pattern matching is not a substitute for safe encoding
  • Automated security review tools that trace input from profile-field handlers to rendering functions

Sources

SourceLink
github.comgithub.com/mybb/mybb/commit/c32f0c22baab704a68b8d58fcdd2f26fadbbe19b
github.comgithub.com/mybb/mybb/releases/tag/mybb_1840
github.comgithub.com/mybb/mybb/security/advisories/GHSA-4p6g-p3qh-559v
mybb.commybb.com/versions/1.8.40

Frequently asked

questions

Yes. Once malicious data is stored, users may be affected when they view a profile, post, or other page that renders the vulnerable field.

Usually, some ability to submit or modify the affected profile field is required. Whether ordinary users can do so depends on forum permissions and profile-field configuration.

Validate values according to the configured field type for every input shape, then apply context-appropriate output encoding whenever stored values are rendered.

Use strict server-side validation, do not infer trust from request structure, treat stored data as untrusted, and include malformed-shape and output-encoding tests in code review and CI workflows.

Find out what's already
exploitable in your codebase.