openhuman icon indicating copy to clipboard operation
openhuman copied to clipboard

Bug: OpenhumanLinkModal accepts arbitrary event paths without allowlist

Open Liohtml opened this issue 6 months ago • 0 comments

Summary

app/src/components/OpenhumanLinkModal.tsx listens for window.addEventListener('openhuman-link', handler) and processes detail.path without validating it against a known set. Any code (including injected scripts or agent-rendered content) can dispatch this event with arbitrary paths.

Impact

Low — Currently paths are just used as switch keys. But if future code adds side-effect handlers for new paths, the lack of validation becomes a boundary issue.

Suggested Fix

const ALLOWED_PATHS = new Set([
  'settings/notifications', 'settings/billing', 'settings/messaging',
  'community/discord', 'accounts/setup'
]);
if (!ALLOWED_PATHS.has(detail.path)) return;

Liohtml avatar May 16 '26 14:05 Liohtml