This bug was reported to security@ by Sheldon Menezes (samymenezes33@gmail.com)
Steps to reproduce:
- write '><script>alert(document.domain)</script> in a search box
- the response will evaluate the javascript
This bug was reported to security@ by Sheldon Menezes (samymenezes33@gmail.com)
Steps to reproduce:
From 9869e7b749eb51bddee41cc713c69eacf47b3284 Mon Sep 17 00:00:00 2001 From: David Causse <dcausse@wikimedia.org> Date: Fri, 14 Oct 2022 11:40:47 +0200 Subject: [PATCH] Fix XSS in DYM Bug: T320785 Change-Id: Ib9e2da2291b9936f3f1646322c9a14acec37738c --- includes/search/searchwidgets/DidYouMeanWidget.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/search/searchwidgets/DidYouMeanWidget.php b/includes/search/searchwidgets/DidYouMeanWidget.php index 9dd4e1f6683..a3728902220 100644 --- a/includes/search/searchwidgets/DidYouMeanWidget.php +++ b/includes/search/searchwidgets/DidYouMeanWidget.php @@ -78,7 +78,8 @@ class DidYouMeanWidget { $original = $term; return $this->specialSearch->msg( 'search-rewritten' ) - ->rawParams( $rewritten, $original ) + ->rawParams( $rewritten ) + ->params( $original ) ->escaped(); } -- 2.34.1
The above patch has been deployed to all wmf production wikis.
It is stored in /srv/patches/1.40.0-wmf.5/core/T320785.patch on deploy1002
The problem was introduced in 1.40.0-wmf.5 by https://gerrit.wikimedia.org/r/c/mediawiki/core/+/824123.
@sbassett is it ok to push the patch through gerrit and make this task public? It is a recent regression and only master is affected and prod has been patched.
Normally we'd hold something like this for the next security release (T318964), but since it should have only ever made it to 1.40, I think it's fine to get this merged so the patch can fall off next week (assuming it gets merged today or Monday).
Change 842818 had a related patch set uploaded (by Zabe; author: DCausse):
[mediawiki/core@master] SECURITY: Fix XSS in DYM
Change 842818 merged by jenkins-bot:
[mediawiki/core@master] SECURITY: Fix XSS in DYM
Running the train today for 1.40.0-wmf.6 shows the patch already got applied.
[ALREADY APPLIED] /srv/patches/1.40.0-wmf.6/core/01-T320785.patch
It got merged in master last week and made its way in 1.40.0-wmf.6. I have removed the patch from the /srv/patches repository.
Change 852935 had a related patch set uploaded (by SBassett; author: SBassett):
[wikimedia/security/landing-page@master] Add Sheldon Menezes to security hall of fame for reporting XSS in Special:Search
Change 852935 merged by jenkins-bot:
[wikimedia/security/landing-page@master] Add Sheldon Menezes to security hall of fame for reporting XSS in Special:Search
Change 854107 had a related patch set uploaded (by SBassett; author: SBassett):
[wikimedia/security/landing-page@master] Add Sheldon Menezes to security hall of fame (build step)
Change 854107 merged by jenkins-bot:
[wikimedia/security/landing-page@master] Add Sheldon Menezes to security hall of fame (build step)