Back to skill

Security audit

Cobot

Security checks for vulnerabilities and agentic risk

Overview

The skill claims to help plan collaborative robot tasks, but the inspected artifact is a local entry/config manager with persistent file writes and unsafe input handling.

Review this before installing. Treat it as a local note/config CLI, not a robot planner. Do not pass untrusted values to config, avoid opening exported CSVs from untrusted entries in spreadsheet software, and keep COBOT_DIR in a private directory you control.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/script.sh:133
Finding

Arbitrary Command Execution Through Sed Program Injection

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 The configuration key and value are inserted directly into a sed program: ```bash sed -i "s|^${key}=.*|${key}=${val}|" "$cfg" ``` Shell quoting prevents an additional shell expansion pass, but it does not make the resulting text safe as sed syntax. An attacker can include the `|` delimiter, newline characters, backreferences, or additional sed commands in `key` or `val`. On GNU sed, an injected `e` command can execute an arbitrary shell command. This path is reached when the configuration file already contains a line matching the supplied key. The key is also interpreted as a regular expression by `grep` and sed rather than as a literal configuration key. ### Attack Path 1. Ensure that an existing configuration key is present: ```bash scripts/script.sh config theme default ``` 2. Construct a value that closes the substitution and introduces a GNU sed `e` command: ```bash payload=$'safe|\ne touch /tmp/cobot-command-executed\n#' ``` 3. Update the existing key: ```bash scripts/script.sh config theme "$payload" ``` 4. The expa ...[truncated 824 chars]
Remediation
View remediation
&2 return 1 } ``` - Reject control characters, including carriage returns and newlines, if the line-oriented configuration format is retained. - Replace the sed update with a routine in which input is passed as data rather than executable syntax. A structured configuration format and serializer are preferred. - Write updates to a securely created temporary file in the same directory, validate successful serialization, set restrictive permissions, and atomically rename it over the original file. - Add regression tests covering delimiter characters, newlines, regular-expression metacharacters, backslashes, and attempted sed command injection. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/script.sh:9
Finding

Malformed JSON and Record Injection Through Unescaped Entry Values

Content
View full analysis
> "$DATA_DIR/data.jsonl" } ``` The affected function is called with user-controlled entry data: ```bash cmd_add() { local value="${1:?Usage: cobot 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 `_save_entry` writes JSON text using `printf`, but it does not apply JSON escaping to `val`. Quotes, backslashes, control characters, and newline characters therefore retain their syntactic meaning. An entry containing a quote can terminate the intended JSON string. A newline can terminate the JSONL record and insert additional attacker-controlled lines. As a result, `data.jsonl` may no longer contain valid JSON Lines data and can include forged records. The listing, searching, and export functions subsequently process this file using regular-expression extraction rather than a JSON parser. This does not restore record integrity and can cause corrupted or injected content to be displayed or exported. ### Attack Path 1. Invoke `add` with an entry containing JSON syntax and a newline, for example an argument conceptually shaped like: ```text legitimate"} {"ts":"2099-01-01 00:00:00","cmd":"add","val":"forged ``` 2. `_save_entry` inserts the text directly between JSON quotation marks. 3. The newline creates an additional physical record in `data.jsonl`, while the quotation marks alter the surrounding JSON structure. 4. `list`, `search`, or `export` later processes the corrupted or forged records. 5. ...[truncated 639 chars]
Remediation
View remediation
> "$DATA_DIR/data.jsonl" ``` - If external dependencies are undesirable, implement standards-compliant JSON escaping for quotation marks, backslashes, and all control characters. - Parse records with a JSON parser in `list`, `search`, and `export` rather than extracting fields with `grep`. - Reject malformed existing records and report their line numbers instead of silently processing them. - Add tests for embedded quotes, backslashes, tabs, carriage returns, newlines, Unicode, and control characters. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/script.sh:101
Finding

Spreadsheet Formula Injection and Invalid CSV Serialization

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 The CSV export concatenates fields with commas without applying RFC 4180-style quoting or escaping. Values containing commas, quotation marks, carriage returns, or newlines can therefore alter column and record boundaries. In addition, spreadsheet applications may interpret cells beginning with characters such as `=`, `+`, `-`, or `@` as formulas. Because task values are user-controlled and exported without neutralization, an attacker can store a formula-like value that is evaluated when a user opens the CSV in a spreadsheet application. The exact behavior and severity depend on the spreadsheet software and its security configuration. Potential formula behavior includes external requests, misleading links, or access to spreadsheet data. ### Attack Path 1. Add an entry whose value begins with a spreadsheet formula marker, such as: ```bash scripts/script.sh add '=HYPERLINK("https://attacker.invalid/","Open report")' ``` 2. Export the registry: ```b ...[truncated 998 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
scripts/script.sh:6
Finding

Predictable Data Files Permit Symlink-Redirected Writes in Attacker-Writable Directories

Content
View full analysis
> "$DATA_DIR/data.jsonl" } ``` Related configuration writes use another predictable file: ```bash local cfg="$DATA_DIR/config.txt" ... echo "${key}=${val}" >> "$cfg" ``` ### Technical Analysis The Skill permits `COBOT_DIR` to select the storage directory and uses predictable names such as `data.jsonl` and `config.txt`. It neither verifies that these paths are regular files owned by the expected user nor rejects symbolic links before append operations. Shell append redirection follows symbolic links. If the selected directory is writable by an attacker, that attacker can create `data.jsonl` or `config.txt` as a symbolic link to another file. Subsequent `add` or new-key `config` operations may append controlled content to the linked target. `mkdir -p` also does not enforce a restrictive data-directory mode. The resulting permissions depend on the process umask, which can expose stored entries or configuration to other local users. Under the normal default directory in a correctly protected home directory, exploitability is reduced because another user ordinarily cannot create files there. ### Attack Path 1. The Skill is configured to use a shared or attacker-writable directory through `COBOT_DIR`, or the existing data directory otherwise becomes writable by another local user. 2. The local attacker creates a predictable path as a symbolic link: ```bash ln -s /path/writable/by/skill-user/target shared-cobot/data.jsonl ``` 3. The victim invokes: ```bash COBOT_DIR=s ...[truncated 960 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 (5)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill is presented as a collaborative robot task planner, but the documented commands indicate a generic local data management tool with add/list/search/remove/export/config capabilities. This mismatch can mislead users and higher-level agents into granting trust, invoking the skill in inappropriate operational contexts, or exposing local data and file-writing behavior they did not expect.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill documentation exposes data-modifying and file-output commands such as add, remove, export, and config without warning users that these operations alter local state or create files. In an agent ecosystem, missing safety disclosures can cause unintended data loss, unexpected persistence, or accidental file creation when the skill is invoked automatically.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The header/help text claims the tool is a collaborative robot task planner, but the commands only manipulate generic entries. In an agent-skill ecosystem, deceptive or inaccurate capability labeling is a security issue because it can mislead automated selection, cause the wrong tool to be invoked in operational contexts, and hide unexpected local data collection behavior.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script’s advertised purpose does not match its actual behavior: instead of handling structured cobot JSON/CSV tasks or robot status, it acts as a generic local data store and note manager. This mismatch is dangerous because users or higher-level agents may grant trust, permissions, or automation decisions based on the declared cobot-planning role, causing inappropriate use, silent data persistence, or unsafe workflow assumptions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

This shell script modifies or creates a persistent config file under the user's data directory, but there is no prior disclosure in help text, comments, or prompts that the operation writes configuration data to disk. Because this affects user data persistence outside the immediate command output, a warning or explicit notice would improve transparency.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.