Summary
AutoGPT Platform uses a hardcoded default Fernet key to encrypt users' OAuth tokens, API keys, and integration credentials stored in the database. If a deployment uses that default key and an attacker can read its database, the attacker may be able to decrypt those credentials.
Affected context
The issue affects AutoGPT Platform deployments in the described version range that use the hardcoded key supplied in backend/.env.default. Credentials in the User.integrations database column are at risk when they are encrypted with that key and an attacker obtains read access to the deployment's database.
Exploit preconditions
- Attack surface: The deployment's database and the encryption key used by the backend
- Required access: Read access to the database; the deployment must use the known default key
- Trigger point: Accessing stored integration credentials encrypted with the default key
- Why exploitation is possible: A shared hardcoded key makes encrypted values decryptable by parties who know the key and can obtain the corresponding database contents
Why this happens
The application relies on a hardcoded, shared cryptographic key to protect sensitive credentials at rest. This maps primarily to CWE-321: Use of Hard-coded Cryptographic Key and is also related to CWE-798: Use of Hard-coded Credentials. When a key is included as a default in application files, deployments that retain it do not have a secret unique to their environment.
Potential impact
- Attackers with database read access could decrypt stored OAuth tokens, API keys, and integration credentials.
- Exposed credentials may enable unauthorized access to connected services or user accounts.
- Organizations may need to revoke affected credentials and investigate their use.
General mitigation guidance
Defensive patterns include generating a unique, high-entropy encryption key for each deployment and supplying it through a protected secret-management mechanism rather than a source-controlled default. Limit access to both the database and encryption keys, keep keys separate from encrypted data, and apply least privilege to services that can decrypt credentials. If exposure is suspected, assess and rotate affected credentials and keys using an appropriate key-management process.
How teams detect issues like this
- Scan source code, packaged defaults, and deployment configuration for static cryptographic keys or credential-like values.
- Review configuration handling to confirm deployments cannot silently fall back to a shared default key.
- Enforce policies requiring deployment-specific secrets and restricting database and key access.
- Audit database reads and credential-decryption activity for unusual access patterns.
- Use automated code and configuration review tools to flag hardcoded secrets.

