Insecure Default Value for Authentication Variable Affecting github.com/donknap/dpanel/app/common/logic package, versions <1.6.1


Severity

Recommended
0.0
critical
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.07% (23rd percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-GOLANG-GITHUBCOMDONKNAPDPANELAPPCOMMONLOGIC-9802155
  • published24 Apr 2025
  • disclosed15 Apr 2025
  • creditNS-Sp4ce

Introduced: 15 Apr 2025

NewCVE-2025-30206  (opens in a new tab)
CWE-321  (opens in a new tab)
CWE-453  (opens in a new tab)
CWE-547  (opens in a new tab)

How to fix?

Upgrade github.com/donknap/dpanel/app/common/logic to version 1.6.1 or higher.

Overview

Affected versions of this package are vulnerable to Insecure Default Value for Authentication Variable in the GetJwtSecret() function in user.go. In the default configuration, the JWT secret value is predictable based on config values such as app.name. An attacker can bypass authentication and impersonate users by generating legitimate JWT tokens using the same algorithm.

Workaround

This vulnerability can be avoided by setting the JWT secret to a non default configured value and loading it at runtime.

PoC

import jwt

def generate_jwt(appname):

payload = {
    "SECRET_KEY":"SECRET_VALUE",
}
print("appname:", appname)
print("payload:", str(payload))
token = jwt.encode(payload, SECRET_KEY.format(APP_NAME=appname), algorithm="HS256")
return token

appname = "SECRET_KEY" token = generate_jwt(appname) print("url token:", token)

References

CVSS Base Scores

version 4.0
version 3.1