GHSA-7v3x-h7r2-34jv

Suggest an improvement
Source
https://github.com/advisories/GHSA-7v3x-h7r2-34jv
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2022/01/GHSA-7v3x-h7r2-34jv/GHSA-7v3x-h7r2-34jv.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-7v3x-h7r2-34jv
Published
2022-01-21T18:43:05Z
Modified
2024-12-04T05:42:03.933399Z
Severity
  • 6.0 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:L CVSS Calculator
Summary
Insufficient Session Expiration in Pterodactyl API
Details

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.

Database specific
{
    "nvd_published_at": null,
    "cwe_ids": [
        "CWE-613"
    ],
    "severity": "MODERATE",
    "github_reviewed": true,
    "github_reviewed_at": "2022-01-20T16:18:28Z"
}
References

Affected packages

Packagist / pterodactyl/panel

Package

Name
pterodactyl/panel
Purl
pkg:composer/pterodactyl/panel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
1.7.0

Affected versions

v0.*

v0.1.0-beta
v0.1.1-beta
v0.1.2-beta
v0.2.0-beta
v0.3.0-beta
v0.4.0-beta
v0.4.1-beta
v0.5.0-rc.1
v0.5.0-rc.2
v0.5.0
v0.5.1
v0.5.2
v0.5.3
v0.5.4
v0.5.5
v0.5.6
v0.5.7
v0.6.0-beta.1
v0.6.0-beta.2
v0.6.0-beta.2.1
v0.6.0-rc.1
v0.6.0
v0.6.1
v0.6.2
v0.6.3
v0.6.4
v0.7.0-beta.1
v0.7.0-beta.2
v0.7.0-beta.3
v0.7.0-beta.4
v0.7.0-rc.1
v0.7.0-rc.2
v0.7.0
v0.7.1
v0.7.2
v0.7.3
v0.7.4
v0.7.5
v0.7.6
v0.7.7
v0.7.8
v0.7.9
v0.7.10
v0.7.11
v0.7.12
v0.7.13
v0.7.14
v0.7.15
v0.7.16
v0.7.17
v0.7.18
v0.7.19
v0.8.0-alpha.1
v0.8.0-alpha.2

v1.*

v1.0.0-beta.1
v1.0.0-beta.2
v1.0.0-beta.3
v1.0.0-beta.4
v1.0.0-beta.5
v1.0.0-beta.6
v1.0.0-beta.7
v1.0.0-rc.1
v1.0.0-rc.2
v1.0.0-rc.3
v1.0.0-rc.4
v1.0.0-rc.5
v1.0.0-rc.6
v1.0.0-rc.7
v1.0.0
v1.0.1
v1.0.2
v1.0.3
v1.1.0
v1.1.1
v1.1.2
v1.1.3
v1.2.0
v1.2.1
v1.2.2
v1.3.0
v1.3.1
v1.3.2
v1.4.0
v1.4.1
v1.4.2
v1.5.0
v1.5.1
v1.6.0
v1.6.1
v1.6.2
v1.6.3
v1.6.5
v1.6.6