Skip to content

Harden all string-based rendering paths to avoid unsafe HTML injection #3

Description

@blackopsrepl

Summary

Remove unsafe default HTML insertion paths or make them explicitly opt-in.

Problem

Several APIs inject raw HTML strings with innerHTML. That makes the library unsafe by default when user-provided content reaches those APIs.

Scope

  • Audit all rendering paths that accept string content
  • Replace innerHTML usage with safe DOM construction where practical
  • If raw HTML support remains, require an explicit opt-in API and document the risk clearly
  • Add tests covering escaped content and any approved raw-HTML path

Acceptance Criteria

  • Default rendering paths do not inject untrusted HTML directly
  • Any remaining raw HTML API is explicit, narrowly scoped, and documented as unsafe
  • Covered components preserve expected rendering without relying on unsafe insertion
  • Tests verify safe handling of markup-like user content

Notes

This is a production-safety issue and should be treated as blocking for broader adoption.

Activity

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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions