Join our Newsletter — 33% off our NHI Course
Home› Glossary› Authentication, Authorisation & Trust› Leaked Client Secret
Authentication, Authorisation & Trust

Leaked Client Secret

← Back to Glossary
By NHI Mgmt Group Updated November 26, 2026 Domain: Authentication, Authorisation & Trust

A Leaked Client Secret is an OAuth or OpenID Connect client secret exposed in a repository, log, build artefact or client-side code. An attacker can authenticate as the application and obtain tokens with its permissions. Defenders use secret scanning, rotate exposed secrets immediately, review the application's sign-in activity, and prefer certificates or federated workload credentials.

What a leaked client secret changes

A leaked client secret is not just a credential disclosure, it turns the application itself into an impersonation target. Because OAuth and OpenID Connect treat the client as a trusted confidential application, anyone holding the secret can request tokens as that app and inherit whatever permissions, scopes, or downstream access the app was granted.

The practical consequence is that a seemingly small secret exposure can become broad token abuse. If the application is allowed to call APIs, access user data, or act across tenants or services, the leak can extend well beyond the original repository, log, or build artefact where the secret appeared.

Where leaked client secrets usually appear

Client secrets tend to leak through the same channels as other high-value secrets: source repositories, CI/CD output, debug logs, client bundles, local configuration files, and artefacts published during builds or testing. The danger is greatest when the secret is copied into places that are widely readable, retained for long periods, or mirrored into multiple systems.

In practice, a leaked secret often reflects a design choice as much as an operational mistake. If a secret is embedded in client-side code, distributed to untrusted environments, or shared across too many deployments, exposure becomes much more likely and revocation becomes harder to contain.

Why OAuth client secrets are dangerous when exposed

Client secrets are authentication material, not mere configuration values. They are meant to prove that a confidential client is talking to the token endpoint, so leakage changes the trust relationship between the identity provider and the application.

The main failure mode is impersonation: the attacker presents the secret, authenticates as the application, and receives tokens that may be indistinguishable from legitimate application traffic. If the app uses broad scopes or privileged service access, the attacker may reach data and actions that were never intended for an external party.

How defenders reduce exposure and recover safely

Defence starts with making leaks easier to detect and harder to reuse. Secret scanning in code repositories and build pipelines helps catch exposure early, but the response has to be immediate, because any live client secret should be treated as compromised the moment it becomes visible outside its intended trust boundary.

Rotation is necessary, but it is not enough on its own. Teams should review sign-in activity and token usage for the affected application, revoke or replace exposed credentials, and prefer stronger patterns such as certificates or federated workload credentials where the platform supports them. For implementation guidance on safer OAuth client authentication, see the OWASP Non-Human Identity Top 10, the OWASP Cheat Sheet Series, and RFC 7523 for JWT-based client authentication. The OAuth standards behind client authentication and token issuance are also described in RFC 6749 and RFC 8705.

Risk and Threat Considerations

Leaked client secrets create a direct authentication abuse path, because an attacker does not need to break the protocol, only reuse the application’s own trust material. That makes the exposure especially dangerous when the client has access to privileged APIs, automation systems, or sensitive data flows.

Failure mechanism: The exposed secret lets an attacker authenticate as the application, mint tokens, and operate with the app’s permissions until the credential is rotated and the resulting sessions or tokens are invalidated.

Impact: The attacker may exfiltrate data, trigger privileged actions, pivot into connected services, or persist through token reuse even after the original leak is discovered.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Non-Human Identity Top 10 and OWASP API Security Top 10 address the attack and risk surface, while NIST SP 800-53 Rev 5, OWASP ASVS and NIST SP 800-63 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Non-Human Identity Top 10NHI-02 — Secret LeakageLeaked client secrets are exposed authentication material for non-human clients.
NHI-04 — Insecure AuthenticationA leaked client secret enables misuse of client authentication at the token endpoint.
NHI-07 — Long-Lived SecretsClient secrets are risky when they remain usable for extended periods after disclosure.
Recommendation — Scan code and build outputs for secrets, then revoke exposed client secrets immediately. Replace shared client secrets with stronger client authentication where possible. Shorten secret lifetime and rotate credentials as soon as exposure is detected.
NIST SP 800-53 Rev 5IA-5 — Authenticator ManagementClient secrets are authenticators whose issuance, storage, rotation, and revocation must be governed.
IA-9 — Service Identification and AuthenticationOAuth client secrets authenticate services and workloads to each other.
AU-6 — Audit Review, Analysis, and ReportingPost-leak review depends on examining sign-in and token activity for abuse.
Recommendation — Manage client secrets as authenticators and revoke them promptly after exposure. Use service authentication controls that reduce reliance on shared client secrets. Review authentication logs after secret exposure to confirm whether the secret was abused.
OWASP ASVSV10 — OAuth and OIDCThe term concerns OAuth and OpenID Connect client authentication and token issuance.
Recommendation — Apply OAuth and OIDC requirements that avoid exposing reusable client secrets.
OWASP API Security Top 10API2 — Broken AuthenticationA leaked client secret weakens API or token-endpoint authentication for the application.
Recommendation — Harden API authentication so leaked client secrets cannot be reused easily.
NIST SP 800-63Digital Identity GuidelinesClient authentication and stronger authenticators are central to reducing secret-based abuse.
Recommendation — Adopt phishing-resistant or stronger client authentication patterns where feasible.

Practitioner Guidance

Why practitioners should care: Treat a leaked client secret as both an incident and a design signal. If the application can be safely moved to certificates, federated workload identity, or another secretless pattern, the long-term risk drops materially because there is less reusable secret material to steal.

What to watch for: Review whether the application’s scopes, audiences, and token lifetime are broader than the business task actually requires, and verify that secret rotation is paired with log review so you can tell whether the secret was already abused before it was replaced.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on November 26, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org