Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2024-37313

CVE-2024-37313: Nextcloud Server Auth Bypass Vulnerability

CVE-2024-37313 is an authentication bypass vulnerability in Nextcloud Server that allows attackers to circumvent 2FA after valid credentials. This article covers technical details, affected versions, and patches.

Published:

CVE-2024-37313 Overview

CVE-2024-37313 is an authentication bypass vulnerability affecting Nextcloud Server and Nextcloud Enterprise Server. Under specific conditions, an attacker who already possesses valid user credentials can bypass the second factor of two-factor authentication (2FA). The flaw weakens the security guarantees of 2FA on affected installations, allowing account takeover when credentials are leaked, phished, or reused. The issue is tracked under [CWE-287] (Improper Authentication) and was disclosed through the Nextcloud security advisory GHSA-9v72-9xv5-3p7c.

Critical Impact

Attackers with valid credentials can bypass 2FA protections on Nextcloud Server, eliminating the secondary authentication layer that protects sensitive self-hosted data.

Affected Products

  • Nextcloud Server versions prior to 26.0.13, 27.1.8, and 28.0.4
  • Nextcloud Enterprise Server versions prior to 21.0.9.17, 22.2.10.22, 23.0.12.17, 24.0.12.13, 25.0.13.8, 26.0.13, 27.1.8, and 28.0.4
  • Self-hosted Nextcloud deployments relying on 2FA as a primary access control

Discovery Timeline

  • 2024-06-14 - CVE-2024-37313 published to NVD
  • 2025-09-26 - Last updated in NVD database

Technical Details for CVE-2024-37313

Vulnerability Analysis

The vulnerability resides in the authentication flow of Nextcloud Server. After a user successfully submits valid credentials, the application is expected to enforce the configured second authentication factor before issuing a session. Under specific circumstances described in the vendor advisory, this enforcement could be bypassed, granting the attacker access without completing the 2FA challenge.

The weakness is categorized as [CWE-287] Improper Authentication. It impacts the integrity of the authentication boundary while leaving confidentiality and availability paths through 2FA untouched at the protocol level. The fix is contained in the upstream pull request nextcloud/server#44276, which corrects the authentication state handling.

Root Cause

The root cause is a logic flaw in how the server tracks the state between primary credential validation and second-factor challenge completion. The session transition did not consistently verify that the 2FA challenge had been satisfied before granting authenticated access. Additional context is provided in the HackerOne report 2419776.

Attack Vector

The attack vector is network-based and requires no user interaction. An attacker must possess valid primary credentials, typically obtained through phishing, credential stuffing, or prior database leaks. The attacker triggers the bypass during the post-credential authentication step to reach an authenticated session without providing the second factor. The vulnerability impacts integrity by allowing the attacker to act as the victim user.

// No verified proof-of-concept code is publicly available.
// See the Nextcloud security advisory and PR #44276 for technical fix details.

Detection Methods for CVE-2024-37313

Indicators of Compromise

  • Successful authentications to Nextcloud accounts that have 2FA configured but show no corresponding 2FA challenge event in application logs.
  • Sessions created immediately after a primary login without the expected twofactor provider entries.
  • Unusual geolocation or device fingerprint changes for 2FA-enabled accounts.

Detection Strategies

  • Audit Nextcloud nextcloud.log and webserver access logs to correlate login events with 2FA provider invocations.
  • Compare authenticated session creation events against expected 2FA enforcement records for each user.
  • Monitor for authentication anomalies such as repeated logins from leaked-credential sources targeting 2FA-protected accounts.

Monitoring Recommendations

  • Forward Nextcloud authentication and audit logs to a centralized SIEM or data lake for correlation and retention.
  • Alert on logins to 2FA-enabled accounts that lack the corresponding second-factor success event within the same session.
  • Track installed Nextcloud Server versions across the fleet and alert when hosts run versions below the patched releases.

How to Mitigate CVE-2024-37313

Immediate Actions Required

  • Upgrade Nextcloud Server to 26.0.13, 27.1.8, or 28.0.4 as soon as possible.
  • Upgrade Nextcloud Enterprise Server to 21.0.9.17, 22.2.10.22, 23.0.12.17, 24.0.12.13, 25.0.13.8, 26.0.13, 27.1.8, or 28.0.4 depending on the deployed branch.
  • Invalidate active sessions and force re-authentication for all users after patching.
  • Review authentication logs for evidence of bypass activity prior to the upgrade.

Patch Information

The upstream fix is implemented in Nextcloud server pull request #44276 and documented in the GitHub Security Advisory GHSA-9v72-9xv5-3p7c. Administrators should apply the relevant patched version for their release branch and verify that the upgrade completed cleanly using occ status.

Workarounds

  • No official workaround is provided by the vendor; upgrading is the required remediation.
  • Restrict network exposure of the Nextcloud login endpoint via VPN, reverse proxy ACLs, or IP allowlists until patching is complete.
  • Enforce strong, unique passwords and credential rotation to reduce the value of any leaked credentials.
bash
# Example: upgrade verification using the Nextcloud occ CLI
sudo -u www-data php /var/www/nextcloud/occ status
sudo -u www-data php /var/www/nextcloud/occ upgrade

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

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

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.