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-2024-22400 Overview
CVE-2024-22400 affects the Nextcloud User Saml app, which authenticates Nextcloud users using Security Assertion Markup Language (SAML). The vulnerability allows attackers to craft links that appear to point to a trusted Nextcloud server but redirect users to attacker-controlled third-party servers. This open redirect flaw [CWE-601] enables phishing campaigns that abuse the trust users place in legitimate Nextcloud domains. The issue is resolved in User Saml versions 5.1.5, 5.2.5, and 6.0.1.
Critical Impact
Attackers can leverage trusted Nextcloud server links to redirect authenticated users to malicious third-party domains, enabling credential theft and phishing attacks.
Affected Products
- Nextcloud User Saml (SSO & SAML Authentication) versions prior to 5.1.5
- Nextcloud User Saml versions 5.2.0 through 5.2.4
- Nextcloud User Saml version 6.0.0
Discovery Timeline
- 2024-01-18 - CVE CVE-2024-22400 published to NVD
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2024-22400
Vulnerability Analysis
The vulnerability is an open redirect classified under [CWE-601]: URL Redirection to Untrusted Site. The User Saml app accepts a redirect parameter during the SAML authentication flow without validating the destination against a trusted domain list. An attacker crafts a URL that begins with the legitimate Nextcloud server address but includes a redirect parameter pointing to an attacker-controlled host. Users clicking the link start on the trusted Nextcloud domain and are then redirected off-site, typically to a cloned login page designed to harvest credentials.
Root Cause
The root cause stems from insufficient validation of user-supplied redirect targets within the SAML controller logic. The SAMLController.php file processed redirect parameters without consulting a trusted-domain allowlist. The upstream patch introduces the ITrustedDomainHelper interface to validate destinations before performing any redirect. The fix also refactors the controller to read the redirect parameter only once, eliminating request-smuggling style parameter manipulation.
Attack Vector
Exploitation requires user interaction. The attacker distributes a crafted URL pointing to the victim's Nextcloud instance with a malicious redirect parameter. When the user clicks the link, the SAML flow terminates by redirecting to the attacker's server. Because the originating domain is legitimate, email filters and users are less likely to flag the link as suspicious.
use OCP\IURLGenerator;
use OCP\IUserSession;
use OCP\Security\ICrypto;
+use OCP\Security\ITrustedDomainHelper;
use OCP\Server;
use OneLogin\Saml2\Auth;
use OneLogin\Saml2\Error;
Source: GitHub Commit b184304 — the patch imports ITrustedDomainHelper to validate redirect destinations against the configured trusted domain list.
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 AttacksDetection Methods for CVE-2024-22400
Indicators of Compromise
- Web server access logs containing SAML endpoint requests with unusual RelayState or redirect parameter values pointing to external domains
- User reports of being redirected to unexpected login pages after clicking Nextcloud links
- Email gateway logs showing inbound links to the Nextcloud instance with suspicious query parameters
Detection Strategies
- Inspect reverse proxy and web server logs for requests to /apps/user_saml/ endpoints containing redirect parameters with absolute URLs or external hostnames
- Correlate SAML authentication events with subsequent 302 redirect responses pointing to untrusted domains
- Deploy URL inspection on email security gateways to detect redirect parameter abuse in links targeting Nextcloud hostnames
Monitoring Recommendations
- Enable verbose logging on the User Saml app and forward authentication logs to a centralized Security Information and Event Management (SIEM) platform
- Alert on SAML flows that terminate with redirects to domains outside the organization's approved allowlist
- Monitor Nextcloud server version strings to confirm patched builds are deployed across all nodes
How to Mitigate CVE-2024-22400
Immediate Actions Required
- Upgrade the User Saml app to version 5.1.5, 5.2.5, or 6.0.1 depending on the installed major release branch
- Review the Nextcloud trusted domains configuration to confirm only authorized hosts are listed
- Notify end users to validate the destination URL after clicking any Nextcloud authentication link
Patch Information
The fix is published in User Saml versions 5.1.5, 5.2.5, and 6.0.1. The patch, available in GitHub Pull Request #788, introduces ITrustedDomainHelper validation and refactors parameter handling in SAMLController.php. Full details are documented in the Nextcloud GitHub Security Advisory GHSA-622q-xhfr-xmv7 and the original HackerOne Report #2263044.
Workarounds
- No official workarounds exist according to the vendor advisory; upgrading the User Saml app is the only remediation
- As a compensating control, restrict outbound redirects at the reverse proxy layer by rewriting or blocking responses that redirect to non-approved domains
# Upgrade User Saml via Nextcloud occ CLI
sudo -u www-data php occ app:update user_saml
sudo -u www-data php occ app:list | grep user_saml
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

