/

CVE-2026-38601

Severity:

HIGH RISK

(7.5)

Hardcoded Session Secret (CWE-798) in gohttpserver Sessions

CVE-2026-38601

Deferred

Vulnerability type

Category:

Hardcoded Credentials

CWE:

CWE-798

Impact:

Authentication Bypass and User Impersonation

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

gohttpserver through v1.3.0 uses a hardcoded session secret that can let an attacker forge session cookies and impersonate users. A forged cookie may bypass OpenID Connect authentication and grant access to application controls.

Affected context

The issue affects gohttpserver deployments through v1.3.0 where session cookies rely on a hardcoded secret. If an attacker can use that secret to create cookies accepted by a deployed instance, they may be able to access the application as another user, including without completing OpenID Connect authentication.

Exploit preconditions

  • Attack surface: The gohttpserver application and its session-cookie handling
  • Required access: No valid user account is necessarily required; the attacker must be able to produce a cookie accepted by the application
  • Trigger point: The application processes a forged session cookie
  • Why exploitation is possible: A hardcoded secret can be shared or recovered from the application, allowing session-cookie integrity checks to be forged

Why this happens

The application uses a hardcoded secret to protect session data. Embedding a credential in application code or an artifact makes it difficult to keep confidential and rotate independently, matching CWE-798: Use of Hard-coded Credentials. If session validation depends on that secret, knowledge of it can undermine the trust placed in session cookies.

Potential impact

  • An attacker may impersonate users
  • OpenID Connect authentication may be bypassed
  • Unauthorized access to application controls may occur
  • Actions may be performed under the identity of an impersonated account

General mitigation guidance

Defensive patterns include removing secrets from source code and distributing them through controlled, deployment-specific secret management. Use a unique, securely generated session secret for each deployment, support rotation, and invalidate sessions when secrets change. Apply least privilege to application accounts and limit the controls available to each authenticated role.

How teams detect issues like this

  • Search source code, build artifacts, and configuration for embedded session secrets or other credentials.
  • Review session middleware and code paths that sign, validate, or deserialize cookies.
  • Check whether deployments share a secret or lack a practical rotation process.
  • Enforce secret-scanning policies in repositories and CI workflows, and review authentication-bypass and session-integrity findings.
  • Automated code review tools can help identify hardcoded credentials and insecure session patterns.

Sources

SourceLink
github.comgithub.com/Den-Sec/security-research/blob/master/advisories/gohttpserver/VDR-002-hardcoded-secret.md
github.comgithub.com/codeskyblue/gohttpserver
github.comgithub.com/codeskyblue/gohttpserver/issues/232

Frequently asked

questions

It may be exploitable through the application's exposed session-handling endpoints if an attacker can create a cookie the application accepts.

A valid account may not be necessary when the hardcoded secret allows accepted session cookies to be forged. Actual access depends on the deployment and session validation behavior.

Keep session secrets out of code, use unique deployment-specific secrets from a controlled secret manager, and support rotation and session invalidation.

Use secret scanning and review authentication code for hardcoded credentials, shared secrets, and insufficient session validation. Apply least privilege to limit the impact of unauthorized access.

Find out what's already
exploitable in your codebase.