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.

