Skip to content
Cloud · Secret guide

Leaked Cloudflare Origin CA Key: what to do in the first hour

Critical severityDetected onlyLast verified · 4 min read

A Cloudflare Origin CA key authenticates calls to one specific API: the one that issues and revokes Origin CA certificates, the certificates installed on your own servers so that Cloudflare can connect to them over encrypted links. Whoever holds the key can request new origin certificates for your zones and revoke existing ones. A revoked certificate can break the connection between Cloudflare and your origin, and a certificate issued by an attacker can help them impersonate your origin. The key is narrower than a Global API Key, but the impact is still serious. Roll it first, then check the certificates.

Check your GitHub account for leaked secrets — free

Provider
Cloudflare Origin CA
Severity
Critical
Impact
Cloud infrastructure access
Checked live by LeakWatch
No

What a Cloudflare Origin CA key looks like

The key starts with v1.0-, then 24 hexadecimal characters, a dash and 146 hexadecimal characters:

v1.0-XXXXXXXXXXXXXXXXXXXXXXXX-XXXX…XXXX   Cloudflare Origin CA key (masked; 146 characters in the second group)

It is sent in the X-Auth-User-Service-Key header of calls to the Cloudflare API, so you will find it in scripts that use curl against the certificate endpoints, in tools that request origin certificates automatically, and in variables named for the Origin CA key. Its length is what sets it apart from the other Cloudflare credentials: a scoped API token is a 40-character value, and the Global API Key is a 37-character hexadecimal value sent in X-Auth-Key. Those are separate secrets, with their own guides. If a file contains several, rotate each one.

How Cloudflare Origin CA keys get leaked

  • Certificate automation scripts. A shell script or Ansible role that requests origin certificates with the key written in the header.
  • Infrastructure code. Terraform or Pulumi configuration with the key as a variable default or in a committed variable file.
  • Committed environment files. .env files and Docker compose files shared with the whole team.
  • Continuous integration. Pipelines that print the headers of a failing request in their logs.
  • Server images and backups. A key left in a shell history or a provisioning script baked into an image.

What to do in the first hour

  1. Roll the key. In the Cloudflare dashboard, open the area of your profile where API keys are listed (see the link below) and roll the Origin CA key. Rolling issues a new value, and the old one stops working. Do this before anything else.
  2. Deploy the new key to the scripts and secret stores that need it, then check that your certificate automation still works.
  3. List the Origin CA certificates. In each zone, look at the origin server certificates and compare them with what you issued. Anything you do not recognize, especially recently created, should be revoked.
  4. Check for revoked certificates. If the attacker revoked a certificate, connections between Cloudflare and your origin may fail. Look for sudden errors on the origin side.
  5. Review the audit log. In the account’s audit log, look at the period since the exposure for certificate creation and revocation events, and for anything beyond what this key should be able to do.
  6. Check the other credentials. If a Global API Key or an API token was in the same file, rotate it too.
  7. Clean up the code and look for other secrets next to the key. See I accidentally pushed an API key to GitHub.

Not sure what else leaked from the same repository? Run a free scan.

Not sure what else leaked? Run a free scan.

Revoke it at Cloudflare

The Origin CA key is managed from your user profile in the Cloudflare dashboard, in the section that lists API keys next to API tokens, after you sign in with the account owner. Look for the Origin CA key entry and use the option to roll it. Rolling replaces the old value. A person has not confirmed the exact menu wording for this guide, and the dashboard can change, so if what you see differs, look for the page where your API keys are listed, and follow the Cloudflare documentation on Origin CA.

How LeakWatch detects it

The rule is called Cloudflare Origin CA Key. The signature is specific enough that no context is needed: the literal v1.0-, exactly 24 lowercase hexadecimal characters, a dash, exactly 146 lowercase hexadecimal characters, and word boundaries on both sides. A different length in either group, a missing dash, uppercase hexadecimal or a version other than v1.0 is not reported. The strings v1.0- and x-auth-user-service-key are used as a quick pre-filter. The severity is critical. This type is not checked live: LeakWatch does not send any request to Cloudflare with the key it found.

LeakWatch detects this format but does not check it live: it can tell you the key is exposed, not whether it still works. Assume it does until you have revoked it.

FAQ

Is the Origin CA key the same as an API token?

No. It is a separate, older credential that only works with the Origin CA certificate API. Scoped API tokens and the Global API Key are different secrets and must be rotated separately.

Do origin certificates stop working when I roll the key?

No. Certificates that were already issued stay valid until they expire or are revoked. Rolling only prevents the old key from issuing or revoking more of them.

What if the attacker issued a certificate?

Revoke every certificate you did not request, and replace the ones you still need. Then check that your origin only accepts the certificate and authenticated origin pulls you expect.

Get alerted next time a secret leaks — create a free account

LeakWatch is not affiliated with Cloudflare Origin CA.