Advisory Database
  • Advisories
  • Dependency Scanning
  1. composer
  2. ›
  3. pterodactyl/panel
  4. ›
  5. GMS-2022-28

GMS-2022-28: Insufficient Session Expiration in Pterodactyl API

January 21, 2022

Impact

A vulnerability exists in Pterodactyl Panel <= 1.6.6 that could allow a malicious attacker that compromises an API key to generate an authenticated user session that is not revoked when the API key is deleted, thus allowing the malicious user to remain logged in as the user the key belonged to.

It is important to note that a malicious user must first compromise an existing API key for a user to exploit this issue. It cannot be exploited by chance, and requires a coordinated attack against an individual account using a known API key.

Patches

This issue has been addressed in the v1.7.0 release of Pterodactyl Panel.

Workarounds

Those not wishing to upgrade may apply the change below:

diff --git a/app/Http/Middleware/Api/AuthenticateKey.php b/app/Http/Middleware/Api/AuthenticateKey.php
index eb25dac6..857bfab2 100644
--- a/app/Http/Middleware/Api/AuthenticateKey.php
+++ b/app/Http/Middleware/Api/AuthenticateKey.php
@@ -70,7 +70,7 @@ class AuthenticateKey
         } else {
             $model = $this->authenticateApiKey($request->bearerToken(), $keyType);

-            $this->auth->guard()->loginUsingId($model->user_id);
+            $this->auth->guard()->onceUsingId($model->user_id);
         }

For more information

If you have any questions or comments about this advisory please reach out to Tactical Fish#8008 on Discord or email dane@pterodactyl.io.

References

  • github.com/advisories/GHSA-7v3x-h7r2-34jv
  • github.com/pterodactyl/panel/commit/dfa329ddf242908b60e22e3340ea36359eab1ef4
  • github.com/pterodactyl/panel/releases/tag/v1.7.0
  • github.com/pterodactyl/panel/security/advisories/GHSA-7v3x-h7r2-34jv

Code Behaviors & Features

Detect and mitigate GMS-2022-28 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 1.7.0

Fixed versions

  • 1.7.0

Solution

Upgrade to version 1.7.0 or above.

Source file

packagist/pterodactyl/panel/GMS-2022-28.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:15:02 +0000.