Unsafe plugins can be installed via pack import by tenant admins
Description
Unsafe plugins (for instance sql-list) can be installed in subdomain tenants via pack import even if unsafe plugin installation for tenants is disables
Details
I have an example bot20230704.saltcorn.com/
Impact
All tenants of installation (i.e. saltcorn.com), can be compromised from tenant user has admin access. If an untrusted user has admin rights to a tenant instance, they will be able to install a plug-in that can access information from other tenants
Revived after 0.8.7
After patch in 0.8.7 this is not fixed completely.
Here are steps to reproduce:
- Publish to NPM plugin that was not approved by admin (in case of saltcorn.com) by @glutamate. I've just published this one: npmjs.com/
package/ saltcorn-qrcode - Publish somewhere plugin store that includes plugin from previous step: gist.github.com/
pyhedgehog/ f1fd7cb13f4d0a7ccf6a965748d19bd2 - Add plugin store link to tenant store.
- Install plugin.
- Use it in tenant: bot20230704.saltcorn.com/
view/ testqr_show/ 1
Here are logic: Unsafe plugins checked against this list: github.com/
const safes = getRootState().getConfig("available_plugins",[]).filter(p=>!p.unsafe).map(p=>p.location);