/

CVE-2020-36911

Severity:

CRITICAL RISK

(9.8)

Authentication Bypass / Hard-coded Secrets in Covenant C2

CVE-2020-36911

Analyzed

Vulnerability type

Category:

Authentication Bypass / Hard-coded Secrets

CWE:

CWE-798

Impact:

Remote Code Execution with Administrative Privileges

Severity:

CRITICAL RISK

(9.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

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.

Sources

SourceLink
cobbr.iocobbr.io/Covenant.html
github.comgithub.com/Zeop-CyberSec/covenant_rce/blob/master/covenant_jwt_rce.rb
github.comgithub.com/cobbr/Covenant
web.archive.orgweb.archive.org/web/20201013165001/https://twitter.com/cobbr_io/status/1316058367161401344
web.archive.orgweb.archive.org/web/20201101052547/https://blog.null.farm/hunting-the-hunters
exploit-db.comexploit-db.com/exploits/51141
vulncheck.comvulncheck.com/advisories/covenant-remote-code-execution-rce

Frequently asked

questions

Yes. If the Covenant admin interface or relevant APIs are exposed over the network and the JWT signing secret is predictable or compromised, an attacker can remotely forge admin tokens and achieve remote code execution.

The attacker needs network access to the Covenant management interface or API and the ability to reconstruct or obtain a valid signing key (or otherwise bypass signature verification). With that, they can generate admin-privileged JWTs without prior valid credentials.

Move all JWT signing keys and similar secrets out of source code and default configs into secure secret management, ensure they are strong, unique per deployment, and rotate them when compromised. Combine this with strict authorization checks on admin functionality and careful restriction of code-upload and execution features.

Adopt a secure secret management strategy (no hard-coded keys), enforce secret-scanning in CI, perform regular security reviews of authentication and authorization flows, and minimize or tightly gate any feature that allows arbitrary code upload or execution, even for administrative users.

Find out what's already
exploitable in your codebase.