casual-simulation / casualos

Casual Open Simulation for the Web
https://ab1.bot
MIT License
49 stars 9 forks source link

Add the ability to load insts with a unique VM origin #367

Closed KallynGowdy closed 8 months ago

KallynGowdy commented 8 months ago

Currently, all insts are loaded from the same "VM origin". This can be configured, but generally it is the same as the origin of the website that CasualOS is loaded from. When using STATIC_REPO_LOCAL_PERSISTENCE = "true", this causes a security concern because all the inst data is stored in IndexedDb, which would then the available to other insts because IndexedDb is itself available inside web workers.

This task is to track work so that VM_ORIGIN can be set to a string that contains placeholders like: {inst}.{recordName}.example.com which would be filled in with the respective values: great-coffee-bear.myRecord.example.com. This would force the Same Origin Policy to restrict access between inst data.