CVE-2025-66512

5.4 MEDIUM

📋 TL;DR

This vulnerability allows malicious users to bypass Nextcloud's Content Security Policy (CSP) by tricking users into viewing specially crafted SVG files outside the Nextcloud web interface. This affects Nextcloud Server and Server Enterprise installations where users can upload files. Attackers could potentially execute malicious scripts in the victim's browser context.

💻 Affected Systems

Products:
  • Nextcloud Server
  • Nextcloud Server Enterprise
Versions: Versions prior to 31.0.12 and 32.0.3
Operating Systems: All platforms running Nextcloud
Default Config Vulnerable: ⚠️ Yes
Notes: Requires the Nextcloud Viewer app and ability for users to upload SVG files.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Malicious actors could execute arbitrary JavaScript in victim browsers, potentially leading to session hijacking, data theft, or further exploitation of the Nextcloud instance.

🟠

Likely Case

Attackers could bypass CSP protections to run limited scripts, potentially stealing session cookies or performing actions as the victim within Nextcloud.

🟢

If Mitigated

With proper CSP configurations and user education about opening untrusted files, impact is limited to potential script execution within the SVG viewer context.

🌐 Internet-Facing: MEDIUM - Requires user interaction and file upload access, but internet-facing instances are more likely to be targeted.
🏢 Internal Only: LOW - Internal users would need to be malicious and have upload privileges, making exploitation less likely.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Exploitation requires authenticated user with file upload permissions and social engineering to trick victims into viewing malicious SVG files outside the Nextcloud web interface.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 31.0.12 or 32.0.3

Vendor Advisory: https://github.com/nextcloud/security-advisories/security/advisories/GHSA-qcw2-p26m-9gc5

Restart Required: No

Instructions:

1. Update Nextcloud Server to version 31.0.12 or 32.0.3 or later. 2. Update via Nextcloud's web updater or manually via command line. 3. Clear browser cache after update.

🔧 Temporary Workarounds

Disable SVG file uploads

all

Prevent users from uploading SVG files to eliminate the attack vector

Edit config/config.php and add: 'enabledPreviewProviders' => array_diff($CONFIG['enabledPreviewProviders'], ['OC\Preview\SVG'])

Restrict file upload permissions

all

Limit which users can upload files to trusted individuals only

🧯 If You Can't Patch

  • Educate users about the risks of opening SVG files from untrusted sources
  • Implement strict Content Security Policy headers and monitor for violations

🔍 How to Verify

Check if Vulnerable:

Check Nextcloud version via Admin Settings > Overview or run: sudo -u www-data php occ status

Check Version:

sudo -u www-data php occ status | grep 'versionstring'

Verify Fix Applied:

Confirm version is 31.0.12 or 32.0.3 or higher, and check that the Viewer app is updated to version containing commit 5044a27d

📡 Detection & Monitoring

Log Indicators:

  • Multiple SVG file uploads from single user
  • CSP violation logs showing SVG-related bypass attempts
  • Unusual file access patterns to SVG files

Network Indicators:

  • Requests for SVG files with suspicious parameters
  • CSP violation reports in browser console

SIEM Query:

source="nextcloud.log" AND ("svg" OR "CSP violation") AND ("upload" OR "access")

🔗 References

📤 Share & Export