Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F58886827
T389590.patch
BlankEclair (Claire Elaina)
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Authored By
BlankEclair
Mar 21 2025, 7:02 AM
2025-03-21 07:02:11 (UTC+0)
Size
2 KB
Referenced Files
None
Subscribers
None
T389590.patch
View Options
From b2653c074f6051896a24a26e68b9ce5e2e2de765 Mon Sep 17 00:00:00 2001
From: BlankEclair <blankeclair@disroot.org>
Date: Fri, 21 Mar 2025 17:55:01 +1100
Subject: [PATCH] SECURITY: Escape various interface messages
Bug: T389590
Change-Id: Ib59c59b2cd36928ab200149c851e2bfcf5cf920c
---
includes/AJAXPoll.php | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/includes/AJAXPoll.php b/includes/AJAXPoll.php
index b0a3d66..864e53c 100644
--- a/includes/AJAXPoll.php
+++ b/includes/AJAXPoll.php
@@ -371,7 +371,7 @@ During the last 48 hours, {$tab2->votes} votes have been given.";
$wgLang->timeanddate( $ts, true /* adjust? */ ),
$wgLang->date( $ts, true /* adjust? */ ),
$wgLang->time( $ts, true /* adjust? */ )
- )->escaped();
+ )->text();
$userVoted = true;
}
}
@@ -411,39 +411,41 @@ During the last 48 hours, {$tab2->votes} votes have been given.";
// or has not voted, or is entitled to vote
$canRevoke = false;
+ $messages = [];
if ( $user->isAllowed( 'ajaxpoll-vote' ) ) {
if ( isset( $row->poll_answer ) ) {
- $message = $ourLastVoteDate;
+ $messages[] = $ourLastVoteDate;
$canRevoke = true;
$lines[] = wfMessage( 'ajaxpoll-revoke-vote' )->text();
} else {
if ( $showResultsBeforeVoting ) {
- $message = wfMessage( 'ajaxpoll-no-vote' )->text();
+ $messages[] = wfMessage( 'ajaxpoll-no-vote' )->text();
} else {
- $message = wfMessage( 'ajaxpoll-no-vote-results-after-voting' )->text();
+ $messages[] = wfMessage( 'ajaxpoll-no-vote-results-after-voting' )->text();
}
}
} else {
- $message = wfMessage( 'ajaxpoll-vote-permission' )->text();
+ $messages[] = wfMessage( 'ajaxpoll-vote-permission' )->text();
}
if ( !$user->isAllowed( 'ajaxpoll-view-results' ) ) {
- $message .= '<br/>' . wfMessage( 'ajaxpoll-view-results-permission' )->text();
+ $messages[] = wfMessage( 'ajaxpoll-view-results-permission' )->text();
} elseif ( !$userVoted
&& !$user->isAllowed( 'ajaxpoll-view-results-before-vote' )
&& !$showResultsBeforeVoting
) {
if ( $user->isAllowed( 'ajaxpoll-vote' ) ) {
- $message .= '<br/>' . wfMessage( 'ajaxpoll-view-results-before-vote-permission' )->text();
+ $messages[] = wfMessage( 'ajaxpoll-view-results-before-vote-permission' )->text();
} else {
- $message .= '<br/>' . wfMessage( 'ajaxpoll-view-results-permission' )->text();
+ $messages[] = wfMessage( 'ajaxpoll-view-results-permission' )->text();
}
}
+ $escapedMessages = array_map( [ self::class, 'escapeContent' ], $messages );
$ret .= Html::rawElement( 'div',
[ 'class' => 'ajaxpoll-misc' ],
- $message
+ implode( '<br/>', $escapedMessages )
);
$ret .= Html::rawElement( 'form',
--
2.48.1
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
19489891
Default Alt Text
T389590.patch (2 KB)
Attached To
Mode
T389590: CVE-2025-32070:XSSes in AJAXPoll
Attached
Detach File
Event Timeline
Log In to Comment