CVE-2025-59788 Cross-site scripting in Nextcloud
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.
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.
Other vulnerabilities in Nextcloud Nextcloud Server
- CVE-2021-32802 Preview generation used third-party library not suited for user-generated content in Nextcloud server
- CVE-2023-26482 Scope of workflow operations is not validated in nextcloud server
- CVE-2018-3775 Auth bypass in Nextcloud Server
- CVE-2023-35172 Nextcloud Server password reset endpoint is not brute force protected
- CVE-2023-32320 Nextcloud Server's brute force protection allows someone to send more requests than intended
Sources
Also known as GHSA-24wp-p865-7j4r, GHSA-88cv-g9gq-h6pq.