/

CVE-2025-61682

Severity:

HIGH RISK

(8.6)

Stored XSS (CWE-79) in Semantic MediaWiki Extension

CVE-2025-61682

Awaiting Analysis

Vulnerability type

Category:

Stored Cross-Site Scripting

CWE:

CWE-79

Impact:

Client-side code execution in a victim's browser

Severity:

HIGH RISK

(8.6)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Semantic MediaWiki contains a stored cross-site scripting vulnerability caused by inserting an unsanitized data attribute into the page DOM as HTML. An attacker who can place crafted wikitext in a wiki page may cause malicious script content to execute when other users view the affected page.

Affected context

The issue affects Semantic MediaWiki deployments using versions in the affected release range where data attributes from wikitext are rendered as HTML without adequate output encoding. Risk depends on whether an attacker can create or modify relevant wiki content and whether other users, including privileged administrators, view the resulting page.

Exploit preconditions

  • Attack surface: Wiki page rendering and DOM insertion
  • Required access: Permission to create or edit content containing the relevant data attribute
  • Trigger point: A victim views the stored page through the affected rendering path
  • Why exploitation is possible: User-controlled attribute content is inserted into the DOM as HTML without sufficient context-aware sanitization or encoding

Why this happens

The vulnerability results from treating user-controlled wikitext data as trusted HTML during page rendering. When an unsanitized attribute value is inserted into the DOM, markup or script-bearing content can be interpreted by the browser rather than displayed as inert text. This maps to CWE-79: Improper Neutralization of Input During Web Page Generation, commonly known as cross-site scripting.

Potential impact

  • Malicious script may execute in a victim's browser under the wiki's origin
  • An attacker could access page content available to the victim
  • User actions could be performed through the victim's authenticated session
  • Privileged users could be targeted for administrative or content-integrity impact
  • Wiki pages or stored data could be altered or abused for phishing

General mitigation guidance

Mitigation generally focuses on ensuring that user-controlled values remain data throughout rendering.

Common defensive patterns include:

  • Applying context-aware output encoding before inserting values into HTML or the DOM
  • Using safe DOM text APIs instead of HTML interpretation APIs when markup is not required
  • Restricting and validating data attributes against an explicit schema and allowed-value set
  • Applying narrowly scoped HTML sanitization when trusted markup is an actual requirement
  • Enforcing a restrictive Content Security Policy as a defense-in-depth control
  • Limiting page-editing privileges and using least-privilege access policies
  • Including security regression tests for stored content and privileged-user viewing paths

How teams detect issues like this

Detection can combine source review, automated analysis, and runtime testing:

  • Search for user-controlled wikitext or attribute values passed to HTML construction or DOM HTML insertion APIs
  • Review template, parser, and renderer code for missing context-aware encoding
  • Use static analysis rules that flag direct interpolation into HTML and unsafe DOM sinks
  • Test stored-content flows with benign markup and script-context markers in isolated environments
  • Monitor content changes and rendered responses for unexpected HTML or script-bearing elements
  • Enforce code-review and CI policies requiring approved encoding and sanitization utilities

Sources

SourceLink
github.comgithub.com/SemanticMediaWiki/SemanticMediaWiki/releases/tag/7.0.0
github.comgithub.com/SemanticMediaWiki/SemanticMediaWiki/security/advisories/GHSA-hg8h-557g-q8pp

Frequently asked

questions

It can be exploitable through normal wiki interactions when an attacker can submit or modify affected wikitext and a victim later views the stored content. The exact scope depends on editing permissions and deployment configuration.

Not necessarily. Anonymous exploitation may be possible where anonymous users can edit relevant content, while other configurations require an authenticated account with appropriate page-editing permissions.

Ensure user-controlled values are contextually encoded and inserted as text rather than interpreted as HTML. If limited markup is required, use a narrowly defined sanitizer and allowlist.

Treat all wiki content as untrusted, apply consistent output-encoding standards, review HTML and DOM sinks, use security-focused regression tests, and restrict editing privileges according to least privilege.

Find out what's already
exploitable in your codebase.