fix(security,notifications): pre class allowlist, notification privacy + icon, sync-script safety (N100/N106/N109/N119)
- N100: restrict <pre> classes to language-* in sanitize-html allowedClasses; previously `class` was allowed on <pre> with no allowedClasses entry, so a remote sender could inject arbitrary class names that activate site CSS. - N106: OS notifications for E2EE rooms no longer carry decrypted plaintext (which persists in the OS notification center / lock screen). Encrypted rooms show only the sender; the in-page toast still previews while focused. - N109: OS notification icon/badge use the static app logo instead of an authenticated-media avatar URL the OS can't fetch (was 401 / no icon). The in-app toast keeps the real room avatar (it can fetch via the SW). - N119: syncDecorations.mjs distinguishes a confirmed 404 (remove) from a network/5xx failure (abort) so a transient CDN outage can't silently wipe the whole decoration catalog from source control. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -155,6 +155,11 @@ export const sanitizeCustomHtml = (customHtml: string): string =>
|
||||
allowProtocolRelative: false,
|
||||
allowedClasses: {
|
||||
code: ['language-*'],
|
||||
// `pre` permits `class` (for `<pre class="language-*">` wrappers); without
|
||||
// an allowedClasses entry, sanitize-html lets a remote sender put ARBITRARY
|
||||
// class names on <pre>, activating site CSS (N100). Restrict to the same
|
||||
// language-* whitelist as <code>.
|
||||
pre: ['language-*'],
|
||||
},
|
||||
allowedStyles: {
|
||||
'*': {
|
||||
|
||||
Reference in New Issue
Block a user