Skip to content
OpenAdvisories
Critical · 9.1 CVE-2026-48031 EUVD-2026-52408GHSA-mqq6-462x-jxmmGO-2026-5515

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

Published Aug 3, 2026 · Updated Aug 3, 2026 · Assigned by GitHub_M

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 products

VendorProductAffectedFixed
dhax go-base 2026-05-18 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
openSUSE Leap 16.0 govulncheck-vulndb 0.0.20260723T184607-160000.1.1 openSUSE-SU-2026:21483-1

Affected packages

EcosystemPackageAffectedFixedRecord
Go github.com/dhax/go-base < 0.0.0-20260517152733-cc82b9740fa6 0.0.0-20260517152733-cc82b9740fa6 GHSA-mqq6-462x-jxmm

Advisories 1

References