Back to skill

Security audit

Actuator

Security checks for vulnerabilities and agentic risk

Overview

This package is presented as an actuator sizing calculator, but it behaves as a persistent local record manager and contains an unsafe config command that can execute injected shell commands.

Review this carefully before installing. It is not an actuator sizing calculator as described; it stores user-provided entries locally, can delete or export them, and its config command should be treated as unsafe with untrusted input. Do not use it for sensitive operational notes or in automated workflows unless the implementation is corrected and scoped to its advertised purpose.

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
scripts/script.sh:140
Finding

Arbitrary Command Execution Through GNU sed Program Injection

Content
View full analysis

Vulnerability Details

File Location: scripts/script.sh, lines 140-145
Vulnerability Type: Shell command execution through sed-program injection
Risk Level: High

bash
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"

Technical Analysis

The config command inserts the user-controlled key and val arguments directly into a dynamically constructed GNU sed program. The script does not validate or escape sed delimiters, regular-expression metacharacters, replacement metacharacters, or newline characters.

An attacker can terminate the intended substitution with a | character and inject a newline followed by GNU sed's e command. The e command executes an operating-system command. A trailing comment can neutralize the delimiter appended by the script.

This flaw is reachable when the selected configuration key already exists because that causes execution to enter the vulnerable sed -i branch.

Attack Path

  1. Create a valid configuration entry so the vulnerable update branch will be used:

    bash
    scripts/script.sh config safe initial
    
  2. Supply a value containing a completed substitution, a newline, and a GNU sed e command:

    bash
    scripts/script.sh config safe $'updated|\ne touch /tmp/actuator-pwned\n#'
    
  3. The script constructs a sed program equivalent to:

    sed
    s|^safe=.*|safe=updated|
    e touch /tmp/actuator-pwned
    #|
    
  4. GNU sed executes touch /tmp/actuator-pwned with the privileges of the user running the Skill. An attacker can replace this proof-of-concept command with other shell commands available in that security context.

Impact Assessment

Successful exploitation provides arbitrary local command execution with the privileges of the Skill process. In a n ...[truncated 507 chars]

Remediation
View remediation

Remediation Suggestions

  • Do not construct sed programs using untrusted input. Replace the dynamic sed -i operation with a safe line-by-line configuration rewrite in which the matching and output operations do not interpret input as executable syntax.
  • Validate configuration keys against a strict allowlist, such as ^[A-Za-z0-9_.-]+$.
  • Reject newline, carriage-return, NUL, and other control characters in both keys and values.
  • If sed must be retained, escape regular-expression syntax in the key and all delimiter, backslash, ampersand, and newline-sensitive syntax in the replacement value. A parser-based rewrite is preferable because escaping sed safely is error-prone.
  • Write updates to a securely created temporary file in the same directory, verify that the operation succeeded, apply restrictive permissions, and atomically rename the file over config.txt.
  • Add regression tests using values containing |, \, &, newlines, sed commands, and shell command text. Tests should verify that no command is executed and that the value is stored only as literal data.
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 (9)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as an actuator selection and sizing calculator, but the documented behavior is a generic local record-management tool with persistent storage, export, and configuration features. This mismatch can mislead users and higher-level agents into granting trust or permissions under false assumptions, increasing the chance of unintended data handling or execution in contexts expecting a harmless engineering calculator.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The misleading header reinforces a deceptive presentation of the script as an actuator calculator while the actual behavior is a generic logger/exporter. Deceptive labeling is a security issue in skills because it can hide data-collection behavior behind an innocuous description, encouraging execution in contexts where sensitive inputs may be handled.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The implementation materially contradicts the stated purpose of the skill: instead of performing actuator selection/sizing, it provides a persistent local data store with add/search/remove/export features. In an agent-skill context, this kind of capability mismatch is dangerous because it can be used to collect, retain, and exfiltrate user or workflow data under a misleading cover story, reducing the chance that users or reviewers notice the real behavior.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest and command set are inconsistent: the metadata claims industrial actuator sizing, while the commands implement CRUD-style local data management. In an agent ecosystem, this kind of semantic deception is risky because policy decisions, user consent, and tool routing may rely on the declared purpose rather than the real behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

A documented remove command without any warning, confirmation semantics, or recovery note creates a risk of accidental data loss. While this is not evidence of malicious behavior, it is an unsafe operational design for a tool that stores persistent user data under the home directory.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

User-supplied entries are silently written to persistent storage in the user's home directory without a clear warning or consent flow. In a skill environment, users may enter operational notes, identifiers, or other sensitive data assuming it is ephemeral; silent persistence increases privacy and data-retention risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The remove command irreversibly deletes a selected line from the data store using sed -i, with no confirmation prompt and no advance warning in the help text that removal is destructive. This is a safety-relevant operation affecting user data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The skill documentation includes an export command that writes data to a file, but it does not warn users that their stored data will be written to disk or clarify the destination and overwrite behavior. For markdown files, user-facing descriptions should disclose actions that affect user data or system state.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The export command copies stored entries into a local output file, potentially exposing previously stored data in another location, but the script provides no prior warning beyond a success message after the fact. The help text also does not disclose that export writes a file in the current working directory.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.