Skip to content

Chat HTML sanitiser: cover poster/background/cite, inline style url(), and remote img src (defence in depth) #3864

Closed

Description

@mstomar125

Follow-up from the review of #3863 (refs #3858). The CSP (img-src 'self' asset: data:, default-src 'self') blocks these at load time in the shipped app, so they are defence in depth only:

  1. sanitize-chat-html.ts: poster, background (table/td) and cite are URL-bearing attributes the hook does not cover (video poster=//evil, table background=//evil, blockquote cite=//evil survive).
  2. Inline style survives (background:url(//evil), image-set, position:fixed UI redress): add style to FORBID_ATTR or filter url().
  3. img/audio/source/track with an https:// src is kept because the hook reuses isSafeLinkHref (remote tracking pixel / IP leak outside the CSP): for src accept relative or data:image/* only.
    Also: the daemon_setup.rs bundle re-check after the rename has no test of its own.

Activity

  1. self-assigned this
    on Oct 22, 2026
  2. mstomar125 commented on Oct 22, 2026

    @mstomar125
    ContributorAuthor

    Claiming: fixing the three sanitiser items and the missing daemon_setup bundle re-check test in one PR.

  3. mstomar125 commented on Oct 22, 2026

    @mstomar125
    ContributorAuthor

    Fixed in #3866 (merged). Beyond the three items: <style> elements, form action/formaction and svg href/xlink:href are covered too. Not done: ping, longdesc and data attributes; the mid-install bundle race is only unit-tested at the helper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions