GHSA-8r6w-3qq5-4p4r
HIGHGHSA-8r6w-3qq5-4p4r is a high-severity (CVSS 8.1) CWE-1259 vulnerability in github.com/pterodactyl/wings. O3 Security confirms whether GHSA-8r6w-3qq5-4p4r is actually reachable in your code before you act, and blocks exploitation at runtime until you patch.
Pterodactyl's improper JWT scoping allows subuser to upload files when not explicitly granted `file.create` permissions
Blast Radius
github.com/pterodactyl/wings🐘pterodactyl/panelReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go, Packagist packages — download data is not available via public APIs for these ecosystems.
Description
Summary
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.
Impact
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.
Details
The panel generated JWT tokens for various purposes:
- https://github.com/pterodactyl/panel/blob/0f82c105201b192d229f6abd5827e2ee7e672a05/app/Services/Backups/DownloadLinkService.php#L33-L36
- https://github.com/pterodactyl/panel/blob/0f82c105201b192d229f6abd5827e2ee7e672a05/app/Http/Controllers/Api/Client/Servers/FileUploadController.php#L45
- https://github.com/pterodactyl/panel/blob/0f82c105201b192d229f6abd5827e2ee7e672a05/app/Http/Controllers/Api/Client/Servers/WebsocketController.php#L58-L61
- https://github.com/pterodactyl/panel/blob/0f82c105201b192d229f6abd5827e2ee7e672a05/app/Http/Controllers/Api/Client/Servers/FileController.php#L82-L85
Though as the actual purpose is not conveyed part of the JWT tokens, this introduces this vulnerability of being able to do non-intended actions due to the expected fields (i.e.
server_uuid) on most endpoints being the same when parsing it on wings' side.
PoC
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 (in my case, I manually just make a request under that user's browser session; you can probably just resend the /websocket request in browser console to get a fresh unused token). Using that websocket token, we can abuse this by directly using it in the /upload/file endpoint of the wings node instead of using it for websocket authentication:
import requests
wings_url = 'http://[...]:8080'
websocket_token = '[...]'
res = requests.post(f'{wings_url}/upload/file', params = {
'token': websocket_token,
}, files = {
'files': ('file-upload.txt', b'Hello, World!'),
})
print(res.status_code, res.content)
Observe, that even though our subuser never has permissions outside viewing the console, they are able to write arbitrary files in the server. This pattern happens in a lot of other action, but this is probably the most interesting one.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐹Go | github.com/pterodactyl/wings | all versions | 1.12.2 |
| 🐘Packagist | pterodactyl/panel | all versions | 1.12.3 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for github.com/pterodactyl/wings. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.
Fix
Update github.com/pterodactyl/wings to 1.12.2 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-8r6w-3qq5-4p4r is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 pinpoints whether GHSA-8r6w-3qq5-4p4r is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.
Tailored to GHSA-8r6w-3qq5-4p4r. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-8r6w-3qq5-4p4r in your dependencies?
O3 detects GHSA-8r6w-3qq5-4p4r across Go, Packagist dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.