goauthentik / goauthentik/authentik

SAML upstream logout doesn't happen - security issue

Open
#19,876 5 comments 0 reactions 1 assignee Claimed by @PeshekDotDev View on GitHub
bug status/reviewing
Dominant language
Python
Stars
25.6k
Forks
2k
Avg merge
1d 2h
Merged PRs (30d)
659

Description

### Describe the bug

We use Authentik as an Identity Broker:
[some SAAS] ---oidc---> [Authentik] ---saml--->[Corporate IDP].

Logging in works fine. We have a problem with users (not) logging out.

What happens on logout:
- user logs out of SAAS
- SAAS triggers OIDC logout to Authentik
- Authentik invalidates the session in a simple flow: 10) "default-invalidation-logout" User Logout Stage terminates the session, then 20) Redirect Stage sends them to some page
- ⚠️ IDP keeps their session because **nobody told them to logout** ⚠️

**Resulting security Issue:**
- anybody using this browser will be able to log in to any app that uses IDP, because the IDP session is happily active until it times out hours later

What I expect to happen:
- user logs out of SAAS
- SAAS triggers OIDC logout to Authentik
- Authentik terminates the session and sends a SAML LogoutRequest to IDP
- IDP terminates the session and redirects to wherever it is configured to redirect on logout

What I tried:
- In SAML Source page, I added a SLO endpoint. I expected Authentik to send a properly formed LogoutRequest there. It didn't happen. The SLO endpoint is never triggered during a User Logout Stage.
- I dug through the code and noticed that if I visit a URL of https://my-authentik-server.com/source/saml/slug/slo/, I am redirected to the abovementioned SLO url from the "slug" SAML source. It is a simple redirect, no query string, no payload.

What I need:
- I need Authentik to send a [properly formed LogoutRequest](https://www.samltool.com/generic_slo_req.php) to upstream IDP when a user logs out of Authentik. Otherwise it creates a security risk where anybody can re-authenticate via that same source.

### How to reproduce

1. Create a SAML Source for an upstream IDP
2. Log into Authentik using the SAML Source
3. Log out of Authentik
4. You will be logged out of Authentik but NOT the SAML Source.
5. Try to log into Authentik again via the same source. You will log in immediately, because nobody terminated the upstream session.

### Expected behavior

As above.

### Screenshots

_No response_

### Additional context

_No response_

### Deployment Method

Docker

### Version

2025.12.1

### Relevant log output

```shell

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.