# CVE-2026-40172: authentik: Privilege Escalation via User PATCH: Superuser Group Assignment Bypasses enable_group_superuser

> Attackers with user update permissions can escalate privileges to superuser by assigning superuser groups via the user PATCH API, bypassing intended restrictions.

- **Severity:** High 8.1 (`CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 22 May 2026
- **Updated:** 22 May 2026
- **Also known as:** BIT-authentik-2026-40172, GHSA-h6x7-hjjc-wjc9

## What is CVE-2026-40172?

CVE-2026-40172 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, the PATCH /api/v3/core/users/{pk}/ API allows a caller with change_user on a target user to assign arbitrary groups through UserSerializer, including groups with is_superuser=True, without requiring enable_group_superuser, leading to privilege escalation. This bypasses the stricter permission model enforced in group-management paths and enables delegated user-management permissions to escalate target users to administrator-equivalent privilege. Users with permissions to update groups or permissions to update users are able to add themselves or other users they have permissions on to users which have superuser permissions. This issue has been fixed in versions 22025.12.5 and 2026.2.3.

Weakness: CWE-269 (Improper Privilege Management)

## Which versions are affected by CVE-2026-40172?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `authentik` | Bitnami | All versions | 2025.12.5, 2026.2.3 |

## How do I fix CVE-2026-40172?

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

## Is CVE-2026-40172 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-40172 and fix it if it is affected.

What it is: CVE-2026-40172 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.
Exploitation: There is no known exploitation of CVE-2026-40172 in the wild and no public exploit code.

Affected packages and fixed versions:
- authentik (Bitnami): affected all versions; fixed in 2025.12.5, 2026.2.3

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-40172/ (Markdown: https://insights.sbomify.com/CVE-2026-40172/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-40172
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-40172
- OSV: https://osv.dev/vulnerability/CVE-2026-40172

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-40172/
Summaries are generated and may contain mistakes; the official description above is the record.
