A privilege escalation vulnerability exists in the Wings /upload/file endpoint due to insufficient validation of panel-signed JWTs. Wings accepts any valid panel-signed JWT containing server_uuid, user_uuid, and unique_id, regardless of the token’s intended purpose. Because the Panel issues JWTs with these same claims for other lower-privilege operations (such as WebSocket authentication and file download links), an authenticated subuser can reuse one of those tokens to upload arbitrary files without possessing the required file.create permission.
Any subuser with permission to connect to a server's console, download files, or download backups could reuse those tokens to upload arbitrary files to the same server. A user that does not have access to a server as a subuser is not able to arbitrarily upload files.
The panel generated JWT tokens for various purposes:
server_uuid) on most endpoints being the same when parsing it on wings' side.Create a new subuser that has the minimal amount of permissions on a server (websocket.connect). As that subuser, retrieve a websocket JWT token from the GET /api/client/servers/[...]/websocket endpoint...
1.12.21.12.3Exploitability
AV:NAC:LPR:LUI:NScope
S:UImpact
C:NI:HA:H8.1/CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H