Summary
A stored cross-site scripting vulnerability in the MediaWiki EmbedVideo Extension allows user-supplied class values to inject HTML attributes or markup into rendered video elements.
A user who can edit a wiki page may store JavaScript that executes in the browsers of visitors who view the affected content, particularly when the class value is rendered without adequate output encoding.
Affected context
The issue occurs in MediaWiki installations using the EmbedVideo Extension before its security fix, when the extension renders user-controlled class values while constructing figure elements. It becomes risky where an attacker can edit or otherwise influence wiki content and visitors subsequently render the affected embedded media.
Exploit preconditions
- Attack surface: MediaWiki page content processed by the EmbedVideo parser function or related parser tags
- Required access: Permission to edit or submit wiki content that can reach the affected rendering path
- Trigger point: Rendering an embedded video whose class value is included in the generated figure element
- Why exploitation is possible: The class value is inserted into an HTML template without sufficient contextual output encoding, allowing attribute boundaries or markup to be altered
Why this happens
The underlying bug is improper neutralization of user-controlled data in an HTML attribute context. The formatter passes the supplied class value directly into a string-formatting operation used to build markup, allowing special characters to change the structure of the generated HTML.
This maps to CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), specifically a stored XSS pattern in which attacker-controlled content is persisted and later delivered to other users.
Potential impact
- JavaScript may execute in the security context of visitors viewing affected pages
- Session information or page data could be exposed, subject to browser and application controls
- Attackers could alter rendered content or perform actions on behalf of users
- Administrative visitors could be targeted for broader wiki or configuration changes
- The wiki's trust and content integrity could be undermined
General mitigation guidance
Mitigation generally focuses on treating all editable wiki content as untrusted and applying context-appropriate output encoding at the point where HTML is generated.
Common defensive patterns include:
- Encode attribute values with an HTML attribute-context encoder rather than interpolating them directly
- Prefer structured DOM or templating APIs that separate data from markup
- Restrict class values to an allowlisted set of expected tokens
- Apply validation before rendering while retaining output encoding as a separate control
- Limit page-editing privileges and review untrusted embedded-media content
- Use a restrictive Content Security Policy as defense in depth
How teams detect issues like this
Detection can include static analysis for string formatting or template interpolation of user-controlled values in HTML attributes, especially where encoding is absent or applied in the wrong context. Code review should examine parser functions, formatter classes, and extension hooks that transform editable wiki content into markup.
Runtime monitoring may look for unusual attribute values, unexpected event-handler attributes, or markup patterns in newly edited pages. CI policies can require context-aware output encoding and security tests for stored content rendered through extension-specific paths. Automated code review tools may help identify direct interpolation into HTML construction.

