CVE-2021-39221 XSS in Contacts
Stored XSS in Nextcloud Contacts allows attackers to execute scripts if users open malicious files in new tabs, mitigated by CSP on modern browsers.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- None listed
What is CVE-2021-39221?
CVE-2021-39221 is a medium-severity cross-site scripting vulnerability in nextcloud security-advisories, published on 25 Oct 2021. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.
Official description
Nextcloud is an open-source, self-hosted productivity platform. The Nextcloud Contacts application prior to version 4.0.3 was vulnerable to a stored Cross-Site Scripting (XSS) vulnerability. For exploitation, a user would need to right-click on a malicious file and open the file in a new tab. Due the strict Content-Security-Policy shipped with Nextcloud, this issue is not exploitable on modern browsers supporting Content-Security-Policy. It is recommended that the Nextcloud Contacts application is upgraded to 4.0.3. As a workaround, one may use a browser that has support for Content-Security-Policy.
Which versions are affected by CVE-2021-39221?
It affects 1 product.
Products include Nextcloud Contacts.
How do I fix CVE-2021-39221?
No fix has been published for CVE-2021-39221 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-2021-39221 being exploited?
There is no known exploitation of CVE-2021-39221 in the wild and no public exploit code.
Other vulnerabilities in nextcloud security-advisories
- CVE-2020-8280 Cross-site scripting in Nextcloud Contacts
- CVE-2020-8281 Cross-site scripting in Nextcloud Contacts
- CVE-2018-3764 Cross-site scripting in Nextcloud Contacts application
- CVE-2020-8181 File upload in Nextcloud Contact
- CVE-2025-66554 Nextcloud Contacts vulnerable to Stored XSS in contacts app via organisation and title field
Sources
Also known as GHSA-j6cx-mxqf-f9vc.