CVE-2025-66512 Nextcloud Server vulnerable to XSS in SVG images when opened outside of Nextcloud

Medium 5.4 Published Updated

Attackers can execute scripts via malicious SVGs viewed outside the web interface, bypassing CSP and potentially compromising user sessions.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
None listed

What is CVE-2025-66512?

CVE-2025-66512 is a medium-severity cross-site scripting vulnerability in Nextcloud Nextcloud Server, published on 5 Dec 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

Nextcloud Server is a self hosted personal cloud system. In Nextcloud Server and Server Enterprise prior to 31.0.12 and 32.0.3, a missing sanitization allowed malicious users to circumvent the content security policy when a malicious user manages to trick a user it viewing an uploaded SVG outside of the Nextcloud Servers web page.

Weakness: CWE-79, CWE-80

Which versions are affected by CVE-2025-66512?

It affects 1 product.

Products include Nextcloud Nextcloud Server.

How do I fix CVE-2025-66512?

No fix has been published for CVE-2025-66512 yet. Limit exposure of the affected software until one is available.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2025-66512 being exploited?

There is no known exploitation of CVE-2025-66512 in the wild and no public exploit code.

All Nextcloud Nextcloud Server vulnerabilities

Sources

Also known as GHSA-qcw2-p26m-9gc5.

Is CVE-2025-66512 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free