Back to skill

Security audit

Benchmark Tool

Security checks for vulnerabilities and agentic risk

Overview

This benchmark skill mostly matches its stated purpose, but it needs review because its disk test can unsafely write and delete a predictable file and it includes broad file comparison behavior.

Review before installing. Do not run the disk benchmark in sensitive, shared, or privileged directories, and do not run it with elevated privileges. Be aware the network benchmark contacts the host you provide, and the compare command can reveal contents or differences from arbitrary files the skill can access.

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:100
Finding

Predictable Disk Benchmark File Permits Symlink-Based File Corruption

Content
View full analysis

Vulnerability Details

File Location: scripts/script.sh, lines 100–103
Vulnerability Type: Predictable temporary file and symlink-following write
Risk Level: High

Vulnerable Code

bash
cmd_disk() {
    local dir="${2:-}"
    [ -z "$dir" ] && die "Usage: $SCRIPT_NAME disk <dir>"
    dd if=/dev/zero of=${2:-/tmp}/bench_test bs=1M count=100 oflag=direct 2>&1 | tail -1; rm -f ${2:-/tmp}/bench_test
}

Technical Analysis

The disk benchmark writes 100 MiB of zero bytes to a fixed filename, bench_test, inside a caller-selected directory. The path is neither created securely nor checked for an existing symbolic link. Because dd follows symbolic links when opening its output file, an attacker who can create <directory>/bench_test before execution can redirect the write to another file writable by the account running the Skill.

The ${2:-/tmp}/bench_test expansions are also unquoted. This allows shell word splitting and pathname expansion when a directory contains spaces or glob characters, making the command behavior less predictable. The principal exploitable security issue, however, is the predictable path and symlink-following write.

Attack Path

  1. The attacker identifies a directory that the victim will use for the disk benchmark and in which the attacker can create entries.
  2. The attacker creates bench_test in that directory as a symbolic link to a target file writable by the victim:
    bash
    ln -s /path/to/writable/target /shared/benchmark-directory/bench_test
    
  3. The victim runs the disk benchmark against that directory.
  4. dd opens bench_test, follows the symbolic link, and writes up to 100 MiB of zero bytes to the target.
  5. The target file is corrupted or destroyed. The subsequent rm removes the symbolic link rather than restoring the damaged target.

Impact Assessment

Successful exploitation permits corruption of files writable by the account executing the Skill. Under an ordinary user acc ...[truncated 485 chars]

Remediation
View remediation

Remediation Suggestions

  • Validate that the supplied destination is an existing directory.
  • Create a unique benchmark file securely with mktemp, rather than using a predictable filename.
  • Quote every path expansion and use -- where supported to terminate option parsing.
  • Register a cleanup trap so only the exact securely generated file is removed.
  • Do not run the benchmark with elevated privileges.
  • Prefer a directory owned by the executing user and inaccessible to untrusted users.
  • Consider checking that the generated path is a regular file and refusing symbolic links.

Example hardened implementation:

bash
cmd_disk() {
    local dir="${1:-}"
    local test_file=""

    [ -n "$dir" ] || die "Usage: $SCRIPT_NAME disk <dir>"
    [ -d "$dir" ] || die "Not a directory: $dir"

    test_file="$(mktemp --tmpdir="$dir" benchmark-tool.XXXXXX)" ||
        die "Unable to create benchmark file"

    trap 'rm -f -- "$test_file"' RETURN

    dd if=/dev/zero of="$test_file" bs=1M count=100 oflag=direct 2>&1 |
        tail -1
}

Because main shifts the command name before calling cmd_disk, the function should consume its directory from ${1:-}, not ${2:-}.

Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (8)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
97% confidence
Finding

The disk benchmark uses an unquoted user-controlled path in both dd ... of=${2:-/tmp}/bench_test and rm -f ${2:-/tmp}/bench_test. This enables option injection, word splitting, writes/deletions in arbitrary locations, and potentially destructive behavior if a crafted argument begins with - or contains shell metacharacter-like whitespace-expanding values.

Content

Scanner excerpt · scripts/script.sh (reported line 103)May include surrounding context.

sh
cmd_disk() {
    local dir="${2:-}"
    [ -z "$dir" ] && die "Usage: $SCRIPT_NAME disk <dir>"
    dd if=/dev/zero of=${2:-/tmp}/bench_test bs=1M count=100 oflag=direct 2>&1 | tail -1; rm -f ${2:-/tmp}/bench_test
}

cmd_network() {

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · scripts/script.sh (reported line 103)May include surrounding context.

sh
cmd_disk() {
    local dir="${2:-}"
    [ -z "$dir" ] && die "Usage: $SCRIPT_NAME disk <dir>"
    dd if=/dev/zero of=${2:-/tmp}/bench_test bs=1M count=100 oflag=direct 2>&1 | tail -1; rm -f ${2:-/tmp}/bench_test
}

cmd_network() {

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill invokes shell scripts for every advertised command, but the manifest does not declare any tool scope such as permissions or allowed-tools. This creates an under-specified trust boundary: an agent or reviewer cannot tell from the manifest that command execution is required, which increases the risk of unintended shell access and unsafe execution of arguments like

and .

Content

No source excerpt is available for this finding.

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
80% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · scripts/script.sh (reported line 9)May include surrounding context.

sh
DATA_DIR="$HOME/.local/share/benchmark-tool"
mkdir -p "$DATA_DIR"

#
#
#
#

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The disk benchmark writes a 100MB test file and deletes it without clearly warning the user about filesystem modification. In automation contexts, undisclosed write/delete behavior can affect sensitive directories, consume space, or interact badly with symlinks and unexpected paths.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The network benchmark performs an outbound curl request without prominently disclosing that it will contact an external host. In restricted or privacy-sensitive environments, this can leak network metadata, violate policy, or trigger unintended external traffic.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script exposes a general-purpose file comparison feature via compare <f1 f2>, which is unrelated to the stated benchmarking purpose. In an agent/skill context, undocumented file-read capabilities expand the tool's scope and can be abused to inspect sensitive files or facilitate data discovery beyond expected benchmark operations.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Arbitrary diff $2 $3 permits reading and comparing any two files accessible to the script, which is unjustified for a system benchmarking tool. Even without exfiltration built in, this capability can reveal contents or metadata of sensitive files through tool output and violates least privilege.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.