Summary
A stored cross-site scripting vulnerability in the MediaWiki EmbedVideo Extension allows a wiki editor to inject script-related markup through accepted video service identifiers or URLs.
When visitors render a page containing the crafted embed, the injected code may execute in the wiki origin where the page is viewed.
Affected context
The issue occurs in EmbedVideo deployments that use the default consent-related configuration and generate iframe configuration data inside an HTML attribute without safely escaping single quotes. It affects rendering paths that process attacker-controlled archive.org identifiers or wistia and sharepoint URLs accepted by the corresponding service validators. A user who can edit wiki pages may be able to persist malicious input for execution when other users view the page.
Exploit preconditions
- Attack surface: MediaWiki page editing and EmbedVideo parser rendering
- Required access: Permission to edit or otherwise store content on a wiki page
- Trigger point: Rendering an affected video embed for a visitor
- Why exploitation is possible: Service-derived URL data is serialized into an HTML attribute without context-appropriate escaping, allowing attacker-controlled content to alter the generated element structure
Why this happens
The vulnerability is caused by placing JSON-derived service data into an HTML attribute without safely encoding characters that have meaning in the surrounding attribute context.
When single quotes are not escaped appropriately, attacker-controlled URL or identifier content can terminate the intended attribute value and introduce additional markup, including event-handler attributes. This is a stored cross-site scripting flaw mapped to CWE-79: Improper Neutralization of Input During Web Page Generation.
Potential impact
- An attacker may execute JavaScript in the wiki origin when a crafted page is viewed.
- The script could access data available to the victim's wiki session, subject to browser and application controls.
- The attacker could perform actions on behalf of affected users if applicable permissions and defenses allow it.
- The vulnerability could enable phishing, page manipulation, or unauthorized content changes.
General mitigation guidance
Mitigation generally focuses on applying context-aware output encoding at every HTML and attribute boundary.
Common defensive patterns include:
- Encode dynamic values specifically for the target HTML attribute context rather than relying only on JSON serialization.
- Prefer safe DOM or templating APIs that separate data from markup.
- Validate service identifiers and URLs using strict allowlists and canonicalized formats.
- Reduce trust in user-editable embed parameters and reject unexpected control characters or delimiters.
- Apply restrictive Content Security Policy controls where compatible with the wiki's functionality.
- Limit page-editing privileges and review untrusted embeds according to least-privilege principles.
How teams detect issues like this
Organizations can detect similar issues through:
- Static analysis for dynamic values inserted into HTML attributes without context-specific encoding.
- Code review checks covering parser functions, URL validators, JSON-to-HTML transformations, and generated event-handler attributes.
- Tests using delimiter characters and unexpected URL components to verify that output remains within its intended attribute.
- Content-security and web-application monitoring for unexpected inline event handlers or suspicious script execution in wiki pages.
- Policy enforcement requiring approved escaping and templating utilities for rendered user-controlled content.
Automated security review tools may help identify unsafe output contexts, but findings should be validated against the actual rendering behavior.

