A Freemius secret key identifies a product in the Freemius licensing and checkout platform and lets server-side code call the Freemius API for it. With that key, a caller can read licence and customer information for the product and perform actions such as generating upgrade links or managing licences. The secret key is meant to live on your server or in a build step, never in a browser. Because licensing data is tied to paying customers, a leak should be handled as a priority, even though the key is not a bank credential.
Check your GitHub account for leaked secrets — free
- Provider
- Freemius
- Severity
- High
- Impact
- Source code and build access
- Checked live by LeakWatch
- No
What a Freemius Secret Key looks like
Freemius secret keys start with sk_, followed by a block of letters and digits. In a plugin or SDK configuration the key usually sits in an array entry named secret_key, which is what the detection rule looks for:
'secret_key' => 'sk_…' Freemius secret key (masked)
The sk_ prefix is also used by other vendors, including Stripe, so the prefix alone does not identify the key. The context matters: a secret_key entry in a Freemius SDK configuration is the case this rule covers. Freemius also issues a separate API token and a public key for the product. The docs say the secret key should be removed from production code, because it can enable sandbox behavior during development. Check which of these values you have before you rotate, so you know which systems to update.
How Freemius Secret Keys get leaked
- SDK configuration committed. An integration file for a WordPress plugin or other product, pushed with the secret key still in it.
- Build artifacts. A plugin package or a theme archive that contains the configuration file, distributed to customers or uploaded to a public store.
- Development copies. A local copy of the plugin that was shared as a zip file or synced to a shared drive.
- Support threads. A configuration snippet pasted when asking for help with a licence check.
- Front-end code. A key placed in a script that runs in the browser, where it can be read by anyone.
What to do in the first hour
- Regenerate the secret key. Open account settings for the product, go to the API and keys area and regenerate the secret key. Regenerating replaces the old value, so the leaked key stops working once you do it.
- Update your deployments with the new key. Check that licence checks, activations and upgrade links still work on a test site, and then on production.
- Check licence activity. Review recent licence activations, deactivations and upgrades for the product, and look for activity you cannot explain.
- Review customers. If you find unexpected licence changes, contact the affected customers through Freemius’s normal channels.
- Check the package. Make sure the key has been removed from the build and from any archive you distribute. A key left inside a public zip file must be treated as public.
- Look at other values in the same file, including the API token and any other product’s keys. Rotate them if they sat beside the secret key. See I accidentally pushed an API key to GitHub for the order of steps.
- Clean the repository. Keep the secret out of the source tree, read it from the build environment, and remove it from current files.
Not sure what else leaked? Run a free scan.
Revoke it at Freemius
Product keys are found in the product’s settings, on the API and keys tab. Open account settings, select the product, and regenerate the secret key there. Regeneration replaces the key, so update your deployments before you rely on the new value. We could not confirm the current button labels, and the older documentation says regenerating the secret key can also change the API token, so check both values on the page after you regenerate.
How LeakWatch detects it
The rule is called Freemius Secret Key. It looks for a secret_key label in a PHP-style array entry, with an arrow between the label and a quoted value that starts with sk_ and has 29 further characters. The label is required, so a bare sk_ value is not reported by this rule. Other sk_ keys from other vendors are handled by their own rules. The severity is high, with the impact class for identity and code. This type is not checked live: LeakWatch does not send a request to Freemius with the value 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 a Freemius secret key the same as a Stripe secret key?
No. Both start with sk_, but they are issued by different platforms and open different APIs. Check which platform the key belongs to before you rotate it.
Can the secret key be used in a browser plugin?
It should not be. The secret key belongs on the server. Anything in browser code is public, so move the call to the server and expose only what the front end needs.
Will the customers notice?
Only if the update is not deployed promptly. Licence checks can fail for a short time, so deploy the new key quickly and test it.