ShareMyPage developer explains how the platform securely hosts user-generated HTML and JavaScript by utilizing sandboxed iframes and isolated, cookieless origins to prevent session hijacking and cross-site scripting attacks.
Key Points
- ShareMyPage avoids sanitizing HTML to preserve the functionality of interactive, data-driven web prototypes.
- The platform uses sandboxed iframes with the
allow-same-originpermission omitted to ensure scripts run within a null origin. - Content is served from a separate, temporary origin that contains no session cookies or authentication tokens.
- The architecture prevents XSS and session hijacking by ensuring that even a successful sandbox escape would land in an empty, non-privileged environment.
- The security model does not prevent CPU-intensive tasks like cryptomining or potential browser-level zero-day exploits.