app:create could overwrite an existing app, across scopes
Creating an app never checked whether an app with that name already existed. The permission check only looked at the scopes in the request, so a user with create in any scope could replace an app in a scope they had no access to. Affects 0.4.0 and earlier.
scottyctl app:create shop --folder ./evil --service web:80 --scope staging
# shop lived in production; it now runs the caller's compose file in staging
- Impact: the attacker's containers get the replaced app's named volumes and public domain, and the app moves into the attacker's scope with view, manage, shell and destroy rights.
- Fix (0.5.0):
app:createis create-or-update. Re-creating an app can't change its scopes, and the user needs create rights in every one of the existing app's scopes (403 otherwise). - Workaround before upgrading: give
createonly to users you trust with every app on the server, or blockPOST /api/v1/authenticated/apps/createat your reverse proxy.