/

CVE-2026-45118

Severity:

CRITICAL RISK

(9.3)

Reflected XSS (CWE-83) in MyBB Contact Module Redirect

CVE-2026-45118

Deferred

Vulnerability type

Category:

Reflected Cross-Site Scripting

CWE:

CWE-83

Impact:

Client-side script execution and open redirect

Severity:

CRITICAL RISK

(9.3)

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's Contact module insufficiently validates redirect targets supplied through a request parameter or the HTTP Referer header. An attacker may use a JavaScript URI to cause reflected script execution when a victim follows the module's delayed redirect link, while the same weakness also enables open redirects.

Affected context

The issue occurs in MyBB Contact module deployments before the corrected behavior was introduced, when the module accepts a redirect destination from the from HTTP parameter or the Referer header. Risk is present when that value is passed to redirect handling without strict protocol and destination validation, particularly when the generated page exposes a user-activated continuation link.

Exploit preconditions

  • Attack surface: The MyBB Contact module and its redirect-handling flow
  • Required access: No authenticated account is generally required; the attacker needs to deliver a crafted request or link to a victim
  • Trigger point: The victim selects the generated "Click here if you don't want to wait any longer" link
  • Why exploitation is possible: Attacker-controlled redirect data can be used as a JavaScript URI because protocol validation and output handling do not sufficiently restrict the value before it is rendered or followed

Why this happens

The underlying bug is inadequate validation of a user-influenced redirect target. The application treats values from request input or the Referer header as trusted navigation data and passes them through redirect processing without enforcing an allowed protocol and destination policy. This behavior maps to CWE-83, which covers improper neutralization of script-related HTML content, and is also associated with open redirect handling when arbitrary external destinations are accepted.

Potential impact

  • A victim's browser may execute attacker-controlled JavaScript in the context of the MyBB site
  • An attacker could potentially access or modify data available to client-side scripts
  • Authentication-related information or other sensitive browser data could be exposed depending on application context
  • Users could be redirected to phishing or malware-hosting destinations
  • The issue could support social engineering and loss of trust in forum links

General mitigation guidance

Mitigation generally focuses on separating navigation data from executable content and reducing trust in client-controlled redirect values.

Common defensive patterns include:

  • Allowing only explicitly approved relative paths or same-origin destinations
  • Accepting only safe protocols such as HTTPS where absolute URLs are necessary
  • Rejecting or canonicalizing unexpected schemes, control characters, encoded variants, and malformed URLs
  • Encoding redirect values for their specific output context rather than inserting them into active markup or script-capable locations
  • Avoiding automatic continuation links that reflect untrusted destinations
  • Applying least privilege and defense-in-depth browser security policies where appropriate

These controls address both script injection and arbitrary external redirection without relying on the destination supplied by the client.

How teams detect issues like this

Organizations can look for this weakness through:

  • Static analysis rules that identify request parameters or headers flowing into redirect functions or HTML output
  • Code review checks for redirects that accept Referer, query parameters, or other client-controlled values
  • Tests covering JavaScript, data, protocol-relative, encoded, malformed, and external URL schemes
  • Dynamic scanning that verifies whether crafted redirect values are reflected into continuation links or browser-executable contexts
  • Policy enforcement requiring allowlisted navigation targets and context-appropriate output encoding

Automated security review tools may help identify client-controlled URL flows, but findings should be confirmed against the application's actual rendering and redirect behavior.

Sources

SourceLink
github.comgithub.com/mybb/mybb/releases/tag/mybb_1840
github.comgithub.com/mybb/mybb/security/advisories/GHSA-wf92-5q5h-qr53
mybb.commybb.com/versions/1.8.40

Frequently asked

questions

Yes, exploitation can generally be initiated remotely by sending a crafted request or link to a victim. Successful script execution still depends on the victim selecting the affected continuation link.

The described attack does not generally require an authenticated account. The important conditions are access to the Contact module and the ability to influence the redirect value delivered to the victim.

Treat redirect destinations as untrusted, allow only approved same-origin or relative paths, restrict protocols, and ensure values cannot be interpreted as executable content.

Use centralized, allowlisted redirect handling; apply context-aware output encoding; test dangerous URL schemes and encoding variations; and include client-controlled URL flows in code review and automated security checks.

Find out what's already
exploitable in your codebase.