CVE-2021-32726

7.1 HIGH

📋 TL;DR

This vulnerability in Nextcloud Server allows account takeover when usernames are reused. When a user account is deleted, their WebAuthn authentication tokens remain active. If a new user later registers with the same username, the previous user could use their old tokens to access the new account. This affects all Nextcloud Server instances running vulnerable versions.

💻 Affected Systems

Products:
  • Nextcloud Server
Versions: Versions prior to 19.0.13, 20.0.11, and 21.0.3
Operating Systems: All platforms running Nextcloud Server
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects installations using WebAuthn authentication. All Nextcloud Server deployments with vulnerable versions are affected regardless of configuration.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Previous user gains full access to new user's account, potentially accessing sensitive files, contacts, calendar data, and performing actions as the legitimate user.

🟠

Likely Case

Account takeover leading to unauthorized access to personal or organizational data stored in Nextcloud.

🟢

If Mitigated

No impact if proper username management prevents reuse or if patched versions are used.

🌐 Internet-Facing: HIGH - Nextcloud instances exposed to the internet are directly vulnerable to this authentication bypass.
🏢 Internal Only: MEDIUM - Internal instances are still vulnerable but attack surface is reduced to internal users.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: LOW

Exploitation requires knowledge of deleted username and possession of old WebAuthn tokens. No public exploit code available but attack methodology is straightforward.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 19.0.13, 20.0.11, or 21.0.3 depending on your version branch

Vendor Advisory: https://github.com/nextcloud/security-advisories/security/advisories/GHSA-6qr9-c846-j8mg

Restart Required: Yes

Instructions:

1. Backup your Nextcloud installation and database. 2. Update to the patched version using your package manager or manual download. 3. Run occ upgrade command: sudo -u www-data php occ upgrade. 4. Restart web server (Apache/Nginx) and PHP-FPM if applicable.

🔧 Temporary Workarounds

Disable WebAuthn

all

Temporarily disable WebAuthn authentication until patching is complete

sudo -u www-data php occ config:app:set twofactor_webauthn enabled --value false

🧯 If You Can't Patch

  • Implement strict username management policy preventing reuse of deleted usernames
  • Monitor authentication logs for suspicious WebAuthn token usage patterns

🔍 How to Verify

Check if Vulnerable:

Check Nextcloud version via occ command: sudo -u www-data php occ status | grep version

Check Version:

sudo -u www-data php occ status | grep version

Verify Fix Applied:

Verify version is 19.0.13+, 20.0.11+, or 21.0.3+ and test that deleted user WebAuthn tokens are properly removed

📡 Detection & Monitoring

Log Indicators:

  • Failed WebAuthn authentication attempts from deleted users
  • Successful authentication with WebAuthn tokens for recently created accounts

Network Indicators:

  • Unusual authentication patterns from previously deleted user accounts

SIEM Query:

source="nextcloud.log" AND ("webauthn" AND "authentication" AND ("failed" OR "success")) AND user="*deleted_user*"

🔗 References

📤 Share & Export