Back to skill

Security audit

Synology DSM

Security checks for vulnerabilities and agentic risk

Overview

This skill is a coherent Synology NAS management guide, but it uses unsafe authentication examples that can expose NAS passwords or session tokens and under-scopes destructive file operations.

Review this skill carefully before installing. Use only HTTPS to DSM, avoid putting passwords or session IDs in URLs, prefer a least-privileged DSM account, and require explicit confirmation before deleting, overwriting, moving, uploading, downloading, or changing download tasks.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:23
Finding
DSM Credentials and Session Identifiers Exposed Through Plaintext HTTP URLs## Vulnerability Details **File Location**: `SKILL.md`, lines 23-37 and 50-256 **Vulnerability Type**: Plaintext transmission and URL exposure of authentication secrets **Risk Level**: High The skill recommends HTTPS in prose, but its base URL and every executable DSM API example use `http://`. The login request places the DSM username and password directly in the query string, while subsequent requests place the session identifier (`SID`) in their URLs. **Vulnerable code:** ```markdown Base URL: `http://$SYNOLOGY_HOST:$SYNOLOGY_PORT/webapi` > **Security**: Always prefer HTTPS (port 5001). Never hardcode credentials in commands shown to the user — use `$SYNOLOGY_PASS` references. If the user hasn't set env vars, ask them to provide connection details. ``` ```bash curl -s "http://$SYNOLOGY_HOST:$SYNOLOGY_PORT/webapi/entry.cgi?\ api=SYNO.API.Auth&version=6&method=login\ &account=$SYNOLOGY_USER&passwd=$SYNOLOGY_PASS\ &session=FileStation&format=sid" | jq . ``` ```bash curl -s "http://$SYNOLOGY_HOST:$SYNOLOGY_PORT/webapi/entry.cgi?\ api=SYNO.API.Auth&version=6&method=logout\ &session=FileStation&_sid=$SID" ``` The same insecure URL pattern is used throughout the FileStation, DownloadStation, and system-information examples through line 256: ```bash curl -s "http://$SYNOLOGY_HOST:$SYNOLOGY_PORT/webapi/entry.cgi?\ api=SYNO.FileStation.Delete&version=2&method=delete\ &path=/volume1/homes/unwanted_file&_sid=$SID" | jq . ``` ### Technical Analysis HTTP provides no transport confidentiality or server authentication. An attacker with visibility into the network path—such as a compromised router, malicious wireless access point, hostile local-network participant, or upstream proxy—can inspect or modify these requests. Referencing secrets through environment variables does not prevent disclosure here. The shell expands `$SYNOLOGY_USER`, `$SYNOLOGY_PASS`, and `$SID` before invoking `curl`, so their values b ...[truncated 2030 chars]
Remediation
## Remediation Suggestions 1. **Require HTTPS rather than merely recommending it.** - Define the base URL with `https://`. - Refuse to transmit credentials when the configured endpoint is HTTP. - Make the protocol explicit through a validated variable if legacy deployments must be supported. ```bash SYNOLOGY_BASE_URL="https://$SYNOLOGY_HOST:${SYNOLOGY_PORT:-5001}/webapi" ``` 2. **Move login credentials out of the URL.** - Use an HTTPS POST request with form fields. - Use `--data-urlencode` so special characters in usernames, passwords, session names, and OTP values cannot alter parameter boundaries. ```bash curl --silent --show-error --fail-with-body \ --request POST \ --data-urlencode "api=SYNO.API.Auth" \ --data-urlencode "version=6" \ --data-urlencode "method=login" \ --data-urlencode "account=$SYNOLOGY_USER" \ --data-urlencode "passwd=$SYNOLOGY_PASS" \ --data-urlencode "session=FileStation" \ --data-urlencode "format=sid" \ "$SYNOLOGY_BASE_URL/entry.cgi" ``` 3. **Avoid session identifiers in query strings.** - Prefer DSM's secure session-cookie mechanism where supported. - Otherwise, send the SID in an HTTPS POST body rather than in the URL. - Ensure diagnostic output, command tracing, and logs do not contain the SID. 4. **Enforce certificate verification.** - Retain `curl`'s default TLS certificate and hostname verification. - Do not recommend `curl -k` or `--insecure`. - For a private DSM certificate authority, configure a trusted CA using `--cacert` or the host trust store. 5. **Reduce compromise impact.** - Use a dedicated, least-privileged DSM service account. - Grant access only to required shares and APIs. - Avoid administrator accounts for routine FileStation or DownloadStation operations. - Unset password and SID variables after logout and ensure logout runs even when an ...[truncated 266 chars]
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (10)

Vague Triggers

Medium
Confidence
95% confidence
Finding
The activation guidance is broad enough to trigger on generic mentions of Synology, NAS, or downloads, increasing the chance that a high-privilege skill is invoked when the user did not clearly intend device administration. Because this skill can authenticate, browse files, and perform destructive actions on a NAS, overbroad routing raises the risk of inappropriate use and accidental sensitive operations.

Context-Inappropriate Capability

Medium
Confidence
97% confidence
Finding
The skill places DSM credentials and later session IDs directly in URL query strings and defaults to `http://`, which can expose secrets via shell history, process listings, proxy/server logs, browser-equivalent telemetry, and cleartext network interception. In the context of NAS administration, these secrets grant broad access to files and system functions, so leakage can lead to full compromise of the device and stored data.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The skill documents rename and delete operations, including recursive or task-based deletions, without a prominent warning about irreversible data loss or the need for explicit confirmation. In a NAS context, mistakes can affect shared folders, backups, and multi-user data, making accidental destructive actions significantly more damaging than on a local scratch environment.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
The upload and download examples do not clearly warn that local files will be transmitted to the NAS and that downloaded content or metadata may traverse the network and be stored remotely. In practice, this can cause unintentional disclosure of sensitive local data or transfer of untrusted content into the NAS environment, especially if users assume the commands are local-only file operations.

External Transmission

Medium
Category
Data Exfiltration
Content
### Add download task (URL)

```bash
curl -s -X POST \
  -d "api=SYNO.DownloadStation.Task&version=1&method=create\
&uri=https://example.com/file.zip&_sid=$SID" \
  "http://$SYNOLOGY_HOST:$SYNOLOGY_PORT/webapi/entry.cgi"
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
This markdown file describes a `method=delete` operation that removes download tasks, but it does not include any warning about potential data loss or irreversible effects. For markdown files, destructive behaviors that can affect user data or system state should be accompanied by an explicit warning.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
This markdown file documents deletion endpoints, including recursive deletion by default and asynchronous deletion of large items, but provides no warning about potential data loss or irreversible effects. For markdown files, SQP-2 applies when descriptions omit warnings about behaviors that could affect user data or system integrity.

Missing User Warnings

Low
Confidence
83% confidence
Finding
The upload section documents an `overwrite` option that can replace existing files, but does not include any caution about modifying user data. In markdown documentation, potentially data-affecting behavior should be accompanied by a user-facing warning.

Missing User Warnings

Low
Confidence
85% confidence
Finding
The `remove_src` parameter changes the operation from copy to move, which can alter or remove data from the source location, but the documentation does not call out this consequence. This is a user-data-impacting behavior that should be disclosed in markdown guidance.

Missing User Warnings

Low
Confidence
82% confidence
Finding
The extract operation includes an `overwrite` option that may replace files in the destination, but no warning is provided about the risk to existing data. Under SQP-2 for markdown files, this omission should be disclosed when system or user data may be affected.

Static analysis

No suspicious patterns detected.