Skip to main content
Vulnerability Database/CVE-2025-47790

CVE-2025-47790: Nextcloud Server Auth Bypass Vulnerability

CVE-2025-47790 is an authentication bypass flaw in Nextcloud Server that allows skipping two-factor authentication under specific conditions. This article covers the technical details, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2025-47790 Overview

Nextcloud Server contains an authentication flaw that allows attackers to bypass the second-factor confirmation step after a successful password login. The bug affects deployments where remember_login_cookie_lifetime is set to 0 in config.php. When the session expires on the two-factor selection page and the user reloads, the server skips the second-factor challenge entirely.

The vulnerability is tracked as [CWE-287] Improper Authentication. It affects both Nextcloud Server and Nextcloud Enterprise Server across multiple release branches.

Critical Impact

An attacker holding valid username and password credentials can access an account protected by two-factor authentication, defeating a key control against credential theft.

Affected Products

  • Nextcloud Server prior to 29.0.15, 30.0.9, and 31.0.3
  • Nextcloud Enterprise Server prior to 26.0.13.15, 27.1.11.15, 28.0.14.6
  • Nextcloud Enterprise Server prior to 29.0.15, 30.0.9, and 31.0.3

Discovery Timeline

  • 2025-05-16 - CVE-2025-47790 published to the National Vulnerability Database (NVD)
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2025-47790

Vulnerability Analysis

The flaw sits in Nextcloud's session handling logic for multi-factor authentication (MFA). After a user submits valid primary credentials, Nextcloud presents a provider-selection page for the second factor. If the session expires while the user is on that page and the page is reloaded, the server treats the primary credentials as sufficient and completes the login without enforcing the second factor.

The behavior only triggers when administrators configure remember_login_cookie_lifetime to 0. This value is intended to disable the remember-me cookie, yet it also changes the session re-establishment path in a way that skips the MFA state check. The result is a logical authentication bypass that undermines the security guarantee of two-factor authentication.

Root Cause

The root cause is incorrect state tracking during session re-initialization. Nextcloud fails to re-verify that the authenticated session has completed the second-factor challenge before granting full access. The patch in pull request #51905 restores the second-factor requirement after session expiry.

Attack Vector

Exploitation requires an attacker who already possesses valid username and password credentials, for example through phishing, credential stuffing, or password reuse. The attacker initiates login, lands on the two-factor selection page, waits for the session to expire, and reloads. The vulnerability requires user interaction and a specific server configuration, which raises attack complexity.

See the GitHub Security Advisory GHSA-9h3w-f3h4-qqrh and HackerOne Report #2729367 for additional technical context.

Detect Identity Attacks the Moment Authentication Fails

Singularity™ Identity surfaces credential misuse, lateral movement, and privilege escalation in real time, so you can contain the breach before it spreads.

Stop Identity Attacks

Detection Methods for CVE-2025-47790

Indicators of Compromise

  • Successful login events for MFA-enrolled accounts without a corresponding second-factor completion event in Nextcloud audit logs.
  • Session resumption on /login/selectchallenge endpoints followed by authenticated activity.
  • Logins from unfamiliar IP addresses or geolocations for accounts configured with two-factor authentication.

Detection Strategies

  • Review the Nextcloud configuration for remember_login_cookie_lifetime set to 0 to identify exposed instances.
  • Correlate authentication logs to flag sessions that transitioned to an authenticated state without a twofactor_success event.
  • Alert on repeated page reloads of the two-factor selection URL from the same client IP.

Monitoring Recommendations

  • Forward Nextcloud audit.log and nextcloud.log to a centralized SIEM for correlation and retention.
  • Monitor administrative changes to config.php, particularly session and cookie parameters.
  • Track accounts that have MFA enabled and alert when successful logins occur without MFA step completion.

How to Mitigate CVE-2025-47790

Immediate Actions Required

  • Upgrade Nextcloud Server to 29.0.15, 30.0.9, or 31.0.3 as appropriate for your branch.
  • Upgrade Nextcloud Enterprise Server to 26.0.13.15, 27.1.11.15, 28.0.14.6, 29.0.15, 30.0.9, or 31.0.3.
  • Terminate active sessions for accounts that may have authenticated through the vulnerable path.
  • Force password rotation for users whose credentials may already be compromised.

Patch Information

Nextcloud addressed the issue in pull request #51905 and the fix ships in the versions listed above. The patch restores enforcement of the second-factor challenge when a session expires on the provider-selection page. Administrators should apply the upgrade before relying on configuration workarounds.

Workarounds

  • Set remember_login_cookie_lifetime in config.php to a non-zero value such as 900 seconds.
  • Delete existing sessions after applying the workaround, since the setting only affects newly created sessions.
  • Audit all MFA-enabled accounts for suspicious authentication events prior to remediation.
bash
# Edit Nextcloud config.php to apply the workaround
# File: /var/www/nextcloud/config/config.php
'remember_login_cookie_lifetime' => 900,

# Clear existing sessions (example for Redis session backend)
redis-cli --scan --pattern 'nextcloud/*' | xargs redis-cli del

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.