Summary
Covenant versions 0.1.3 through 0.5 contain a critical issue where JSON Web Tokens (JWTs) can be forged to gain administrative privileges, enabling remote code execution.
By crafting malicious admin JWTs, an attacker can upload custom DLL payloads and execute arbitrary commands on the underlying system when those payloads are invoked.
Affected context
This vulnerability affects Covenant Command and Control (C2) server deployments running versions 0.1.3 through 0.5 where JWT-based authentication protects administrative endpoints.
The issue is relevant in environments where the JWT signing secret is predictable, shared, or otherwise exposed, such that an attacker can mint tokens that the server accepts as valid admin credentials.
It becomes particularly severe when the admin interface is reachable over the network and can be abused to upload and execute DLL-based payloads.
Exploit preconditions
- Attack surface: Covenant web interface / API that accepts JWTs for authentication
- Required access: Network access to the Covenant management interface or API endpoints
- Authentication state: Ability to forge or obtain an admin-valid JWT (e.g., due to a hard-coded, weak, or exposed signing secret)
- Trigger point: Using the forged admin JWT to access administrative features, upload DLL payloads, and trigger their execution
- Why exploitation is possible: The JWT validation logic ultimately trusts tokens that can be generated without legitimate credentials, likely due to hard-coded or otherwise insecure management of cryptographic secrets (CWE-798)
Why this happens
The root cause falls under CWE-798: Use of Hard-coded Credentials, extended to include hard-coded or otherwise insecurely managed cryptographic secrets.
Covenant relies on JWT tokens to differentiate between regular users and administrators.
If the JWT signing key is hard-coded, guessable, reused across deployments, or otherwise not protected as a secret, an attacker can generate tokens asserting arbitrary roles, including admin.
Because the application accepts these tokens and grants elevated access without a robust trust boundary around the signing key, privilege boundaries collapse, giving attackers control over admin-only functionality such as DLL upload and execution.
This pattern reflects a flawed assumption that JWT presence implies authenticity, without ensuring the signing secret is unique, strong, and protected in each deployment.
Potential impact
- Remote execution of arbitrary commands via uploaded DLL payloads
- Full compromise of the Covenant C2 server and its underlying host
- Takeover or manipulation of agents connected to the C2 infrastructure
- Deployment of additional backdoors or malware in the environment
- Tampering with logs, configurations, and operational data within Covenant
- Lateral movement within the network using the compromised C2 server as a pivot
General mitigation guidance
Mitigation typically focuses on securing authentication secrets and hardening administrative surfaces:
- Avoid hard-coded JWT signing keys or shared secrets in source code, templates, or example configs.
- Use strong, randomly generated, per-deployment signing keys stored in secure secret management systems.
- Enforce strict separation between administrative and non-administrative JWT scopes, validating role claims defensively.
- Restrict network exposure of the admin interface (e.g., VPN-only, IP allowlists, or jump hosts).
- Apply least-privilege principles to any functionality that can upload or execute code, even for admin users.
- Introduce defense-in-depth checks before executing uploaded binaries or DLLs, such as allowlists or manual approvals.
How teams detect issues like this
Effective detection combines code-centric and operational approaches:
- Static analysis / code review:
- Flag hard-coded JWT signing keys, API secrets, or cryptographic materials.
- Identify configuration defaults that ship with known or weak secrets.
- Confirm that JWT validation code enforces proper signature verification and role validation.
- Configuration and policy enforcement:
- Enforce policies that forbid hard-coded secrets in repositories.
- Scan configurations for reused or default secrets across environments.
- Runtime and logging analysis:
- Monitor for anomalous admin logins, especially from unusual IPs or without corresponding user activity.
- Alert on unexpected DLL uploads or execution events from the Covenant interface.
- Automated security tooling:
- Use secret-scanning tools in CI/CD to catch embedded keys.
- Employ application security testing tools to verify that JWT-based authorization cannot be bypassed.

