Skip to content

SLOP-374: escape ?page= reflection in Special:PageStatistics (reflected XSS) - #6

Open
tosfos wants to merge 1 commit into
masterfrom
SLOP-374-escape-pagestatistics-xss
Open

SLOP-374: escape ?page= reflection in Special:PageStatistics (reflected XSS)#6
tosfos wants to merge 1 commit into
masterfrom
SLOP-374-escape-pagestatistics-xss

Conversation

@tosfos

@tosfos tosfos commented Aug 23, 2026

Copy link
Copy Markdown

Summary

Special:PageStatistics (viewable by all users) echoed the raw ?page= request parameter into $wgOut->addHTML() when the requested title doesn't exist or isn't watchable:

$wgOut->addHTML( "<p>\"$requestedPage\" is either not a page or is not watchable</p>" );

A link like Special:PageStatistics?page=<img src=x onerror=alert(1)> executes attacker script in the wiki domain (classic reflected XSS). The fix escapes with htmlspecialchars( $requestedPage, ENT_QUOTES ) — the value still renders as text, but can no longer break out into markup.

Verification

  • php -l clean on php:7.4-cli and php:8.2-cli.
  • Harness on 8.2: OLD output contains raw <img ...> markup; NEW output contains only &lt;img escaped form and zero raw tag openers.

Closes SLOP-374.

…ed XSS)

The not-a-page error message interpolated the raw request parameter
into addHTML; escape it with htmlspecialchars(ENT_QUOTES).
@coderabbitai

coderabbitai Bot commented Aug 23, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1a05db2d-610f-4a3c-9d83-572dcb466a81


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant