Summary
A stored cross-site scripting vulnerability in the MediaWiki EmbedVideo extension allows a page editor to place attacker-controlled content into an error message for an unknown video service.
When visitors render the affected page, the unsanitized output may execute JavaScript in the wiki's origin.
Affected context
The issue occurs in EmbedVideo installations where an attacker who can edit wiki pages can reach the unknown-service error path through the #ev parser function or the evl parser form. The service name is incorporated into exception text, which can then be returned through an HTML output path without adequate neutralization.
Exploit preconditions
- Attack surface: User-editable wiki page content processed by the EmbedVideo extension
- Required access: Permission to edit or otherwise submit content that invokes the affected video embedding functionality
- Trigger point: Processing an unknown service name through the
#evparser function orevlparser form - Why exploitation is possible: Attacker-controlled text reaches an HTML response path without context-appropriate output encoding, allowing stored markup or script content to be rendered for later visitors
Why this happens
The underlying bug is improper neutralization of user-controlled data before it is returned as HTML. EmbedServiceFactory::newFromName includes the unknown service name in exception text, while the EmbedVideo output path exposes that text through isHtml without applying suitable HTML escaping.
This maps to CWE-79: Improper Neutralization of Input During Web Page Generation, because untrusted content is incorporated into rendered page output as though it were trusted markup.
Potential impact
- Malicious JavaScript could execute in visitors' wiki-origin sessions
- An attacker could perform actions on behalf of affected users, subject to their permissions
- Page content or user-facing wiki data could be modified
- Authentication-related information accessible to the browser could be exposed
- The wiki could be used to distribute further malicious content
General mitigation guidance
Mitigation generally focuses on preserving a strict separation between data and HTML output.
Common defensive patterns include:
- Applying context-appropriate HTML escaping to service names, exception messages, and other dynamic output
- Returning structured error data rather than concatenated HTML strings
- Using safe-by-default rendering APIs that treat dynamic values as text
- Validating service identifiers against an allowlist before processing them
- Restricting page-edit permissions according to least privilege
- Applying a restrictive content security policy where practical as defense in depth
How teams detect issues like this
Organizations commonly detect this class of issue through:
- Static analysis rules for string concatenation or interpolation into HTML output
- Code review checks for exception messages flowing into renderer or
isHtmlpaths - Tests that submit markup-like and script-like service names and verify encoded output
- Repository searches for parser functions and form handlers that render user-controlled values
- Policy enforcement requiring context-aware output encoding at web response boundaries
- Automated security review tools that trace tainted input into HTML sinks

