# CVE-2026-77610: Semantic MediaWiki has a query debug output XSS (`DebugFormatter`)

> CVE-2026-77610 (GitHub advisory GHSA-q5fm-9mx6-44f4) is a medium-severity vulnerability with a CVSS 3.1 base score of 6.1, classed as Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (CWE-79), in mediawiki/semantic-media-wiki (Packagist). Affected versions: <= 7.1.0. It is fixed in 7.2.0.

Canonical page: https://cveminer.com/vulnerabilities/CVE-2026-77610

| Field | Value |
| --- | --- |
| CVE | CVE-2026-77610 |
| GHSA | GHSA-q5fm-9mx6-44f4 |
| Severity | Medium |
| CVSS 3.1 | 6.1 `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N` (GitHub Advisory Database) |
| CWE | CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') |
| EPSS | 0.15% (higher than 5% of CVEs) |
| CISA KEV | Not listed |
| Published | 18 Sept 2026 |
| Modified | 18 Sept 2026 |

## Description

#### Query debug output XSS

###### Failure mode

Semantic MediaWiki's query debug output (`format=debug`, or the `debug` request parameter on `Special:Ask`) is assembled by `SMW\Query\DebugFormatter` and emitted as raw HTML. Several of its sinks apply no output-context encoding, so attacker-controlled query input is reflected into the page without escaping:

- `buildHTML()` echoes the re-serialized ASK query string escaping only `[`; `<`, `>`, `"`, `'` pass through.
- `prettifySQL()` returns the generated SQL verbatim. Query value literals are inlined into the SQL through the database layer's quoting (SQL-escaping only, no HTML encoding), so markup in a value survives.
- `prettifyExplain()` echoes `EXPLAIN` output; on PostgreSQL the plan text contains the `WHERE` literals.

On `Special:Ask` the resulting string is concatenated into the page and sent through `OutputPage::addHTML`, never through the MediaWiki parser or Sanitizer. No special user right is required; an anonymous request suffices.

This is a reflected XSS: the payload is taken from the request and echoed in the same response. Exploitation requires the query condition to target a text/blob-typed property (whose value is re-serialized verbatim); the predefined `_txt` properties (`Text`, etc.) that ship on every install satisfy this, so no attacker-created content is needed. Example request:

```
Special:Ask?q=[[Text::<script>alert(document.domain)</script>]]&debug=1
```

###### Remediation

- Apply output-context escaping at the `DebugFormatter` boundary. The `buildHTML()` contract already assumes its inputs are HTML-safe, but its callers do not honour that; escape each entry value on emission, and the SQL and `EXPLAIN` strings before they are wrapped.
- Escaping only the query-string echo is insufficient: `prettifySQL()` and the "Auxilliary Tables" executed-query text carry the same attacker-controlled literals.

###### Scope

The `prettifySPARQL()` sink already encodes `<` and `>` and is not affected. The same debug path is also reachable through inline `{{#ask:...|format=debug}}`, but that output returns into parser context and is sanitized there; the reflected `Special:Ask` path is the exposed sink.

###### Relationship to GHSA-5jhc-3j2f-52rv

This issue was identified while splitting the consolidated report GHSA-5jhc-3j2f-52rv into per-vulnerability advisories. It is distinct from the four items in that report (plain table header, `sep`, `SearchByProperty` value, open redirect) and from `Special:Ask` form-input XSS (which is escaped separately).

## Affected packages

| Package | Ecosystem | PURL | Vulnerable versions | Fixed in |
| --- | --- | --- | --- | --- |
| mediawiki/semantic-media-wiki | Packagist | `pkg:composer/mediawiki/semantic-media-wiki` | <= 7.1.0 | 7.2.0 |

## Fix commits

- Release: https://github.com/semanticmediawiki/semanticmediawiki/commit/0d11c070bbe64f4425e3ab8be89eefa926dd9e4e (7.2.0)

## Questions

**What is the GHSA ID for CVE-2026-77610?**

GitHub tracks CVE-2026-77610 as GHSA-q5fm-9mx6-44f4.

**What is the CVSS score of CVE-2026-77610?**

CVE-2026-77610 has a CVSS 3.1 base score of 6.1 (Medium), vector CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N.

**Which versions are affected by CVE-2026-77610?**

mediawiki/semantic-media-wiki (Packagist): <= 7.1.0.

**How do I fix CVE-2026-77610?**

Upgrade to 7.2.0 or later.

**What is the Package URL (PURL) for CVE-2026-77610?**

The affected package's PURL is pkg:composer/mediawiki/semantic-media-wiki.

**Is CVE-2026-77610 exploited in the wild?**

CISA's Known Exploited Vulnerabilities catalog doesn't list CVE-2026-77610. That means no confirmed exploitation has been catalogued, not that it is safe to leave unpatched. EPSS estimates a 0.15% chance of exploitation in the next 30 days, higher than 5% of CVEs.

## References

- https://github.com/SemanticMediaWiki/SemanticMediaWiki/security/advisories/GHSA-q5fm-9mx6-44f4 (advisory)
- https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/77xxx/CVE-2026-77610.json (advisory)
- https://nvd.nist.gov/vuln/detail/CVE-2026-77610 (advisory)
- https://github.com/advisories/GHSA-q5fm-9mx6-44f4 (advisory)
- https://github.com/SemanticMediaWiki/SemanticMediaWiki (package)
- https://github.com/SemanticMediaWiki/SemanticMediaWiki/releases/tag/7.2.0

---

Source: CVEminer (https://cveminer.com/vulnerabilities/CVE-2026-77610), compiled from OSV (GitHub advisory), GitHub Advisory Database, OSV (CVE record), CVE.org, CISA KEV catalog. OSV and GitHub Advisory Database content is licensed CC BY 4.0.
