Back to skill

Security audit

Dcs

Security checks for vulnerabilities and agentic risk

Overview

This skill is a local note/config data manager presented as an industrial distributed control system manager, and its config command has a real command-execution risk.

Review carefully before installing. This appears to be a persistent local data tracker, not a distributed control system manager. Do not use it with untrusted input, and avoid the config and CSV export features unless the implementation is fixed to safely serialize data and avoid sed command construction.

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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/script.sh:134
Finding

Command Execution Through sed Program Injection in Configuration Updates

Content
View full analysis
)"; fi elif [ -z "$val" ]; then grep "^${key}=" "$cfg" 2>/dev/null | cut -d= -f2- || echo "(not set)" else if [ -f "$cfg" ] && grep -q "^${key}=" "$cfg" 2>/dev/null; then sed -i "s|^${key}=.*|${key}=${val}|" "$cfg" else echo "${key}=${val}" >> "$cfg" fi echo "Set: $key=$val" fi } ``` ### Technical Analysis Both `key` and `val` are inserted directly into a dynamically constructed sed program. The script applies no validation or escaping for sed delimiters, regular-expression operators, replacement metacharacters, or newline characters. In the update branch, a crafted value can terminate the intended substitution and append another sed command. On GNU sed, the `e` command can execute an external shell command. A multiline argument can therefore transform the generated sed expression into a program containing an attacker-selected command. The same unescaped key is also interpreted as a regular expression by `grep` and sed, which can cause unintended configuration entries to be selected or modified. ### Attack Path 1. The attacker causes a configuration key, such as `foo`, to exist in `config.txt`. 2. The attacker supplies `config foo` with a crafted multiline value containing the sed delimiter, a newline, and a GNU sed `e` command. 3. The existing-key check succeeds, and the script interpolates the value into: ```bash sed -i "s|^${key}=.*|${key}=${val}|" "$cfg" ``` 4. The injected delimite ...[truncated 642 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/script.sh:10
Finding

JSONL Record Injection Through Unescaped Entry Values

Content
View full analysis
> "$DATA_DIR/data.jsonl" } ``` The value originates from user-controlled command arguments: ```bash cmd_add() { local value="${1:?Usage: dcs add }" shift || true _save_entry "add" "$value $*" local count=$(wc -l < "$DATA_DIR/data.jsonl" 2>/dev/null || echo 0) echo "Added: $value (entry #$count)" } ``` ### Technical Analysis The script constructs JSON through string formatting rather than using a JSON serializer. User-controlled values are placed directly between JSON quotation marks without escaping quotation marks, backslashes, control characters, or newlines. An attacker can close the `val` string and inject additional JSON syntax. A newline can also introduce extra physical records into the JSONL file. Consequently, the stored file may cease to be valid JSONL, and line-oriented operations can treat attacker-created lines as independent entries. The listing and search functions use regular expressions to parse this data rather than validating JSON, so malformed or injected records can propagate through subsequent operations. ### Attack Path 1. The attacker supplies an `add` value containing JSON quotation marks, backslashes, or newline characters. 2. `_save_entry` inserts the value directly into the JSON template. 3. The resulting `data.jsonl` contains malformed data or additional attacker-controlled lines. 4. Commands such as `list`, `search`, `remove`, `stats`, and `export` process the corrupted file as if each physical line were a legitimate record. 5. The attacker can forge displayed records, manipulate line-based entry counts, or cause l ...[truncated 381 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/script.sh:97
Finding

CSV Formula Injection and Malformed Export Through Unescaped Fields

Content
View full analysis
"$out" while IFS= read -r line; do ts=$(echo "$line" | grep -o '"ts":"[^"]*' | cut -d'"' -f4) c2=$(echo "$line" | grep -o '"cmd":"[^"]*' | cut -d'"' -f4) vl=$(echo "$line" | grep -o '"val":"[^"]*' | cut -d'"' -f4) echo "$ts,$c2,$vl" >> "$out" done < "$DATA_DIR/data.jsonl" ;; *) echo "Formats: json, csv"; return 1 ;; esac echo "Exported: $out ($(wc -c < "$out") bytes)" } ``` ### Technical Analysis CSV fields are concatenated with commas without CSV quoting or escaping. Values containing commas, quotation marks, carriage returns, or newlines can change the exported row and column structure. In addition, attacker-controlled values beginning with spreadsheet formula markers such as `=`, `+`, `-`, or `@` are written unchanged. Spreadsheet applications may interpret those cells as formulas when the exported file is opened. The precise effects depend on the spreadsheet application and its security configuration. The function also parses JSON using `grep` and `cut`, so escaped quotation marks or malformed records are not handled reliably. ### Attack Path 1. The attacker stores an entry whose value contains CSV delimiters, line breaks, or a spreadsheet formula prefix. 2. A user invokes `export csv`. 3. The script writes the attacker-controlled field directly to `dcs-export.csv` without quoting or neutralization. 4. The exported structure may contain forged rows or columns. 5. If the file is ope ...[truncated 508 chars]
Remediation
View remediation
Vulnerability Patterns
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill claims to be a distributed control system manager, but the documented behavior is a local JSONL-backed record manager with add/list/search/remove/export/config operations. This mismatch is dangerous because it can mislead users and higher-level agents into invoking a skill under false assumptions, increasing the chance of inappropriate use, unintended data handling, or concealment of the skill’s real purpose.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill metadata claims to manage distributed control systems, but the implementation is actually a local note/data tracker that stores arbitrary user input under the home directory. This deceptive mismatch is dangerous because it can mislead users and reviewers about the skill’s real behavior, enabling covert data collection or persistence under an unrelated, more trusted description.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The skill documents state-changing and potentially destructive operations such as add, remove, export, and config changes without any warning, confirmation, or cautionary note. In an agent-driven context, this raises the risk of accidental data loss, silent overwrites, or unintended persistence because users or automated systems may treat these commands as harmless informational actions.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.