Back to skill

Security audit

Diskmon

Security checks for vulnerabilities and agentic risk

Overview

DiskMon is not destructive or exfiltrating, but it is marketed as real disk monitoring while only keeping plaintext notes and exports, so it needs review before use.

Install only if you want a simple local note/history logger for disk-related observations, not a real disk monitor. Do not rely on it for alerts, cleanup, backup, restore, or capacity protection, and avoid entering secrets or sensitive infrastructure details unless you are comfortable keeping them in plaintext local logs and exports.

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

Warning
Location
scripts/script.sh:151
Finding

Log Injection Through Unvalidated Multiline Input

Content
View full analysis
> "$DATA_DIR/scan.log" local total=$(wc -l < "$DATA_DIR/scan.log") echo " [Diskmon] scan: $input" echo " Saved. Total scan entries: $total" _log "scan" "$input" fi ``` The same unsafe storage pattern is used for the `monitor`, `report`, `alert`, `top`, `usage`, `check`, `fix`, `cleanup`, `backup`, `restore`, `log`, `benchmark`, and `compare` commands. ### Technical Analysis Caller-controlled input is appended directly to line-oriented log files without rejecting or encoding carriage returns, line feeds, or the `|` field delimiter. Quoting the shell variable prevents shell command injection, but it does not make the value safe for the custom log format. An argument containing an embedded newline can create additional apparent records. Delimiter characters can also make records ambiguous to downstream consumers. Because these files are presented as historical and audit-ready records, an attacker who can supply a command argument can corrupt the integrity of the recorded history. ### Attack Path 1. An attacker or untrusted automation supplies a multiline value to a data command, for example: ```bash diskmon alert $'Normal observation\n2026-09-12 12:00|FALSE: cleanup completed' ``` 2. The script expands the argument inside `echo` and preserves the embedded newline. 3. Multiple physical lines are appended to `alert.log` and related history output. 4. Subsequent `recent`, `search`, `stats`, or `export` operations treat the injected line as an independent or malformed record. 5. A reviewer may rely on the forged entry as authentic monitoring or maintenance history ...[truncated 539 chars]
Remediation
View remediation
&2 exit 1 fi ``` 2. Avoid an ambiguous custom delimiter format. Prefer a structured serializer such as JSON Lines generated by `jq`. 3. If the existing format must be retained, encode or escape backslashes, carriage returns, line feeds, and `|` characters before storage. 4. Decode values only through a corresponding, well-defined parser. 5. Apply the validation in a shared logging function so every data command receives identical protection. 6. Add tests covering embedded newlines, carriage returns, delimiters, quotes, backslashes, and empty values. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/script.sh:62
Finding

JSON Export Injection Through Missing String Escaping

Content
View full analysis
"$out" local first=1 for f in "$DATA_DIR"/*.log; do [ -f "$f" ] || continue local name=$(basename "$f" .log) while IFS='|' read -r ts val; do [ $first -eq 1 ] && first=0 || echo "," >> "$out" printf ' {"type":"%s","time":"%s","value":"%s"}' "$name" "$ts" "$val" >> "$out" done < "$f" done echo "" >> "$out" echo "]" >> "$out" ;; ``` ### Technical Analysis The exporter constructs JSON by interpolating log data directly into a JSON string template. It does not escape double quotes, backslashes, control characters, or line breaks as required by the JSON specification. A stored value containing characters such as `"` can terminate the intended string and inject additional properties or objects. Other inputs can make the export syntactically invalid. Shell quoting does not address this issue because the vulnerability occurs in the generated JSON format rather than in shell command evaluation. ### Attack Path 1. An attacker supplies a crafted value to any logging command, such as: ```text "},"forged":true,"value":"controlled ``` 2. DiskMon stores the value in the corresponding `.log` file. 3. A user runs: ```bash diskmon export json ``` 4. `_export` inserts the stored value directly between JSON quotation marks. 5. The resulting `export.json` is malformed or contains attacker-controlled JSON structure. 6. A downstream parser, reporting tool, or audit pipeline may reject the report or process injected fields as legitimate data. ### Impact Assessment This flaw does not directly execute shell commands or grant additional system privileges. The affected scope includes JSON exports and downstream systems that trust them. Exploitation can: - Corrupt exported audi ...[truncated 234 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/script.sh:75
Finding

CSV Injection and Malformed Export Through Unescaped Fields

Content
View full analysis
"$out" for f in "$DATA_DIR"/*.log; do [ -f "$f" ] || continue local name=$(basename "$f" .log) while IFS='|' read -r ts val; do echo "$name,$ts,$val" >> "$out" done < "$f" done ;; ``` ### Technical Analysis The exporter writes fields separated by commas without applying RFC 4180 quoting. Stored values containing commas, double quotes, carriage returns, or line feeds can create additional columns or rows and corrupt the export. In addition, a value beginning with a spreadsheet formula prefix such as `=`, `+`, `-`, or `@` is emitted unchanged. The project documentation explicitly recommends CSV export for spreadsheet analysis. When the exported file is opened in a spreadsheet application, such a value may be interpreted as a formula instead of inert text. The exact effects depend on the spreadsheet software and its security settings. Potential formula behavior can include external requests, disclosure of spreadsheet content, or misleading displayed values. ### Attack Path 1. An attacker supplies a crafted monitoring or report value beginning with a formula marker, for example: ```bash diskmon report '=HYPERLINK("https://attacker.example/","Open report")' ``` 2. DiskMon stores the input without format-specific encoding. 3. A user runs: ```bash diskmon export csv ``` 4. The value is written to `export.csv` without quoting or formula neutralization. 5. The user opens the documented spreadsheet export. 6. The spreadsheet may interpret the attacker-controlled cell as a formula or active hyperlink. Inputs containing commas or newlines can also alter the apparent row and column structure. ### Impact Assessment No operating-system privilege escal ...[truncated 509 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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 claims disk monitoring, alerting, usage inspection, and large-directory discovery, but the documentation describes what is effectively a generic local logging tool. This mismatch is dangerous because users may rely on it for operational or safety-critical storage monitoring while receiving no actual monitoring or alerting, creating a false sense of protection and possible missed disk-full incidents.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill advertises real-time disk-space monitoring and alerting, but the implementation is only a generic logging utility with unrelated commands. This capability mismatch is dangerous because users or higher-level agents may trust it to monitor storage health when it performs no such checks, creating a false sense of safety that can lead to missed disk-full events and operational outages.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The core commands merely append arbitrary user input to local files and never inspect filesystem state, capacity, mountpoints, or thresholds. In an automation context, this is dangerous because monitoring workflows may silently succeed while providing no real detection, causing integrity failure of operational monitoring and preventing timely response to storage exhaustion.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The top-level description is broad enough that an agent could invoke the skill for many loosely related storage or admin tasks, even though the documented behavior is mostly persistent logging. That can lead to unintended activation and unnecessary recording of sensitive system details into local history files.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The scope statement lists scanning, monitoring, reporting, alerting, health checking, fixing, cleaning, backing up, restoring, benchmarking, and comparing, which is far broader than a simple logger. In agentic environments, such vague scope increases the chance the skill is selected for privileged or operational tasks it does not actually perform, potentially causing user confusion, unsafe assumptions, or inadvertent data capture.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documentation states that all inputs are stored persistently in per-command logs and a unified history file, but it does not prominently warn users that sensitive hostnames, mount paths, incident details, and operational notes will be retained locally. This can expose internal infrastructure details to other local users, backups, support bundles, or later unintended disclosure through search/export features.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Describing the script as a broad 'sysops toolkit' conflicts with the narrower DiskMon manifest and signals undeclared scope expansion. This inconsistency is dangerous because users and orchestrating agents rely on accurate metadata to decide trust and permissions; mismatched identity makes the skill more likely to be used in unintended contexts.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The tool collects arbitrary user-provided content, stores it persistently, and exposes search/recent/export functions that make accumulated data easy to enumerate and copy. In the context of a purported monitoring skill, this behavior is more dangerous because users are likely to enter operationally sensitive information while expecting disk telemetry rather than a plaintext datastore.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Including fix, cleanup, benchmark, and compare operations in a monitoring-only skill unnecessarily broadens the interface and increases confusion about what actions the tool may take. In agentic environments, unjustified extra commands are risky because they increase the chance of misuse, over-trust, or future privilege creep without clear authorization boundaries.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Exposing backup and restore commands in a tool presented as disk-space monitoring violates least functionality and expands the apparent authority of the skill beyond its declared purpose. Even though the current implementation only logs input, these misleading commands can induce users or agents to invoke sensitive-sounding operations under false assumptions about what the tool is permitted or expected to do.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The export feature aggregates previously stored log data into new files in JSON, CSV, or text formats without warning that historical content will be duplicated. This increases data exposure by creating additional plaintext copies that are easier to exfiltrate, share accidentally, or process unsafely downstream.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Arbitrary user input is persistently written to local log files without clear notice, consent, retention policy, or sensitivity controls. This is dangerous because users may provide hostnames, paths, incident details, credentials, or other sensitive operational data that then remains on disk in plaintext and can be exposed to other local processes or future exports.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.