CVE-2026-48031 Details
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.
A vulnerability exists in the go-base template for Go RESTful APIs, specifically in versions prior to 2026-05-18. The issue arises from a hardcoded JWT signing secret set to 'random', which allows attackers to forge tokens for any user, including those with admin privileges. This authentication bypass affects all protected API endpoints. The vulnerability stems from the default secret being embedded in the dev.env template and a fallback in the application code, ensuring the weak secret is used even in the absence of a custom .env file. The initial attempt to mitigate this issue only addressed the exact string 'random', leaving other weak secrets unverified and introducing a denial-of-service by invalidating tokens on each restart.
Users should update to version 2026-05-18 or later, regenerate their JWT secret, and restart the application.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
Volerion
Assessed Aug 3, 2026CISA-ADP
Assessed Aug 3, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/dhax/go-base/security/advisories/GHSA-mqq6-462x-jxmm | CISA-ADP | AdvisoryRemedyVendor |
| https://github.com/dhax/go-base/commit/cc82b9740fa6b08e0fad409cd4b418e240dd0e00 | [email protected] | Source CodeVendor |
| https://github.com/dhax/go-base/pull/31 | [email protected] | Issue TrackingVendor |
| https://github.com/dhax/go-base/security/advisories/GHSA-mqq6-462x-jxmm | [email protected] | AdvisoryRemedyVendor |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-798 | Use of Hard-coded Credentials | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| dhax go-base | < 2026-05-18 |
CPE
Remediation
| |
Change History
2 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Aug 3, 2026 | New CVE Received | [email protected] |
| Aug 3, 2026 | CVE Modified | CISA-ADP |
Volerion