Categories
CVE-2026-48031 critical CVSS 9.1

Vulnerability in github.com/dhax/go-base (CVE-2026-48031)

Summary

Vulnerability in github.com/dhax/go-base (CVE-2026-48031). Confidential information can be exposed externally. Exploitable via dev.env. Mitigation: upgrade to 0.0.0-20260517152733-cc82b9740fa6 or later.

Original description

The description as published by the source.

Vulnerability: CWE-798 — Hardcoded JWT Secret + Broken Mitigation

Affected Component

  • github.com/dhax/go-base — Go REST API boilerplate (go-chi/jwtauth/v5, Viper, PostgreSQL/Bun)
  • 1,685 stars on GitHub

Vulnerability Locations

File Line Role
dev.env 10 AUTH_JWT_SECRET=random — template default shipped to all users
cmd/serve.go 35 viper.SetDefault("auth_jwt_secret", "random") — code-level fallback
auth/jwt/tokenauth.go 22-25 Weak mitigation: only checked literal "random", auto-generated non-persistent key
auth/jwt/tokenauth.go 28 jwtauth.New("HS256", []byte(secret), nil) — creates JWT signer with the weak key
pwdless/api.go 203 GenTokenPair() — issues access + refresh tokens signed with the weak key

Data Flow

dev.env AUTH_JWT_SECRET=random
  OR
cmd/serve.go viper.SetDefault("auth_jwt_secret", "random")
    │
    ▼
auth/jwt/tokenauth.go: viper.GetString("auth_jwt_secret")
    │
    ▼
auth/jwt/tokenauth.go: jwtauth.New("HS256", []byte(secret), nil)
    │
    ▼
pwdless/api.go: GenTokenPair() → access + refresh tokens
    │
    ▼
jwt/authenticator.go: Every authenticated request trusts the forged token

Description

The JWT signing secret is hardcoded to the string "random" in two independent locations:

  1. dev.env:10 — The template .env file sets AUTH_JWT_SECRET=random. Every developer who copies this template gets the same default.

  2. **`…

Source: GitHub Security Advisories (Global) NVD GitHub Advisory

Auto-generated summary

Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.

A vulnerability tracked as CVE-2026-48031 has been found in github.com/dhax/go-base.
Attackers can target a specific entry point like dev.env over the network to misuse the product.
Confidential information can be exposed externally. CVSS score: 9.1/10.
What to do: upgrade github.com/dhax/go-base to 0.0.0-20260517152733-cc82b9740fa6 or later.
If unsure, ask your IT team or search "github.com/dhax/go-base CVE-2026-48031" on the vendor's site.

CVE-2026-48031 (github.com/dhax/go-base) — CWE-798 / CVSS v3 9.1
Attack vector: remote (network-reachable) / unauthenticated / no user interaction
Attack surface: dev.env
Patched: 0.0.0-20260517152733-cc82b9740fa6 — apply immediately
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.

❓ What is the problem

A vulnerability (CWE-798) exists in github.com/dhax/go-base. Attackers reach the vulnerable code path via dev.env without authentication.

📍 Affected scope

Check the vendor advisory for the affected versions of github.com/dhax/go-base. Attack surface: dev.env.

🔥 Severity

Severity: Critical (CVSS 9.1/10). Confidential information can be exposed externally.

🔧 How to fix

Update to 0.0.0-20260517152733-cc82b9740fa6.

🛡️ Workaround

Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.

🔍 Detection

Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'github.com/dhax/go-base' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.

Response actions

Concrete steps and command examples for SOC/SRE teams to execute in order

  1. 1
    Identify exposure identify
    grep -r 'github.com/dhax/go-base' . | grep -v node_modules

    リポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で github.com/dhax/go-base を grep し、稼働しているサービス・バージョンを把握する。

  2. 2
    Apply patch patch
    Upgrade github.com/dhax/go-base to 0.0.0-20260517152733-cc82b9740fa6

    ステージング環境で 0.0.0-20260517152733-cc82b9740fa6 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。

  3. 3
    Post-deployment verification verify
    Confirm patched version is live in production

    パッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。

Affected packages

go github.com/dhax/go-base
[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.0.0-20260517152733-cc82b9740fa6"}]}]

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details