Back to skill

Security audit

Stopwatch

Security checks for vulnerabilities and agentic risk

Overview

This is advertised as a stopwatch/timer skill, but its artifacts describe and attempt to implement a persistent local logging and record-search tool instead.

Review this as a local logging utility, not a stopwatch. Do not install it if you only want timer/lap/countdown behavior, and do not enter secrets or sensitive notes unless you are comfortable with them being retained in local log files and potentially exported or searched later.

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

T09 · Insecure Skill Coding Practices

Note
Location
scripts/script.sh:5
Finding

Log and export files may be created with insecure permissions

Content
View full analysis
> "$DATA_DIR/history.log"; } ``` Example of the repeated entry-writing logic: ```bash local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/run.log" local total=$(wc -l < "$DATA_DIR/run.log") echo " [Stopwatch] run: $input" echo " Saved. Total run entries: $total" _log "run" "$input" ``` ### Technical Analysis The script stores user-provided text in persistent files under `~/.local/share/stopwatch`, but it neither establishes a restrictive `umask` nor explicitly sets permissions on the directory and files. Consequently, permissions are inherited from the execution environment. With a permissive `umask`, the data directory can be searchable by other local accounts and newly created logs or exports can be readable by them. Entries may contain task descriptions, operational notes, report content, configuration-related text, or other information that users reasonably expect to remain private. The issue affects command-specific logs, `history.log`, and export files created by the script. Exploitation is conditional on the host having multiple users and the script being executed with insufficiently restrictive default permissions. ### Attack Path 1. A user invokes a logging command and supplies sensitive or operationally useful text. 2. The script creates the data directory and log files without enforcing private permissions. 3. A permissive process `umask`, such as one that results in mode `0644` for files and `0755` for directories, leaves the records readable by other local users. 4. Another local account traverses `~/.local/share/stopwatch` and reads ...[truncated 475 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
scripts/script.sh:103
Finding

Option injection through the grep search term

Content
View full analysis
}" echo "Searching for: $term" for f in "$DATA_DIR"/*.log; do [ -f "$f" ] || continue local m=$(grep -i "$term" "$f" 2>/dev/null || true) if [ -n "$m" ]; then echo " --- $(basename "$f" .log) ---" echo "$m" | sed 's/^/ /' fi done } ``` ### Technical Analysis Although the search term is shell-quoted, the script does not use the conventional `--` end-of-options delimiter. On implementations such as GNU `grep`, an attacker-controlled term beginning with `-` can therefore be interpreted as one or more command-line options rather than as the intended pattern. For example, an option-shaped term using `-f` can cause `grep` to load patterns from another local file. Other accepted options can modify matching behavior or increase processing cost. This is argument injection rather than shell command injection: shell metacharacters inside the quoted value are not executed, and the observed code does not provide arbitrary command execution. The use of regular-expression matching also permits computationally expensive patterns. For a literal full-text search command, fixed-string matching is safer and more consistent with user expectations. ### Attack Path 1. An attacker controls or influences the argument passed to `stopwatch search`. 2. The attacker supplies a value beginning with a hyphen, such as an option that instructs `grep` to read patterns from a file. 3. The script passes that value to `grep` without an end-of-options marker. 4. `grep` interprets the value as an option instead of a search pattern. 5. Search behavior is altered, potentially causing unintended local file access for pattern loading, indirect disclosure through matchin ...[truncated 764 chars]
Remediation
View remediation
/dev/null || true) ``` Further hardening should include: - Reject empty or excessively long search terms. - Retain `-F` unless regular-expression behavior is explicitly required. - If regular expressions are required, document that behavior and enforce a reasonable input-length limit. - Avoid invoking this command with elevated privileges when the search term comes from an untrusted source. - Consider processing matches directly rather than storing potentially large output in a shell variable. ]]>
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • 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 (12)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as a stopwatch/timer utility, but the documented behavior is a generic persistent logging and record-management system that stores arbitrary user input, supports search, and exports collected data. This mismatch is dangerous because it can cause users or orchestrators to invoke the skill in low-risk timing contexts while it silently performs broader data collection and retention than the manifest suggests.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The manifest advertises stopwatch, timer, and lap-tracking functionality, but the body documents a multi-command timestamped logging toolkit unrelated to timing. In an agent ecosystem, this kind of semantic deception can lead to unintended use, overcollection of sensitive text entered by users, and bypass of expectations or review controls tied to the declared purpose.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The advertised skill is a stopwatch/timer utility, but the help text exposes a broad generic logging toolkit with unrelated commands such as analyze, generate, config, compare, report, export, and search. This kind of capability mismatch is dangerous because it can trick users into supplying arbitrary data to a tool they believe is a simple timing utility, enabling covert collection and later review/export of sensitive input.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The core command handlers do not perform stopwatch operations; instead they accept arbitrary user text and persist it across many command categories. In a skill context, this is a strong indicator of deceptive behavior because a user invoking a timing tool would not reasonably expect free-form input to be stored on disk and cataloged for later retrieval.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

Broad activation language increases the chance the skill will be selected in unrelated workflows where users do not expect persistent logging or data export behavior. In a tool-routing environment, overbroad scope can amplify the consequences of the description-behavior mismatch by causing accidental invocation on sensitive prompts or operational data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill does not prominently warn users that command inputs are written to persistent local log files, despite encouraging arbitrary text entry across many commands. This omission can lead to inadvertent storage of secrets, internal notes, or sensitive operational data that users believed were ephemeral.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Full-text search, summary analytics, and multi-format export materially expand the data handling surface beyond what a stopwatch utility reasonably needs. These features increase the risk of retaining, indexing, and redistributing sensitive user-entered content, especially when users may not realize their inputs are being stored persistently.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
88% confidence
Finding

The skill explicitly promotes persistent history, trend review, and export into other tools, confirming session persistence and secondary use of captured data. In context, this is more dangerous because the skill is framed as a simple stopwatch utility, so users may disclose information without expecting durable storage and downstream redistribution.

Content

Scanner excerpt · SKILL.md (reported line 85)May include surrounding context.

md
2. **Comparing performance across runs** — Use `compare` and `analyze` to log different attempts, then `search` or `stats` to review trends.
3. **Batch processing records** — Use `batch` to log bulk operations, then `export json` to feed results into other tools.
4. **Quick status checks in automation** — Integrate `stopwatch status` or `stopwatch stats` into cron jobs or CI pipelines for operational dashboards.
5. **Generating reports from logged data** — Use `report` to log milestones, then `export csv` to create spreadsheets or feed into reporting tools.

## Examples

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The inline documentation identifies the script as a stopwatch utility even though the implementation is not a stopwatch and instead acts as a persistent note/logger. Mislabeling functionality in a security-sensitive agent ecosystem is dangerous because it undermines informed consent and can cause users or orchestrators to route sensitive task data into an unrelated collector.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script includes export, search, recent activity, status, and reporting functionality that meaningfully increases the usefulness of the stored data beyond a normal stopwatch use case. In context, these capabilities make the deceptive persistence more dangerous by enabling convenient discovery and extraction of collected entries from local storage.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

User-supplied input is appended to local log files under the user's home directory without clear disclosure in the help text or workflow. This is dangerous because users may enter task details, secrets, or operational data into what appears to be a transient stopwatch command, creating an unexpected local data exposure and retention risk.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
61% confidence
Finding

L051-L069 presents a concrete storage model, while L071 qualifies the override mechanism with 'if supported,' implying the documented behavior may not match the actual implementation. This is weaker than a direct contradiction, but it does create an intent-versus-behavior inconsistency in the documentation.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.