CVE-2026-48031
published critical CVSS 3.1 · 9.1Go Restful API Boilerplate: Hardcoded JWT Secret "random" Allows Token Forgery
Package status and fixes
| Distro / vendor | Release | Package / product | Publisher status | Fixed build | Source |
|---|---|---|---|---|---|
| dhax | — | go-base2026-05-18 | Affected | Not stated | GitHub_M |
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.
Related advisories
Vendor advisories explicitly linked to this CVE.
No linked advisories were found for this CVE.
Assessment
CVSS risk assessment and additional context for this vulnerability.
- CVSS version
- 3.1
- Base score
- 9.1 / 10
- Severity
- critical
- Provider
- GitHub_M · cna
- Vector string
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
Publisher product statements
Version ranges and default statuses as reported by each provider.
| Vendor | Product | Version status | Source |
|---|---|---|---|
| dhax | go-base | 2026-05-18 (affected) | GitHub_M · cna |
Weaknesses
1- CWE-798 CWE-798: Use of Hard-coded Credentials
References
3Provider assertions
2GitHub_M · cna
Go Restful API Boilerplate: Hardcoded JWT Secret "random" Allows Token Forgery
CISA-ADP · adp
CISA ADP Vulnrichment
Provenance
- Schema
- 5.2
- Searchable
- yes
- Content hash
- 1dca63a7d4e4007ced75c21a7fd25ce1b54312abc056873486dd89923459eda2
- Ingested
- 23 Sep 2026, 09:17:17 UTC
- Source record
- Official CVE record