Sanaan Fayaz Wani

Significant-Gravitas/AutoGPT

GHSA-57mf-wqwq-6g6x

Hardcoded Default Fernet Encryption Key Exposes All Stored OAuth Credentials

GHSA-57mf-wqwq-6g6x

8.2

High

CVSS 3.1 base

  1. 2026-10-05Published by the maintainer

What to do

If you run autogpt-platform-backend 0.6.23 to 0.7.4, upgrade to 0.8.0 or later.

Anyone who can reach it over the network, with a low-privilege account and no user interaction, given conditions outside the attacker's control, can read and change sensitive data, and the impact reaches beyond the vulnerable component.Read from the CVSS 3.1 vector

CVSS 3.1 metrics

To exploit it

Attack vector
Network
Attack complexity
High
Privileges required
Low
User interaction
None

What it gets

Confidentiality
High
Integrity
High
Availability
None
Scope
Changed

Open this vector in the FIRST calculator ↗

Weakness
CWE-321, CWE-798 Use of Hard-coded Cryptographic Key · Use of Hard-coded Credentials
CVE
not assigned
Vector
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:H/I:H/A:N
Also in AutoGPT
GHSA-24q6-6h89-f9p7 10.0

My analysis of this finding: root cause, the vulnerable code, the impact and the fix, in the site’s format. The official advisory of record is linked above.

Affected versions

Package Ecosystem Vulnerable Fixed in
autogpt-platform-backend other >= 0.6.23, <= 0.7.4 0.8.0

Summary

The AutoGPT platform shipped a hardcoded ENCRYPTION_KEY in backend/.env.default, committed to the public repository and loaded automatically by the default Docker Compose configuration. That one key does two jobs: it encrypts every stored user credential with Fernet, and it derives the HMAC key that signs pickle serialized cache entries in Redis. Because the key is public, both protections collapse for any deployment left on the default.

Where it lives

Three places tie the public key to real impact.

Credential encryption, backend/util/encryption.py:

ENCRYPTION_KEY = Settings().secrets.encryption_key  # from .env.default class JSONCryptor:    def __init__(self, key=None):        self.key = key or ENCRYPTION_KEY        self.fernet = Fernet(self.key.encode())

The bugcredential key comes from the published default env file

backend/data/user.py uses this to encrypt and decrypt UserIntegrations, which hold OAuth tokens, API keys and refresh tokens.

Cache HMAC signing, backend/util/cache.py:

def _get_hmac_key() -> bytes:    secret = settings.secrets.encryption_key    if not secret:        secret = "autogpt-cache-default-hmac-key"    return hashlib.sha256(secret.encode()).digest()

The bugderives the cache HMAC key from the public encryption key

The derived key HMAC signs pickle serialized cache entries before they are stored in Redis. Reads call pickle.loads() after verifying the HMAC.

Default loading, docker-compose.platform.yml:

x-backend-env-files: &backend-env-files  env_file:    - backend/.env.default   # base defaults, always present    - path: backend/.env     # user overrides, optional      required: false

The bugthe default env file is always loaded

The default file is always loaded, so a deployment that never sets its own key runs on the published one.

Impact

Two distinct chains, separated by what the attacker can reach.

Credential decryption. Anyone who can read the PostgreSQL store (a backup leak, SQL injection, misconfigured access, a compromised admin surface) can decrypt every stored credential with the public key: GitHub and Discord OAuth tokens, model provider API keys, and every other integration secret.

Remote code execution. Anyone who can write to Redis can forge an HMAC signed pickle payload with the derived key sha256(ENCRYPTION_KEY). When the application next reads that poisoned entry, pickle.loads() runs attacker controlled code. The HMAC stops being a defense the moment its key is public.

A working proof of concept demonstrated all three steps end to end: encrypt and decrypt with the known key, forge a signature that passes the application’s own verification, and deserialize the forged payload.

Fix

Remove the shipped key and fail closed on it: refuse to start when ENCRYPTION_KEY is empty, matches a known published default, or is not a valid Fernet key, and document a rotation procedure. For the cache specifically, a safe serializer such as JSON or msgpack removes the deserialization sink entirely, so an HMAC bypass can no longer reach code execution.

The record

Weakness
CWE-321 Use of Hard-coded Cryptographic Key
CWE-798 Use of Hard-coded Credentials
Affected
autogpt-platform-backend 0.6.23 to 0.7.4
Fixed in
0.8.0
Disclosure
2026-10-05 Published
Advisory
GHSA-57mf-wqwq-6g6x
Also in AutoGPT
GHSA-24q6-6h89-f9p7 10.0

About this writeup

Sanaan Fayaz Wani (GitHub sfwani) reported this vulnerability to the autogpt-platform-backend maintainers under coordinated disclosure and is credited as a reporter in GHSA-57mf-wqwq-6g6x, published 2026-10-05.

All published findings: advisory index.