Vulnerability · Published Aug 3, 2026 · Assigned by GitHub_M

CVE-2026-48031Go Restful API Boilerplate: Hardcoded JWT Secret "random" Allows Token Forgery

Critical 9.1

In plain English

A critical-severity hard-coded credentials in go-base from dhax. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 0.6% (higher than 50% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)9.1Critical
Exploit odds (30 days)0.6%top 49.8% of all CVEs
Exploited in the wildNo reportsCISA SSVC: poc
Attack toolingNoneno public tooling known

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.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Gogithub.com/dhax/go-base0.0.0-20260517152733-cc82b9740fa6GHSA-mqq6-462x-jxmm
Gogithub.com/dhax/go-base0.0.0-20260517152733-cc82b9740fa6GO-2026-5515

Affected products (as reported)

VendorProductVersions
dhax go-base 2026-05-18

Weakness: CWE-798 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N

References