Skip to main content
CriticalSecretsOWASP A07:2021CWE-798

How to fix: Auth0 client secret in source

Auth0 client secrets paired with client IDs let attackers exchange authorization codes for tokens against any Auth0 application.

Why it matters

An exposed Auth0 client secret lets an attacker exchange intercepted authorization codes for access tokens, impersonate your application in the OAuth flow, and gain access to any Auth0 Management API permissions granted to the application.

Auth0 client secrets paired with client IDs let attackers exchange authorization codes for tokens against any Auth0 application.

How to fix it

  1. 1Rotate via Auth0 Dashboard → Applications → Settings → Rotate Secret
  2. 2Use PKCE (no client_secret) for browser-based single-page apps
  3. 3Keep client secrets exclusively in server-side environment variables

Code examples

Auth0 Next.js SDK: server-side only config

TypeScript
// auth0.ts (server-side only, no 'use client')
import { Auth0Client } from '@auth0/nextjs-auth0/server';

export const auth0 = new Auth0Client({
  domain: process.env.AUTH0_DOMAIN!,
  clientId: process.env.AUTH0_CLIENT_ID!,
  clientSecret: process.env.AUTH0_CLIENT_SECRET!,  // server-only, never NEXT_PUBLIC_*
  appBaseUrl: process.env.APP_BASE_URL!,
});

References

Detected automatically by VulnRadar. The check id is secret-auth0-client-secret, stable across every scan so you can filter or diff on it.

See every secrets check

Questions

How severe is Auth0 client secret in source?
VulnRadar rates this critical severity in the secrets category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
Does VulnRadar check for this automatically?
Yes. It runs as part of every scan under the check id secret-auth0-client-secret, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does Auth0 client secret in source map to?
It maps to CWE-798. In the OWASP Top 10 it falls under A07:2021.

Missing a check?

The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.

Propose a checkHow a check is built

Scan your own site for auth0 client secret in source

VulnRadar runs this check and hundreds more against a URL in seconds. No agent to install, just paste a URL.

Or scan this site as a demoRead the docs

How to fix: Auth0 client secret in source | VulnRadar