The app in question runs locally and only with trusted code. How is the attacker supposed to get in there to place the XSS or even do a MITM attack when there is no exposed website at all? Neither are there browser extensions involved here.
> All sensitive data stored in local storage must be encrypted using a key stored in the server
Huh? Please don't do this, especially not for "local first" applications, would defeat the entire purpose.