From 48e151fa5aa3ef9cdd95851b5e8fe35b734796db Mon Sep 17 00:00:00 2001
From: Brian Wolff <bawolff+wn@gmail.com>
Date: Tue, 3 Oct 2023 09:36:51 -0500
Subject: [PATCH] SECURITY: Ensure group name is escaped in user rights log

This fixes issue where group-*-member messages are output with
incorrect escaping.

Bug: T34772
---
 includes/logging/RightsLogFormatter.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/includes/logging/RightsLogFormatter.php b/includes/logging/RightsLogFormatter.php
index 95f9a24fb96..45893dca4d9 100644
--- a/includes/logging/RightsLogFormatter.php
+++ b/includes/logging/RightsLogFormatter.php
@@ -146,7 +146,7 @@ class RightsLogFormatter extends LogFormatter {
 					$expiryFormatted, $expiryFormattedD, $expiryFormattedT )->parse();
 			} else {
 				// the right does not expire; just insert the group name
-				$permList[] = $group;
+				$permList[] = htmlspecialchars( $group );
 			}
 
 			next( $groups );
-- 
2.39.3 (Apple Git-145)

