String Utility Belt sandboxes user JavaScript with layered iframe and CSP isolation
The developer of String Utility Belt, a browser tool for chaining text transformations, added a custom JavaScript step that lets users write their own functions. Because users often paste sensitive data such as JWTs, Kubernetes secrets, and production API keys, and pipelines are shared via links, the code needed strong isolation. The solution runs user code inside a four-layer sandbox: a srcdoc iframe with an opaque origin, a strict per-frame Content-Security-Policy that blocks all network access, and a Web Worker that can be terminated when it exceeds its time limit. Each run uses a fresh frame that is removed afterwards, so nothing persists between runs. The article describes how this strict CSP initially broke the sandbox when it was enabled.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in