Skip to content

security: avoid XSS in root mount failure UI - #3

Open
iotappman wants to merge 1 commit into
DDS-Solutions:mainfrom
iotappman:security/fix-root-mount-innerhtml-xss
Open

iotappman wants to merge 1 commit into
DDS-Solutions:mainfrom
iotappman:security/fix-root-mount-innerhtml-xss

Conversation

@iotappman

Copy link
Copy Markdown

Summary

Fixes the medium XSS sink in src/main.tsx: the React mount failure fallback interpolated String(err) into innerHTML.

Now it builds the fault UI with createElement / textContent and attaches the reset button with addEventListener (no inline onclick, no HTML string interpolation).

Test plan

  • Force a mount failure (e.g. temporary throw in App) and confirm the fault screen still renders
  • Confirm the error detail is escaped as text (payload like <img src=x onerror=alert(1)> shows literally)
  • Confirm Clear Corrupted Cache & Reset OS clears localStorage and reloads

Replace root_element.innerHTML interpolation of String(err) with DOM APIs and textContent so exception messages cannot inject HTML/JS. Wire the reset button via addEventListener instead of an inline onclick handler.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant