Skip to content

[Bug]: Session revoke is useless (no-op) with session authenticated via OIDC #53942

@thlehmann-ionos

Description

@thlehmann-ionos

⚠️ This issue respects the following points: ⚠️

Bug description

When revoking another browser's session that was authenticated via OIDC, the user with the other browser will go through the OIDC authentication process, creating a new Nextcloud session.

This renders the revocation useless in case of OIDC with persistent session, as they will immediately be authenticated again without having to confirm their credentials and be logged in at Nextcloud.

To the user it looks like the revocation of the session did not work. However, in the Devtools one can observe, that the user received a 401 error and went through the usual authentication process.

Steps to reproduce

Preconditions:

  • Nextcloud configured with OIDC
  • Login via OIDC

Steps:

  1. Login into Nextcloud with browser A and go to files
  2. Create a folder
  3. Login into Nextcloud with browser B with the the same user and go to files
  4. Go to Settings / Security in browser B
  5. Under Devices & sessions "revoke" the session of browser A
  6. In browser A navigate into the created folder
  7. Actual:
    • Get a 401 error is shortly visible after navigation
    • A reload occurs
    • One ends up logged in
  8. Expected: the user in browser A will be logged out

Expected behavior

The user in browser A will be logged out, ideally also at the authentication provider by sending them through the OIDC logout process.

Nextcloud Server version

31

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.3

Web server

Apache (supported)

Database engine version

SQlite

Is this bug present after an update or on a fresh install?

Fresh Nextcloud Server install

Are you using the Nextcloud Server Encryption module?

None

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

{
    "system": {
        "debug": true,
        "allow_local_remote_servers": true,
        "overwriteprotocol": "http",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "sqlite3",
        "version": "31.0.6.2",
        "overwrite.cli.url": "http:\/\/localhost",
        "updater.release.channel": "git",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "theme": "",
        "loglevel": 2,
        "maintenance": false
    }
}

List of activated Apps

Enabled:
  - cloud_federation_api: 1.14.0
  - comments: 1.21.0
  - contactsinteraction: 1.12.0
  - dashboard: 7.11.0
  - dav: 1.33.0
  - federatedfilesharing: 1.21.0
  - federation: 1.21.0
  - files: 2.3.1
  - files_reminders: 1.4.0
  - files_sharing: 1.23.1
  - files_trashbin: 1.21.0
  - files_versions: 1.24.0
  - lookup_server_connector: 1.19.0
  - oauth2: 1.19.1
  - profile: 1.0.0
  - provisioning_api: 1.21.0
  - settings: 1.14.0
  - sharebymail: 1.21.0
  - systemtags: 1.21.1
  - theming: 2.6.1
  - twofactor_backupcodes: 1.20.0
  - updatenotification: 1.21.0
  - user_oidc: 7.2.0
  - user_status: 1.11.0
  - viewer: 4.0.0
  - weather_status: 1.11.0
  - webhook_listeners: 1.2.0
  - workflowengine: 2.13.0
Disabled:
  - admin_audit: 1.21.0
  - encryption: 2.19.0
  - files_external: 1.23.0
  - testing: 1.21.0
  - user_ldap: 1.22.0

Nextcloud Signing status

Nextcloud Logs

Additional info

Network conversation

> PROPFIND http://localhost:8080/remote.php/dav/files/3890df07-9654-4705-b323-2c8d84f22b25/New%20folder/
< 401 Unauthorized

> GET http://localhost:8080/index.php/apps/files
< 401 Unauthorized

The session was correctly invalidated, yet we'll next send the user through the authentication process ...

> GET http://localhost:8080/index.php/login?redirect_url=%2Findex.php%2Fapps%2Ffiles%2Ffiles%2F43%3Fdir%3D%2FNew%2520folder
< 302 Found ; Location = 
/index.php/apps/user_oidc/login/1?...

> GET http://localhost:8080/index.php/apps/user_oidc/login/1?redirectUrl=http://localhost:8080/index.php/apps/files/files/43?dir%3D/New%2520folder
< 303 See Other ; Location = http://localhost:8079/realms/mcve/protocol/openid-connect/auth?...

> GET http://localhost:8079/realms/mcve/protocol/openid-connect/auth?...
< 302 Found ; Location = http://localhost:8080/index.php/apps/user_oidc/code?...

Format: line by line request (>) and response (<), then an optional comment on the dialog.

Reproducer

For reproduction you can re-use this MCVE (for another issue), which provides the necessary setup: https://github.com/IONOS-Productivity/mcve-nextcloud-logout-oidc-fails/tree/v1.0

It contains:

  • A container to run Nextcloud in
  • Configurations and install scripts

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions