Skip to main content
Vulnerability Database/CVE-2026-105141

CVE-2026-105141: Cognee JWT Authentication Bypass Vulnerability

CVE-2026-105141 is an authentication bypass flaw in topoteretes cognee affecting versions up to 1.5.4. Hard-coded JWT credentials allow attackers to bypass authentication remotely. This article covers technical details, affected versions, security impact, and available patches.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-105141 Overview

CVE-2026-105141 is a hard-coded credentials vulnerability [CWE-259] in topoteretes cognee versions up to 1.5.4. The flaw resides in the get_user_id_by_email function within cognee/modules/users/authentication/get_api_auth_backend.py, which is part of the JWT Signing Key Handler component. The FASTAPI_USERS_JWT_SECRET environment variable ships with a static default value (super_secret), allowing remote attackers who know or guess the fallback to forge valid JSON Web Tokens (JWTs). Version 1.6.0 remediates the issue by generating a random secret at startup when none is explicitly configured.

Critical Impact

Attackers can forge authentication tokens and impersonate legitimate users when deployments retain the shipped default signing secret.

Affected Products

  • topoteretes cognee versions up to and including 1.5.4
  • Component: JWT Signing Key Handler (cognee/modules/users/authentication/get_api_auth_backend.py)
  • Deployments using the default .env.template value for FASTAPI_USERS_JWT_SECRET

Discovery Timeline

  • 2026-10-04 - CVE-2026-105141 published to NVD
  • 2026-10-06 - Last updated in NVD database
  • Patch commit - fa65fc0cd86cdba48d19aa76e36be862be982f5d merged via Pull Request #5062
  • Release - cognee v1.6.0 published with the fix

Technical Details for CVE-2026-105141

Vulnerability Analysis

The cognee project is a Python memory/knowledge framework that exposes a FastAPI-based HTTP interface. Authentication relies on fastapi-users with JWT bearer and cookie strategies. The signing secret is read from the FASTAPI_USERS_JWT_SECRET environment variable. Prior to version 1.6.0, the shipped .env.template provided the literal fallback value super_secret, which operators frequently retained in production.

An attacker with knowledge of this public default can craft arbitrary JWTs signed with super_secret and submit them to any cognee endpoint that validates bearer tokens. Because get_user_id_by_email trusts the identity encoded in the token, the attacker can impersonate any registered user, including administrators, without a valid credential exchange.

Root Cause

The root cause is use of hard-coded credentials [CWE-259] as the default JWT signing material. Secrets intended to be unique per deployment were instead baked into the repository as example values. Operators who copied .env.template to .env without rotating the secret inherited a globally known key, collapsing JWT integrity guarantees across all such installations.

Attack Vector

Exploitation is network-based, requires low attack complexity, and needs only low privileges (knowledge of a target username or email). An attacker constructs a JWT with the desired sub claim, signs it using the HS256 algorithm and the string super_secret, and sends it as a Bearer token to protected cognee API routes. The server accepts the forged token and authorizes the attacker as the impersonated user.

text
# Patch excerpt: .env.template
 # -- JWT Authentication -------------------------------------------------------
 # Secret used to sign and verify JWT tokens. Must be the same across all instances
 # (e.g. all Kubernetes pods) for tokens issued by one instance to be accepted by another.
-# Change this to a long random string in production. Never commit the real value to git.
-FASTAPI_USERS_JWT_SECRET="super_secret"
+# When unset, a random secret is generated each time the server process starts:
+# tokens then stop working after a restart and are not shared between replicas.
+# Set this to a securely generated secret in production. Never commit the real value to git.
+#FASTAPI_USERS_JWT_SECRET="example_secret"

Source: GitHub Commit fa65fc0

Detect Identity Attacks the Moment Authentication Fails

Singularity™ Identity surfaces credential misuse, lateral movement, and privilege escalation in real time, so you can contain the breach before it spreads.

Stop Identity Attacks

Detection Methods for CVE-2026-105141

Indicators of Compromise

  • Presence of FASTAPI_USERS_JWT_SECRET="super_secret" in deployed .env files or container environment variables.
  • JWTs decoded from inbound requests whose signatures validate against the string super_secret.
  • Successful authenticated API calls from source IPs that never performed a /auth/jwt/login exchange.
  • Unexpected privileged actions attributed to user accounts that were not interactively active.

Detection Strategies

  • Inventory cognee instances and inspect runtime configuration for the hard-coded default secret before upgrading.
  • Enable application-level audit logging for all fastapi-users authentication flows and compare login events to subsequent authorized requests.
  • Deploy a reverse-proxy rule that logs decoded JWT claims to a centralized store for correlation against known login activity.

Monitoring Recommendations

  • Alert on authenticated API traffic where no corresponding JWT issuance event exists in logs within the token lifetime.
  • Monitor process startup logs for the new resolve_auth_secrets() warning introduced in v1.6.0, which indicates an ephemeral secret was generated.
  • Watch for configuration drift that reintroduces FASTAPI_USERS_JWT_SECRET="super_secret" through infrastructure-as-code templates or Helm charts.

How to Mitigate CVE-2026-105141

Immediate Actions Required

  • Upgrade cognee to version 1.6.0 or later, which replaces the hard-coded fallback with a per-process random secret.
  • Rotate FASTAPI_USERS_JWT_SECRET to a cryptographically strong value (minimum 32 bytes of entropy) and invalidate all existing sessions.
  • Audit historical access logs for signs of forged-token activity against pre-1.6.0 deployments.
  • Remove any committed .env files containing the default secret from version control history.

Patch Information

The fix is implemented in commit fa65fc0cd86cdba48d19aa76e36be862be982f5d and shipped in release v1.6.0. The patch removes the default assignment in .env.template, generates a random secret at startup when the variable is unset, and introduces resolve_auth_secrets() in cognee/api/client.py to warn operators at boot time. See the GitHub Release v1.6.0 and Pull Request #5062 for the full change set.

python
# Patch excerpt: cognee/api/client.py
await recover_stale_cognify_runs_on_startup()

from cognee.modules.users.authentication.get_auth_secret import resolve_auth_secrets

# Warns at startup, not on the first login, when a token secret was generated.
resolve_auth_secrets()

Source: GitHub Commit fa65fc0

Workarounds

  • Set FASTAPI_USERS_JWT_SECRET to a unique, high-entropy value on every deployment and ensure all replicas share the same rotated secret.
  • Restrict network exposure of the cognee API to trusted networks or VPNs until the upgrade is completed.
  • Place the API behind a gateway that enforces short JWT lifetimes and additional authentication factors.
bash
# Generate and configure a secure JWT signing secret
export FASTAPI_USERS_JWT_SECRET="$(python -c 'import secrets; print(secrets.token_urlsafe(48))')"

# Verify the default is no longer in use
grep -R "super_secret" ./ && echo "Default secret still present - rotate immediately"

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.