Summary
Ultimate Member for WordPress contains a stored cross-site scripting vulnerability in the form_id parameter because input is not sufficiently sanitized and output is not properly escaped. An unauthenticated attacker may store a script in user metadata, which can execute when an administrator opens the affected user record in the WordPress admin interface.
Affected context
The issue occurs in Ultimate Member installations where registration data containing the form_id parameter is saved in user metadata and later rendered in an administrative user-record modal. Risk is present when attacker-controlled values reach the stored submitted metadata and are inserted into the page through a browser HTML-rendering operation without context-appropriate escaping.
Exploit preconditions
- Attack surface: Public Ultimate Member registration functionality and the WordPress administrative user interface
- Required access: No authentication is generally required to submit the initial registration-related input
- Trigger point: An administrator opens the affected user record in the wp-admin Users modal
- Why exploitation is possible: Attacker-controlled data is stored in user metadata and later inserted as HTML without adequate sanitization or output escaping
Why this happens
The vulnerability is caused by accepting insufficiently constrained input and later rendering the stored value as HTML rather than as inert text. In particular, use of a jQuery .html() insertion path without context-appropriate escaping allows markup or script-bearing content to be interpreted by the browser. This behavior maps to CWE-79: Improper Neutralization of Input During Web Page Generation, commonly known as cross-site scripting.
Potential impact
- An attacker may execute arbitrary JavaScript in an administrator's browser
- Administrative session information or page data could be exposed
- Actions could be performed with the privileges of a targeted administrator
- The affected site's content, users, or configuration could be modified
- Additional users may be targeted if the stored value is rendered in other contexts
General mitigation guidance
Mitigation generally focuses on reducing trust in registration data and ensuring that every output context is handled safely.
Common defensive patterns include:
- Validate and constrain identifier-like parameters such as
form_idagainst an allowlist or expected format - Sanitize input at appropriate trust boundaries without treating sanitization as a substitute for output encoding
- Escape values for their actual output context, especially when rendering HTML, attributes, JavaScript, or URLs
- Prefer text-oriented DOM APIs such as
textContentwhen markup is not required, rather than inserting untrusted values as HTML - Apply consistent server-side authorization and data validation to administrative display paths
- Use restrictive Content Security Policy controls as an additional defense where practical
- Limit administrative privileges and protect administrator sessions with strong authentication controls
How teams detect issues like this
Organizations can look for this class of issue through:
- Static analysis rules identifying unescaped values passed to HTML-rendering functions such as
.html() - Code review checks tracing registration and profile inputs into user metadata and administrative views
- Tests that submit encoded markup and verify it is displayed as inert text in every rendering context
- Policy enforcement requiring context-aware output encoding and allowlisted validation for identifier fields
- Monitoring for unexpected script-bearing content in user metadata and administrative audit events
- Neutral automated security review tools that identify stored input-to-output flows for manual validation

