A Facebook app secret is the private half of the credentials of a Meta developer app. Together with the public app ID, it proves that a request really comes from your app. Whoever holds it can ask the Graph API for app access tokens, exchange or extend user tokens obtained through your login flow, and sign requests as the application. It is not a password for a person, but it is the key to the identity of your app, and an attacker who also gets a user token can turn it into long-lived access. Reset the secret first, then check what the app did.
Check your GitHub account for leaked secrets — free
- Provider
- Severity
- High
- Impact
- Source code and build access
- Checked live by LeakWatch
- No
What a Facebook app secret looks like
An app secret is 32 characters long and uses only lowercase hexadecimal characters (0-9 and a-f). It has no prefix, so the string alone is not recognizable:
facebook_app_secret = "…" 32 lowercase hex characters (masked)
What identifies it is context. It usually sits next to the numeric app ID, in variables such as FACEBOOK_APP_SECRET, FB_APP_SECRET, FACEBOOK_CLIENT_SECRET or a client_secret field in an OAuth configuration for “Login with Facebook”. It is easy to confuse with look-alikes. The app ID is a number, not a 32-character hex string. A client token, which is meant to be embedded in mobile apps, is a separate, lower-risk value. An app access token is built from the app ID and the secret joined by a pipe, so if you see that form in a file, the secret is inside it. User and page access tokens start with EAA and are covered in their own guides.
How Facebook app secrets get leaked
- OAuth configuration files. Authentication libraries for Django, Rails, Passport, NextAuth and others ask for the app ID and secret in a settings file that gets committed.
- Environment files.
FACEBOOK_APP_SECRETin a.envfile, a Docker compose file or a deployment manifest pushed to a public repository. - Mobile and front-end code. The secret embedded in an app or a JavaScript bundle because a developer wanted to do the token exchange on the device. The secret must only ever live on a server.
- Sample projects and tutorials. A working demo shared with its real credentials still filled in.
- Logs and support requests. A configuration object printed at startup, or a screenshot of the dashboard where the secret was revealed.
What to do in the first hour
- Open your app in the Meta developer dashboard (see the link below) and go to the basic settings of the app whose secret leaked. If you are not sure which one, match the app ID found next to the secret in the file.
- Reset the app secret. The basic settings page has a way to reset it and asks you to confirm. Meta’s documentation says a compromised secret should be reset right away, and that resetting can break existing integrations, so prepare the new value before you click.
- Deploy the new secret to every server and job that uses it, then sign in through your app to confirm the login flow still works.
- Review the app. Check the roles on the app (administrators, developers, testers), the list of products enabled, the OAuth redirect URIs and the allowed domains. Remove anything you do not recognize, because an attacker with dashboard access could have added a redirect URI to capture tokens.
- Look at app activity. Use the dashboard views for API calls and errors to spot a surge in requests, unusual endpoints, or token exchanges you did not initiate.
- Treat user tokens as exposed if the leak is serious. If tokens were stored in the same place as the secret, invalidate them or ask users to sign in again, and rotate page access tokens.
- Clean up the code and look for other secrets in the same repository. See I accidentally pushed an API key to GitHub.
Not sure what else leaked from the same repository? Run a free scan.
Revoke it at Meta
The app secret is managed in the Meta for Developers dashboard, after you sign in with an account that has an administrator role on the app. Open the app, go to its settings and look for the basic settings page, where the app ID and the secret are shown (the secret is hidden until you enter your password). Use the reset action there. A person has not confirmed the exact menu wording for this guide, and the interface changes often, so if the page differs from this description, look for the section where the app secret is listed and follow the basic settings documentation in the Meta for Developers docs.
How LeakWatch detects it
The rule is called Facebook Secret. It is a case-insensitive, contextual pattern: the word facebook must appear first, optionally followed by a short label of up to about 20 characters (so facebook_secret, facebook-app-secret or Facebook client secret all qualify), then an assignment sign such as =, : or =>, optional quotes or whitespace, and then exactly 32 characters from a-f and 0-9. The value must end at a quote, whitespace, a semicolon or the end of the line. A 32-character hex string with no facebook before it is not reported, and neither is a value containing letters outside the hexadecimal range, or one that is longer or shorter. The severity is high. This type is not checked live: LeakWatch does not call the Graph API with the value it found, so a hit shows the right format in the right context, not that the secret is still valid.
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
Can someone log in as my users with only the app secret?
Not by itself. The secret lets a holder act as your application, for example to exchange or extend user tokens and to request app tokens. It becomes much more dangerous if user tokens or authorization codes leaked as well.
Is the app ID also secret?
No. The app ID is public and appears in login URLs and SDK setup. The secret is the part to protect, which is why the two are always shown separately in the dashboard.
Will resetting the secret log my users out?
It can break any server flow that still uses the old secret until you deploy the new one. Prepare the deployment first, then reset, and test a complete login afterwards.