CVE-2022-31014: SMTP Command Injection in iCalendar Attachments to emails via newlines in Nextcloud Server
CVE-2022-31014 affects 42 listed versions of Nextcloud in the Dawnsentry catalogue.
Affected products and versions
The versions in the Dawnsentry catalogue this CVE affects, judged from the vendor's own advisory where there is one, otherwise from the CVE record and NVD, as each version's own page says.
Nextcloud
42 of 250 listed versions are affected. Fixed in 22.2.8, 21.0.9.5, 20.0.14.6, 19.0.13.7. The newest release, 35.0.3, is not affected.
22.1.1 22.1.0 22.0.0 21.0.9 21.0.8 21.0.7 21.0.6 21.0.5 21.0.4 20.0.14.4 20.0.14 20.0.13 20.0.12 20.0.11 20.0.10 20.0.9 20.0.8 20.0.7 20.0.6 19.0.13 19.0.12 19.0.11 19.0.10 19.0.9 19.0.8 19.0.7 19.0.6 19.0.5 19.0.4 19.0.3 19.0.2 18.0.14 18.0.13 18.0.12 18.0.11 18.0.10 18.0.9 18.0.8 18.0.7 18.0.6 18.0.5 18.0.4
What it is
Nextcloud server is an open source personal cloud server. Affected versions were found to be vulnerable to SMTP command injection. The impact varies based on which commands are supported by the backend SMTP server. However, the main risk here is that the attacker can then hijack an already-authenticated SMTP session and run arbitrary SMTP commands as the email user, such as sending emails to other users, changing the FROM user, and so on. As before, this depends on the configuration of the server itself, but newlines should be sanitized to mitigate such arbitrary SMTP command injection. It is recommended that the Nextcloud Server is upgraded to 22.2.8 , 23.0.5 or 24.0.1. There are no known workarounds for this issue.
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:N/I:L/A:N (NVD)
Published by GitHub on 5 July 2022. Last changed 17 June 2026.
Sources
Check one version you run: look CVE-2022-31014 up, or pick a product and version in the quick lookup.
Updated 2 December 2026.