What’s Vulnerable › Vulnerabilities
CVE-2022-31014: SMTP Command Injection in iCalendar Attachments to emails via newlines in Nextcloud Server
- Severity: low (CVSS 3.5 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 2.5% probability of exploitation in the next 30 days
- Public exploit or detection template: yes
- Published: 2022-07-05 · updated 2026-06-17
- Weakness: CWE-74
Description
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.
Affected products
- Nextcloud Server: before 19.0.13.7; before 22.2.8; from 20.0.0 before 20.0.14.6; from 21.0.0 before 21.0.9.5; from 23.0.0 before 23.0.5; 24.0.0, 24.0.0-beta1, 24.0.0-beta2, 24.0.0-beta3, 24.0.0-rc1, 24.0.0-rc2 (+1) — fixed in 19.0.13.7, 20.0.14.6, 21.0.9.5, 22.2.8, 23.0.5
How to fix
Upgrade to a fixed version: Nextcloud Server 19.0.13.7, 20.0.14.6, 21.0.9.5, 22.2.8. Check the vendor advisory for mitigations.
References
- https://github.com/nextcloud/security-advisories/security/advisories/GHSA-264h-3v4w-6xh2
- https://github.com/nextcloud/server/pull/32428
- https://hackerone.com/reports/1516377
- https://github.com/nextcloud/security-advisories/security/advisories/GHSA-264h-3v4w-6xh2
- https://github.com/nextcloud/server/pull/32428
- https://hackerone.com/reports/1516377
Get alerted when CVE-2022-31014 or the next vulnerability affects your stack