From d42de1b9760c1a0f47c018142f91a4b3459ebf55 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Wed, 20 May 2026 11:42:01 -0400 Subject: [PATCH 1/2] Bug 2034032 --- Bugzilla/Flag.pm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Bugzilla/Flag.pm b/Bugzilla/Flag.pm index 2bbf69e1cd..0bf683aede 100644 --- a/Bugzilla/Flag.pm +++ b/Bugzilla/Flag.pm @@ -1102,8 +1102,15 @@ sub notify { $recipients{$cc} = $ccuser; } - # Only notify if the addressee is allowed to receive the email. - if ($addressee && $addressee->email_enabled) { + # Only notify if the addressee is allowed to receive the email + # and can see the bug (prevents short_desc leaking via Subject/body). + if ( + $addressee + && $addressee->email_enabled + && ( (!scalar(@bug_in_groups) || $addressee->can_see_bug($bug->bug_id)) + && (!$attachment_is_private || $addressee->is_insider)) + ) + { $recipients{$addressee->email} = $addressee; } From 4ce5b6648fb00e0bd13314c0f8c535478ea52518 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Wed, 20 May 2026 12:39:04 -0400 Subject: [PATCH 2/2] Copilot suggested fixes --- Bugzilla/Flag.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Bugzilla/Flag.pm b/Bugzilla/Flag.pm index 0bf683aede..3255918f12 100644 --- a/Bugzilla/Flag.pm +++ b/Bugzilla/Flag.pm @@ -1114,6 +1114,8 @@ sub notify { $recipients{$addressee->email} = $addressee; } + return unless keys %recipients; + # Process and send notification for each recipient. # If there are users in the CC list who don't have an account, # use the default language for email notifications.