CVE-2021-32688

8.8 HIGH

📋 TL;DR

This vulnerability in Nextcloud Server allows application-specific authentication tokens to escalate their own permissions. Tokens configured with no filesystem access can grant themselves full filesystem access, bypassing intended restrictions. Affects Nextcloud Server versions prior to 19.0.13, 20.0.11, and 21.0.3.

💻 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
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects instances using application-specific tokens (not regular user passwords). Tokens must be created and then exploited.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Attackers with limited application tokens gain full filesystem access, potentially leading to data theft, data destruction, or ransomware deployment across all user data.

🟠

Likely Case

Malicious applications or compromised clients with limited tokens escalate to read/write all files, exposing sensitive user data and enabling further system compromise.

🟢

If Mitigated

With proper network segmentation and minimal token usage, impact is limited to specific applications rather than entire filesystem.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

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

Exploitation requires an attacker to have obtained an application token, then use it to call the vulnerable API endpoint. No public exploit code available but trivial to weaponize.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 19.0.13, 20.0.11, or 21.0.3

Vendor Advisory: https://github.com/nextcloud/security-advisories/security/advisories/GHSA-48m7-7r2r-838r

Restart Required: Yes

Instructions:

1. Backup your Nextcloud instance and database. 2. Update Nextcloud Server to version 19.0.13, 20.0.11, or 21.0.3 depending on your current version. 3. Restart web server and PHP-FPM services. 4. Verify update completed successfully.

🔧 Temporary Workarounds

Disable Application Tokens

all

Temporarily disable all application-specific tokens until patching can be completed.

# Revoke all app tokens via Nextcloud admin interface or database
# UPDATE oc_appconfig SET configvalue = 'no' WHERE appid = 'core' AND configkey = 'allow_app_tokens';

🧯 If You Can't Patch

  • Revoke all application-specific tokens immediately and use only regular user authentication
  • Implement strict network segmentation to isolate Nextcloud instance and monitor for suspicious token usage

🔍 How to Verify

Check if Vulnerable:

Check Nextcloud version via admin interface or run: php occ status | grep version

Check Version:

php occ status | grep version

Verify Fix Applied:

Confirm version is 19.0.13, 20.0.11, or 21.0.3 or higher. Test that limited tokens cannot modify their own permissions.

📡 Detection & Monitoring

Log Indicators:

  • Unusual token permission modification attempts in Nextcloud audit.log
  • Multiple failed then successful token permission change events
  • Tokens accessing files outside their originally configured scope

Network Indicators:

  • Unexpected API calls to token permission endpoints from client applications
  • Increased data transfer from clients with limited tokens

SIEM Query:

source="nextcloud.log" AND ("token" AND "permission" AND "modif")

🔗 References

📤 Share & Export