Security and trust boundaries
Frappe Playground isolates local instances for routing and persistence, but it is not designed as a hostile-code sandbox or production Frappe deployment.
What origin isolation provides
The deployment uses COOP, COEP, and CORP headers so the document is cross-origin isolated and can use the browser capabilities required by the runtime. HTTPS protects assets in transit. Logical instance URL scopes and separate IndexedDB database names prevent ordinary playground operations from intentionally mixing instance state.
These controls do not make apps trustworthy. Every catalog app executes Python in the instance worker and JavaScript in same-origin Frappe pages. The top-level shell, Frappe iframe, Service Worker, and all instances share one browser origin.
Trusted inputs
A deployment owner is trusting:
- the repository’s client, worker, protocol, Python bridge, and compatibility code;
- the pinned Frappe source and Docker build chain;
- each catalog app’s pinned Git commit and build scripts;
- packages installed during the Docker build and browser
micropipoperations; - the configured Pyodide CDN distribution; and
- the static host and its deployment credentials.
App archives are checked in the browser against build-generated byte counts and SHA-256 digests. The generated catalog itself is delivered from the same origin, so these checks detect corruption and mismatched artifacts; they do not protect against a compromised deployment that replaces both archive and metadata.
Authentication and cookies
The runtime uses fixed demo credentials and pre-fills the login form. ignore_csrf is enabled in the shipped site config. The Python bridge keeps its own per-instance cookie jar because normal browser cookies are scoped to the shared origin rather than to a playground instance.
Incoming browser cookies are merged into that jar for WSGI requests, and response Set-Cookie values are persisted in IndexedDB. Scoped HTML receives only a current UI user identity through an internal response header; the Service Worker removes that header and injects compatibility behavior before returning the page.
Do not reuse these settings for a remotely backed or multi-user system. A malicious same-origin script may interact with browser storage, worker registrations, and other same-origin resources beyond its nominal instance.
Files and paths
Uploaded public/private files are part of the scoped IndexedDB snapshot. Direct /files/ serving resolves the requested path and rejects traversal outside the site public directory. Restore code accepts only configured roots and rejects . or .. path segments.
Private files are persisted, but this browser runtime should not be used as a secrets vault. Device access, browser extensions, same-origin code, developer tools, data eviction, and absent backups all sit outside its protection model.
Network access
The worker can fetch the deployment origin, Pyodide CDN, package indexes, and endpoints used by installed apps. The current runtime does not implement an outbound network allowlist. Browser CORS and CSP behavior still apply, but the shipped static metadata does not establish a restrictive application CSP.
Hosting safely
- Use a dedicated origin rather than colocating unrelated trusted applications.
- Keep source commits and lockfiles reviewed and pinned.
- Protect Cloudflare/API credentials in deployment secrets.
- Review every catalog app as same-origin executable code.
- Preserve HTTPS and cross-origin isolation headers.
- Never store irreplaceable or production data in a playground instance.