๐Ÿ” CVE Alert

CVE-2026-48031

CRITICAL 9.1

Go Restful API Boilerplate: Hardcoded JWT Secret "random" Allows Token Forgery

CVSS Score
9.1
EPSS Score
0.0%
EPSS Percentile
0th

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.

CWE CWE-798
Vendor dhax
Product go-base
Published Aug 3, 2026
Last Updated Aug 3, 2026
Stay Ahead of the Next One

Get instant alerts for dhax go-base

Be the first to know when new critical vulnerabilities affecting dhax go-base are published โ€” delivered to Slack, Telegram or Discord.

Get Free Alerts โ†’ Free ยท No credit card ยท 60 sec setup

CVSS v3 Breakdown

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
None

Affected Versions

dhax / go-base
2026-05-18

References

NVD โ†— CVE.org โ†— EPSS Data โ†—
github.com: https://github.com/dhax/go-base/security/advisories/GHSA-mqq6-462x-jxmm github.com: https://github.com/dhax/go-base/pull/31 github.com: https://github.com/dhax/go-base/commit/cc82b9740fa6b08e0fad409cd4b418e240dd0e00