CVE-2026-40166 authentik: Non-admin user can retrieve confidential OAuth client_secret via /api/v3/oauth2/access_tokens/

High 7.1 Published Updated

Authenticated non-admin users can retrieve confidential OAuth client secrets via the access tokens API, exposing sensitive credentials.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2026-40166?

CVE-2026-40166 is a high-severity vulnerability in goauthentik authentik, published on 22 May 2026. Any signed-in user can exploit it over the network, with no action from the victim.

Official description

authentik is an open-source identity provider. In versions prior to 2025.12.5 and 2026.2.0-rc1 through 2026.2.2, authenticated non-admin users with at least one OAuth2 access token can retrieve the client_secret of confidential OAuth2 providers they have previously authenticated against, exposing sensitive information to users without the correct permissions. This logic is GET /api/v3/oauth2/access_tokens/. The API response includes a nested provider object containing client_id and client_secret for providers configured with client_type: confidential, which should not be accessible to low-privilege users. This issue has been fixed in versions 2025.12.5 and 2026.2.3.

Weakness: CWE-863, CWE-200

Which versions are affected by CVE-2026-40166?

1 open source package ship an affected version, including authentik.

PackageAffectedFixed in
authentik BitnamiAll versions2025.12.5, 2026.2.3

How do I fix CVE-2026-40166?

Upgrade authentik to a fixed version for your release line: 2025.12.5 or 2026.2.3.

Is CVE-2026-40166 being exploited?

There is no known exploitation of CVE-2026-40166 in the wild and no public exploit code.

Sources

Also known as BIT-authentik-2026-40166, GHSA-hhpc-rqgm-pxj4.

Is CVE-2026-40166 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free