Go Restful API Boilerplate: Hardcoded JWT Secret "random" Allows Token Forgery
Default status is the baseline for the product, each version can override it (e.g. patched versions marked unaffected).
| Vendor | Product | Default status | Versions | ||||||
|---|---|---|---|---|---|---|---|---|---|
| dhax | go-base | affected |
|
No data.
No data.
| Vendor | Product | Versions | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Dhax | Go-base |
|
| Source | ID | Title |
|---|---|---|
Github GHSA |
GHSA-mqq6-462x-jxmm | Go Restful API Boilerplate: Hardcoded JWT Secret "random" Allows Token Forgery |
No CVSS v4.0
No CVSS v3.0
No CVSS v2
This CVE is not in the KEV list.
Exploit prediction score: < 1% (0.626% probability within 30 days)
| Type | Values Removed | Values Added |
|---|---|---|
| First Time appeared |
Dhax
Dhax go-base |
|
| Vendors & Products |
Dhax
Dhax go-base |
| Type | Values Removed | Values Added |
|---|---|---|
| Metrics |
ssvc
|
| Type | Values Removed | Values Added |
|---|---|---|
| Description | go-base is a Go RESTful API Boilerplate template with JWT Authentication, backed by PostgreSQL. In versions prior to 2026-05-18, the JWT signing secret is hardcoded to the known string "random", letting any attacker who reads the public repository forge tokens for arbitrary users, including admin roles, and completely bypass authentication on all protected endpoints. This value is set in two places: the dev.env template (line 10) and a programmatic fallback in cmd/serve.go (line 35), so the application uses it even when no .env file is present. The original mitigation in auth/jwt/tokenauth.go (lines 22 to 25) only caught the exact string "random", letting other weak secrets through, and replaced it with an in-memory key that was not persisted, invalidating all tokens on every restart and effectively causing a denial-of-service. This issue has been fixed in version 2026-05-18. | |
| Title | Go Restful API Boilerplate: Hardcoded JWT Secret "random" Allows Token Forgery | |
| Weaknesses | CWE-798 | |
| References |
| |
| Metrics |
cvssV3_1
|