A LinkedIn client secret belongs to an application registered in LinkedIn’s developer portal. Together with the client ID, it lets your server exchange authorization codes for access tokens, which act on behalf of LinkedIn members who approved your app. A leaked client secret does not, by itself, give access to any member’s account, but it lets someone impersonate your application when it requests tokens, and it can be used to abuse the permissions your app already has. Rotate the secret first, then check how your app was used and whether any member tokens were issued to unknown callers.
Check your GitHub account for leaked secrets — free
- Provider
- Severity
- High
- Impact
- Source code and build access
- Checked live by LeakWatch
- No
What a LinkedIn Client Secret looks like
LinkedIn client secrets are a plain string with no fixed visible prefix in the rule that LeakWatch uses. The value is a short run of lowercase letters and digits, and it is shown in the Auth settings of the application in the developer portal. The rule matches a 16-character value of that kind when the word linkedin appears before it, usually written as a variable name or a configuration key:
LINKEDIN_CLIENT_SECRET=…XXXX variable name with a masked value
Note that the client ID is not secret in the same way. It appears in authorization URLs that your users see in their browsers, so finding it does not mean you have a leak. The client secret is the value that must stay on the server. If you find a value next to the word LinkedIn in a file, check the application’s Auth settings to confirm whether it matches the current secret.
How LinkedIn Client Secrets get leaked
- Configuration files committed to a repository. A settings file for an OAuth library that holds the client ID and secret together, pushed to a public or shared repository.
- Front-end code. A secret placed in a browser script or a mobile app. A client secret must stay on the server, because anything in a bundle can be read.
- Environment files. A
.envfile copied into a Docker image, a container layer or a backup. - Logs. A debug line that prints the token request when an authorization fails, which includes the client secret in the request body.
- Shared examples. A snippet copied into a tutorial, a support thread or an AI assistant conversation to show how the login works.
What to do in the first hour
- Generate a new secret. Open your app in the LinkedIn developer portal, go to the Auth tab, and generate a new client secret from the Application Credentials section. Generating a new one keeps the current one active for a while, so the old value still works until you remove it.
- Deploy the new secret to your servers and CI, and test a sign-in on a staging environment before you go further. Do not put the secret in a file that will be committed.
- Remove the old secret. After the new one is confirmed in production, delete the secondary secret from the same section. Removing it stops any use of the leaked value.
- Review the app’s activity. Check the access tokens and the members who signed in during the period since the exposure. Look for sign-in events you cannot explain, and for changes to the app’s redirect addresses.
- Check the redirect URLs. Confirm that the redirect addresses registered for the app are only your own, since a changed redirect is a common way to capture authorization codes.
- Check the rest of the file. Revoke any other credentials stored with the client secret, such as signing keys or database passwords.
- Clean the repository. Remove the value from current files, add the file to
.gitignore, and rewrite history if the repository was public. See I accidentally pushed an API key to GitHub for the full order.
Not sure what else leaked from the same repository? Run a free scan.
Revoke it at LinkedIn
LinkedIn’s own guidance on securing applications describes rotation through the developer portal. Open the app, go to the Auth tab, and look at the Application Credentials section, which shows the client ID and the primary client secret. Generating a new secret moves the current primary secret into a secondary slot, so for a short period the app has two active secrets. Update your configuration to use the new primary, test it, and then remove the secondary secret with the delete control in the same section. The documentation says the client secret should only be used server-side and never exposed in client-side code. We did not confirm whether a secret can be reset without that overlap, or the exact moment the old value stops working, so check the live portal for those details before you plan a cutover. The portal wording may also change over time.
How LeakWatch detects it
The rule is called “LinkedIn Client Secret”. It looks for the word linkedin (written with or without an underscore or hyphen between linked and in), followed by a short run of characters and an assignment sign or similar separator, then a value of exactly 16 lowercase letters or digits, with a quote, space, semicolon, backtick or line end after it. The match is not case-sensitive. The severity is high, with the identity and code impact class, because the secret lets someone impersonate your app during token requests. This type is not checked live: LeakWatch does not send the value to LinkedIn, so a finding means a matching value sat next to the name, not that it still works.
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 client ID also secret?
Not in the same sense. The client ID is included in the URL that sends your users to LinkedIn to approve your app, so it is visible to anyone who signs in. Only the client secret must be kept private.
Does a leaked client secret expose my users' data?
Not directly. It does not reveal member data by itself. It can, however, be used to request tokens for your application, and any token issued to an attacker acts for a member who approved your app. That is why reviewing sign-in activity matters.
Should I generate a new secret or just delete the old one?
Generate a new one first, deploy it and test it, then delete the old one. Deleting the old secret before the new one is live will break sign-in for your users until the deployment catches up.