0xDocs 0x.limo

Docs / Security

Security model for developers

How 0x isolates hosted games from each other and from the platform, and what each layer means for your code.

A game hosted on 0x is code from a developer, running in a player's browser next to other developers' games and next to the player's 0x account. The platform puts several layers between them. Each layer is on by default on 0x.limo. You only need to act when your game needs something from outside its own origin.

layerprotectswhat you dopage
An origin per siteYour game's storage, cookies and frames, from other gamesNothing. Use relative URLs.Site origins
Cross-origin isolation (COOP, COEP, CORP)Gives you SharedArrayBuffer and threads, and keeps other windows out of yoursLoad outside resources with CORS, or as credentiallessIsolation headers
Content-Security-Policy per versionPlayers, from a compromised build that loads or sends data elsewhereDeclare outside hosts with "csp"Content-Security-Policy
Permissions-PolicyCamera, microphone, location, USB, serial, HID and payments: off unless declaredDeclare the permissions you usePermissions-Policy
Content-addressed, immutable versionsPlayers, from files changed after publish, and from bad bytes off the swarmNothingP2P delivery
Source integrity (optional)Players, from a build that doesn't match its sourcePublish your source and a build recipeSource integrity
Store reviewPlayers, from malware and abuseAnswer review issuesReview

#What a hosted page can and can't do

A page at https://<site>-play.0x.limo/sites/<site>/<n>/ can:

  • load anything from its own origin, including WebAssembly ('wasm-unsafe-eval'), workers (also from blob:), and images, media and fonts from data: and blob:;
  • call the platform API (https://api.0x.limo, with CORS) and the swarm and broadcast services on play.0x.limo, over HTTPS and WSS;
  • use WebRTC (peers, TURN), which CSP does not govern;
  • use fullscreen, gamepads and autoplay;
  • be framed by any https: page (the store, 0x.limo/embed/<id>, X player cards, blogs);
  • reach whatever else you declare.

It can't:

  • read or write another game's storage, or script another game's frame;
  • set cookies from the server: the front removes Set-Cookie from every hosted response;
  • load scripts, styles, connections, images, media, fonts or frames from other hosts without a declaration, once the version's policy is enforced;
  • use eval/new Function, or <style> elements created at runtime, without a declaration;
  • use <object>/<embed>, change <base>, or post forms to other hosts.

#Things 0x never does with your site

  • It never serves a hosted site from the API's origin. The page where developers mint publish tokens (api.0x.limo/hosting/) and the player's session live on origins your scripts can't reach.
  • It never changes a published version: versions are immutable (see What you control).
  • It never takes your security headers from the client: the front strips any X-X1-* request headers before it asks the backend for your version's policy.

#Reporting a vulnerability

If you find a way around one of these layers, report it privately to the 0x team instead of publishing it. Don't test it against other developers' sites or other players.