CVE-2026-48031 Go Restful API Boilerplate: Hardcoded JWT Secret "random" Allows Token Forgery
Hardcoded JWT secret allows attackers to forge tokens and bypass authentication, gaining admin access to protected endpoints.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2026-48031?
CVE-2026-48031 is a critical vulnerability in dhax go-base, published on 3 Aug 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official 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.
Weakness: CWE-798
Which versions are affected by CVE-2026-48031?
3 open source packages ship an affected version, including github.com/dhax/go-base.
| Package | Affected | Fixed in |
|---|---|---|
github.com/dhax/go-base Go | All versions | 0.0.0-20260517152733-cc82b9740fa6 |
github.com/dhax/go-base Go | All versions | 0.0.0-20260517152733-cc82b9740fa6 |
github.com/dhax/go-base Go | All versions | 0.0.0-20260517152733-cc82b9740fa6 |
How do I fix CVE-2026-48031?
Upgrade github.com/dhax/go-base to 0.0.0-20260517152733-cc82b9740fa6 or later.
Is CVE-2026-48031 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-48031 exists.
Sources
Also known as GHSA-mqq6-462x-jxmm, GO-2026-5515.