Summary
Crawl4AI's Docker API server uses a hardcoded default JWT signing key, allowing attackers who know this key to forge valid authentication tokens.
Under deployments that retain the default key, an attacker can bypass authentication entirely and gain full access to protected API functionality.
Affected context
This vulnerability arises in Crawl4AI instances where the Docker API server relies on a default, hardcoded JWT signing key for token generation and verification.
It is most relevant in environments where operators deploy the service without rotating or overriding the default key material.
Any context in which the same default key is shared across deployments expands the attack surface, since compromise in one environment can inform attacks on others.
Exploit preconditions
- Attack surface: Network-exposed Docker API server endpoints that accept JWT-based authentication
- Required access: Knowledge of the default JWT signing key; no prior authenticated access is required once the key is known
- Trigger point: Submission of forged JWTs in Authorization headers or equivalent token-bearing mechanisms
- Why exploitation is possible: The server trusts tokens signed with the static default key, treating them as legitimate for any user identity or role
Why this happens
The core issue is the embedding of a static, hardcoded JWT signing key directly into the application or its default configuration.
This behavior maps to CWE-798: Use of Hard-coded Credentials, where secret material such as keys or passwords is shipped with the product and reused across deployments.
Because the same key is used both to sign and verify tokens, anyone who learns or guesses the key can mint arbitrary tokens that the server will accept as authentic.
Potential impact
- Full bypass of authentication controls at the Docker API server level
- Impersonation of any user, including administrative or privileged accounts
- Unauthorized access to all protected API routes and operational capabilities
- Potential modification, deletion, or exfiltration of application data
- Use of the compromised API as a pivot point for broader infrastructure attacks
General mitigation guidance
Effective mitigation focuses on removing reliance on shared, hardcoded secrets and tightening token validation practices.
Recommended defensive patterns include:
- Externalizing JWT signing keys into secure configuration channels (e.g., environment variables, secret stores) and ensuring they are unique per deployment
- Enforcing mandatory key rotation and avoiding any fallback to default or sample keys
- Implementing strict role-based access control so that tokens correspond to minimal necessary privileges
- Disabling or hardening demo or default configurations in production-like environments to reduce the risk of accidental exposure
These measures reduce the likelihood that a single exposed key can compromise multiple instances or grant unrestricted access.
How teams detect issues like this
Detection typically combines configuration review, code analysis, and runtime monitoring:
- Static analysis: Search for embedded secret literals, default JWT keys, or constant signing secrets within source code and configuration files.
- Configuration audits: Verify that production deployments reference environment-specific keys and that no default or sample keys remain enabled.
- Runtime telemetry: Monitor API access logs for anomalous authentication patterns, such as unknown clients suddenly acquiring broad privileges.
- Policy enforcement: Integrate checks in CI/CD pipelines that flag hardcoded secrets and prevent merging of changes that reintroduce them.

