Weaviate API key
ID |
weaviate_apikey |
Severity |
high |
Remediation Complexity |
trivial |
Remediation Risk |
high |
Remediation Effort |
low |
Vendor |
Weaviate |
Family |
API Token |
Description
Weaviate is an open-source vector database, offered as a managed service by Weaviate Cloud. Clusters authenticate clients with an API key.
Weaviate API keys are opaque: they carry neither a vendor prefix nor a fixed length. This detector therefore combines the variable name with a minimum length and a minimum entropy, and reports at medium confidence. Nothing in the value identifies the vendor, so this detector also requires the variable name to name the service. A key passed under an unrelated name is reported by the generic API key detectors instead.
When the cluster endpoint appears in the same file, it is used to check whether the key is live; a confirmed live key is escalated to critical.
Security
A leaked Weaviate key grants an attacker the same access as the application that owns it:
-
Unauthorized usage is billed to your account, and automated high-volume calls can run up a large charge before anyone notices.
-
Whatever is sent through the leaked key — prompts, documents, query results — is exposed to whoever holds it.
-
The key can read, modify or delete the vectors and metadata in the index. Those usually hold embedded copies of proprietary documents or personal data, so the leak is a data-exfiltration path and not only a billing problem.
-
The key does not expire on its own, so the exposure lasts until it is revoked.
Examples
The following is a leak of a Weaviate key:
WEAVIATE_URL=https://my-cluster.c0.europe-west3.gcp.weaviate.cloud WEAVIATE_API_KEY=pEOQo-IbEGKb...O7KjUK
Mitigation / Fix
-
Follow your policy for handling leaked secrets, which normally requires revoking the key. Go to the Weaviate Cloud console, open the cluster and rotate the leaked API key. For a self-hosted deployment, change the key in the authentication configuration and restart the cluster.
Revoke the leaked key, do not merely disable it. -
Remove the leaked key from the source code or committed configuration file, and replace its usages with the new value. Environment variables, local files or secret vaults could be used for passing the key, instead of hardcoding the value, as documented in How to Prevent Hard-Coded Secrets.
-
Review the usage and audit logs for the key, to confirm that it was not used by unintended actors while it was exposed.
-
Apply the usual precautions for API keys: never commit them, pass them through environment variables or a secret manager, use a separate key per environment, monitor usage for unusual spikes, and rotate them periodically.
|
You should consider any sensitive data in commits with secrets as compromised. Remember that secrets may be removed from history in your projects, but not in other users' cloned or forked repositories. |