Go Restful API Boilerplate (dhax/go-base): Hardcoded JWT Secret "random" Allows Token Forgery and Auth Bypass
critical-cve-against-dependency · active
The dhax/go-base Go REST API boilerplate ships with a hardcoded JWT signing secret ("random") in both its template env file and a code-level default. Because the secret is public, an attacker can forge JWT tokens for any user — including admin roles — completely bypassing authentication on all protected endpoints. A fix was merged in PR #31 (May 17, 2026).
Affected packages
- gogithub.com/dhax/go-base
Indicators of compromise
- file-pathdev.env (AUTH_JWT_SECRET=random)
- file-pathcmd/serve.go (viper.SetDefault("auth_jwt_secret", "random"))
- file-pathauth/jwt/tokenauth.go