Files
b6f218e1e6 Stop leaking message body via the Notifications API tag (#36364) (#37942)
* Stop leaking message body via the Notifications API tag

showNotification was passing the rendered chat body as the Web Notifications
API tag option. On Chromium-based browsers (Chrome, Edge, Brave), the tag is
serialised into the notification-activation command line via the
--notification-launch-id argument, where endpoint detection tooling such as
CrowdStrike Falcon FDR, Microsoft Defender for Endpoint, and Sysmon Event ID 1
captures the full process-start command line and forwards it to the customer's
SIEM. That meant private message content (including incident-response messages,
credentials accidentally pasted into chat, and customer PII) was being copied
into telemetry pipelines that were never in scope to receive it.

Use the title - which already carries only the sender / channel context - as
the tag instead. As a side benefit this is closer to the spec-intended use of
tag: subsequent notifications from the same conversation now replace the prior
one rather than stacking.

Add a regression test covering the leak: the test pushes a body with a
plausible secret pattern (token=AKIA-...) and asserts the tag never echoes
any of it.



* Allow callers to pass an explicit notification tag

Threads channelId through dispatchNotification so per-conversation
notifications coalesce by a stable opaque id rather than the user-visible
title. The title remains as a safe fallback when callers do not supply a
tag, preserving the existing behaviour for the session-expired notification
emitted from login.tsx where no channel context exists.



* fix: explain desktop notification path

* Avoid title fallback for notification tags



* test: align notification action payload expectations



* test: align notification tag e2e expectation

---------



(cherry picked from commit 55e7429fc6)

Signed-off-by: Vishal Kumar Singh <[email protected]>
Co-authored-by: Vishal Kumar Singh <[email protected]>
Co-authored-by: Mattermost Build <[email protected]>
2026-08-13 14:45:53 +02:00
..