Go Restful API Boilerplate: Hardcoded JWT Secret "random" Allows Token Forgery
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Security bypass
- Confidentiality · integrity · availability
- High · High · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-798.
Summary
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.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- Yes
- Technical impact
- Total
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| dhax | go-base | 2026-05-18 | — | No fix listed | CNA |
| — | github.com/dhax/go-base (Go) | before 0.0.0-20260517152733-cc82b9740fa6 | 0.0.0-20260517152733-cc82b9740fa6 | Patch available | GHSA-mqq6-462x-jxmm |
- go-base Vendordhax Affected 2026-05-18 Fixed in — No fix listed CNA
- github.com/dhax/go-base (Go) Vendor— Affected before 0.0.0-20260517152733-cc82b9740fa6 Fixed in 0.0.0-20260517152733-cc82b9740fa6 Patch available GHSA-mqq6-462x-jxmm
Remediation
- Fix · GHSA-mqq6-462x-jxmm github.com/dhax/go-base (Go) Fixed in 0.0.0-20260517152733-cc82b9740fa6 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2026-48031
- 2026-10-03 Alias added: GHSA-mqq6-462x-jxmm
- 2026-10-31 EPSS moved to the 50th–90th percentile
References
Sources
- CVE-2026-48031 · CVE Program
- CVE-2026-48031 · NVD
- FIRST EPSS
- GHSA-mqq6-462x-jxmm · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences