Skip to content

security: chart.tsx uses dangerouslySetInnerHTML for SVG payload #439

Description

@nanaf6203-bit

Summary

src/components/ui/chart.tsx uses dangerouslySetInnerHTML to inject SVG with content derived from runtime data.

Affected area

src/components/ui/chart.tsx line ~83

Steps to reproduce / impact

If the chart ever accepts a non-trusted string (via theme config, user-defined dashboard, extension override), it becomes an XSS vector.

Expected behaviour

Render the SVG via React. If absolutely necessary, use DOMPurify with an SVG profile.

Acceptance criteria

  • Replace dangerouslySetInnerHTML with React-rendered SVG.
  • If sanitiser is the answer, formally justify and add to dependency tree.
  • Add a unit test against injected payloads.

Activity

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

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave programpriority/p1P1 — high priority, fix soonsecuritySecurity issue or hardening opportunity

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions