/

CVE-2026-62241

Severity:

CRITICAL RISK

(9.1)

Hard-coded JWT Secret (CWE-321) in clawvet API

CVE-2026-62241

Analyzed

Vulnerability type

Category:

Authentication and Session Management

CWE:

CWE-306, CWE-321

Impact:

Account Compromise and API Key Disclosure

Severity:

CRITICAL RISK

(9.1)

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

clawvet's self-hosted API server uses a hard-coded fallback JWT secret, allowing attackers who know this value to forge HS256 session cookies.

Because scan records expose userId without authentication, a remote attacker can mint valid cg_session tokens and query the authenticated profile endpoint to retrieve a victim's email, subscription plan, and secret apiKey.

Affected context

This vulnerability affects self-hosted deployments of the clawvet apps/api server that:

  • Use the default or hard-coded JWT secret defined in auth.ts and .env.example
  • Expose GET /api/v1/scans without authentication, returning userId fields for stored scan records
  • Rely on HS256 cg_session cookies for user authentication on endpoints such as GET /api/v1/auth/me

In such setups, an attacker on the public internet can interact with the API and exploit predictable secrets and permissive unauthenticated data exposure.

Exploit preconditions

  • Attack surface: Public HTTP interface of the self-hosted clawvet API (apps/api)
  • Required access: Remote, unauthenticated access to GET /api/v1/scans and GET /api/v1/auth/me
  • Trigger point: Use of a known, hard-coded HS256 JWT secret to sign a cg_session cookie for a harvested userId
  • Why exploitation is possible: The server accepts tokens signed with a predictable secret, and exposes user identifiers without authentication, enabling offline forgery of valid session tokens.

Why this happens

The core issue is reliance on a static, hard-coded JWT signing key that is distributed in source code and example environment files.

This aligns with CWE-321: Use of Hard-coded Cryptographic Key, where secret material is embedded in the application and becomes predictable to attackers.

Combined with CWE-306: Missing Authentication for Critical Function, the unauthenticated scan listing reveals userId values, which are then used as token claims.

Abstractly, the design treats tokens signed with a generic shared key as trustworthy identity evidence, without ensuring that the signing key is unique per deployment and adequately protected.

Potential impact

  • Attackers may forge cg_session cookies for arbitrary users and access their account profile data.
  • Victim email addresses and subscription plans could be disclosed, aiding further phishing or social engineering.
  • Secret apiKey values can be harvested and used to invoke other clawvet or related services as the victim.
  • Compromise of paid or high-privilege accounts, including unauthorized use or abuse of subscription resources.
  • Potential downstream impact if the exposed API keys grant access to additional infrastructure or third-party integrations.

General mitigation guidance

Effective mitigation focuses on eliminating predictable secrets and tightening access to identity-linked data.

Recommended patterns include:

  • Generate unique, high-entropy JWT signing keys per deployment and store them in secured configuration (e.g., environment variables or secrets managers), not in source code or example files.
  • Ensure that example or development configuration files never contain valid-looking production secrets; clearly mark them as placeholders and require override in deployment pipelines.
  • Enforce authentication on endpoints that expose user-linked identifiers and sensitive profile data, reducing unauthenticated enumeration of userId values.
  • Apply least-privilege principles to API keys and tokens, limiting what a single compromised secret can do and separating read-only from write or administrative capabilities.
  • Design authentication flows so that user identity cannot be reconstructed purely from public data combined with a shared secret.

How teams detect issues like this

Teams can identify similar weaknesses through a combination of code and configuration review:

  • Static analysis or pattern-based scanning for hard-coded secrets, cryptographic keys, and JWT signing material in source files, .env.example, and test fixtures.
  • Code review checklists that flag authentication logic relying on shared secrets or default keys, and verify that deployment-specific secrets are required.
  • API security testing to detect unauthenticated endpoints that leak user identifiers or other data that can serve as session token claims.
  • Policy enforcement in CI/CD that blocks merges when hard-coded keys or placeholder secrets are detected, and requires secure secret management practices.
  • Periodic penetration testing or adversarial reviews focused on token issuance, cookie handling, and exposure of identifiers across the API surface.

Sources

SourceLink
github.comgithub.com/MohibShaikh/clawvet/security/advisories/GHSA-9mww-p953-jfc9
vulncheck.comvulncheck.com/advisories/clawvet-hard-coded-jwt-secret-session-forgery

Frequently asked

questions

It is remotely exploitable. An attacker only needs network access to the self-hosted API to query public endpoints and then forge session cookies using the known JWT secret.

No prior authentication is required. The attacker can call the unauthenticated GET /api/v1/scans endpoint to harvest userId values, and then use the hard-coded secret offline to create valid cg_session tokens.

Require a unique, deployment-specific JWT signing key managed as a secret, remove any hard-coded fallback keys, and ensure all sensitive or identity-related endpoints enforce proper authentication and authorization checks.

Adopt secure secret management from the outset, prohibit embedding secrets in code or examples, enforce authentication on data-rich endpoints, and integrate automated scanning and code review practices that flag predictable secrets and overly permissive access patterns.

Find out what's already
exploitable in your codebase.