CVE-2025-59788 Cross-site scripting in Nextcloud

Medium 6.4 Published Updated

Attackers can execute arbitrary JavaScript in user browsers via crafted PDFs in Nextcloud's exposed example viewer, potentially leading to account takeover.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
Not needed
Fix
None listed

What is CVE-2025-59788?

CVE-2025-59788 is a medium-severity cross-site scripting vulnerability in Nextcloud Nextcloud Server, published on 4 Dec 2025. Any signed-in user can exploit it over the network, with no action from the victim.

Official description

Cross-site scripting (XSS) vulnerability in a reachable files_pdfviewer example directory in Nextcloud with versions before 22.2.10.33, 23.0.12.29, 24.0.12.28, 25.0.13.23, 26.0.13.20, 27.1.11.20, 28.0.14.11, 29.0.16.8, 30.0.17, 31.0.10, and 32.0.1 allows attackers to execute arbitrary JavaScript in the context of a user's browser via a crafted PDF file to viewer.html. This issue is related to CVE-2024-4367, but the root cause of this Nextcloud issue is that the product exposes executable example code on a same-origin basis.

Weakness: CWE-79, CWE-749

Which versions are affected by CVE-2025-59788?

It affects 1 product.

Products include Nextcloud Nextcloud Server.

How do I fix CVE-2025-59788?

No fix has been published for CVE-2025-59788 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-59788 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-59788 exists.

All Nextcloud Nextcloud Server vulnerabilities

Sources

Also known as GHSA-24wp-p865-7j4r, GHSA-88cv-g9gq-h6pq.

Is CVE-2025-59788 in your software?

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

Check your SBOMs for free