Skip to main content
EPSS 0.4%top 63%

CVE-2026-48031: CWE-798: Use of Hard-coded Credentials in dhax go-base

0
Critical
VulnerabilityCVE-2026-48031cvecve-2026-48031cwe-798
Published: 08/03/2026 (08/03/2026, 19:05:50 UTC)
Source: CVE Database V5
Vendor/Project: dhax
Product: go-base

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.

CVSS v3.1

Score 9.1critical

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

Affected software

dhax

go-base

Affected versions
=2026-05-18
github.com/dhax/go-base
pkg:golang/github.com/dhax/go-base
Affected versions
<2026-05-18

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 08/03/2026, 20:03:14 UTC

Technical Analysis

The go-base project by dhax contained a hardcoded JWT signing secret set to the string "random" in versions before 2026-05-18. This secret was present in both the dev.env template and a programmatic fallback, enabling attackers who can read the public repository to forge JWT tokens for any user, including admins, thereby bypassing authentication on all protected endpoints. The original mitigation only detected the exact string "random" and replaced it with a non-persistent in-memory key, causing token invalidation on restarts and effectively a denial-of-service. The vulnerability has been addressed and fixed in version 2026-05-18.

Potential Impact

Attackers can forge JWT tokens for arbitrary users, including administrators, allowing complete authentication bypass on all protected endpoints. This compromises confidentiality and integrity of the application but does not directly affect availability. The attempted mitigation caused denial-of-service by invalidating tokens on every restart.

Mitigation Recommendations

Upgrade to version 2026-05-18 or later where the hardcoded JWT signing secret issue is fixed. There is no official patch link provided, but the fix is included in the stated version. Until upgrade, do not use the vulnerable versions as the hardcoded secret allows token forgery. Patch status is not explicitly stated as 'official-fix' or 'patchAvailable' but the description confirms the issue is fixed in version 2026-05-18.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2026-05-20T18:15:53.577Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 6a70f0bfbf32cb7a341a778c

Added to database: 08/03/2026, 19:49:19 UTC

Last enriched: 08/03/2026, 20:03:14 UTC

Last updated: 09/17/2026, 22:01:35 UTC

Views: 54

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses