A 42 Intra client secret is the secret half of an OAuth application registered with the 42 school intranet API. With the UID and the secret, an application can request access tokens and read data about users who sign in with it. The secret must stay on your server, because anyone holding it can impersonate your application. Rotate the secret first, then check what your application did with it.
Check your GitHub account for leaked secrets — free
- Provider
- Intra42
- Severity
- High
- Impact
- Source code and build access
- Checked live by LeakWatch
- No
What a 42 Intra client secret looks like
The 42 API issues a client UID and a client secret for each application. The secret has a fixed prefix that marks it as a secret of this kind, followed by a short identifier and a long hexadecimal string:
s-s4t2…-XXXX 42 Intra client secret (masked)
The UID is public in the sense that it appears in authorization URLs, but the secret is not. Applications usually keep both in environment variables. The secret is the value to protect, and the prefix is the easiest way to spot it in a file.
How 42 Intra client secrets get leaked
- Committed configuration. A settings file or environment file with the UID and secret, pushed to a repository. Students often publish projects like these, so the risk is common.
- Public project repositories. A project submitted or shared publicly with the secret still in the code.
- Front-end code. A secret placed in a browser bundle while the application was being built. Anything the browser loads can be read.
- Copied examples. A tutorial or sample configuration with the real secret left in place of the placeholder.
- Logs. An error handler that prints the token request, including the secret in the body.
What to do in the first hour
- Rotate the secret. Open the account settings for your OAuth applications, find the application that leaked, and regenerate or replace its secret. If the page only lets you delete the application, create a new one first so that your service keeps running.
- Deploy the new secret through your server environment, and test a sign-in before you close the old path.
- Review the activity. Check your application’s logs for token requests from unfamiliar addresses, and for data reads you do not expect in the period since the exposure.
- Check the users. If the application stores access tokens, revoke those as well, since they were issued with the old secret and may have been copied.
- Look at the rest of the project. Remove the value from every config file, build output and history, and check the other credentials stored next to it.
- Clean the repository. Follow the steps in I accidentally pushed an API key to GitHub.
Not sure what else leaked from the same project? Run a free scan.
Revoke it at 42
Go to the account settings for your 42 profile, open the OAuth applications page and regenerate the secret for the application that leaked, or delete the application if it is no longer needed. The public description of this page comes from community documentation, so the exact labels and the regeneration option are not confirmed here. The 42 API documentation covers the application setup and the token flow, and it is the place to check current behaviour before you rely on it. Confirm that you are signed in to the account that owns the application.
How LeakWatch detects it
The rule is called “Intra42 Client Secret”. It looks for the fixed secret prefix used by 42 applications, followed by a short identifier and 64 hexadecimal characters, with word boundaries around the value. No surrounding text is needed. The severity is high. This type is not checked live: LeakWatch does not request a token from 42 with the value it finds.
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 UID also a secret?
Not in the same way. The UID is visible in authorization links, but together with the secret it lets someone act as your application. If the secret leaked, rotate it and do not rely on the UID being hidden.
Will users have to sign in again?
Usually not, unless you also revoke existing access tokens. Plan the rotation so that your server picks up the new secret before the old one stops working.
What is the safe place for the secret?
A server-side environment variable or secret manager. It should never reach a browser, a mobile app or a repository.