Back to skill

Security audit

Excel Formula

Security checks for vulnerabilities and agentic risk

Overview

This Excel helper is mostly on-topic, but it quietly keeps a persistent local history of formula and search inputs without clear disclosure or controls.

Review this skill before installing if your spreadsheet formulas or search terms may contain business-sensitive information. Its core Excel assistance is relevant, but the local history behavior should be disclosed, made optional, permission-hardened, sanitized, and bounded before routine use on shared or backed-up systems.

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

Warning
Location
scripts/script.sh:284
Finding
Plaintext History Log Injection and Terminal Escape Replay<![CDATA[ ## Vulnerability Details **File Location**: `scripts/script.sh:5-6`, `scripts/script.sh:72`, `scripts/script.sh:89`, `scripts/script.sh:284`, and `scripts/script.sh:290` **Vulnerability Type**: Unsanitized persistent logging of user-controlled input **Risk Level**: Medium ### Vulnerable Code ```bash DATA_DIR="${EXCEL_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/excel-formula}" mkdir -p "$DATA_DIR" ``` ```bash _log "find" "$kw ($found results)" ``` ```bash _log "explain" "${formula:0:30}" ``` ```bash _log() { echo "$(date '+%m-%d %H:%M') $1: $2" >> "$DATA_DIR/history.log"; } ``` ```bash history) [ -f "$DATA_DIR/history.log" ] && tail -20 "$DATA_DIR/history.log" || echo "No history" ;; ``` ### Technical Analysis The `find` keyword and the first 30 characters of an `explain` formula are passed directly to `_log`. The logging function writes these user-controlled values to `history.log` without removing newlines, carriage returns, ANSI terminal escape sequences, or other control characters. An input containing newline characters can create forged history entries. An input containing ANSI control sequences remains in the persistent log and is later emitted unchanged by `tail` when the `history` command is invoked. A compatible terminal may interpret those bytes as display-control instructions. The history file also stores formula fragments in plaintext. The data directory and file are created using permissions determined by the process umask rather than explicit restrictive modes. Under a permissive or common shared-host configuration, another local account may be able to read logged spreadsheet formulas or business-related search terms. This issue does not provide shell command execution because the logged data is not evaluated as shell syntax. Its practical effects are persistent log corruption, terminal-output manipulation, and potential local information disclosure. ### Attack Path 1. An attacker or untrusted automation supplies a crafted arg ...[truncated 1380 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Create the application directory and history file with explicit restrictive permissions: ```bash umask 077 mkdir -p -- "$DATA_DIR" chmod 700 -- "$DATA_DIR" touch -- "$DATA_DIR/history.log" chmod 600 -- "$DATA_DIR/history.log" ``` 2. Sanitize logged values by rejecting or escaping carriage returns, newlines, ANSI escape bytes, and non-printable control characters. 3. Store each event using an unambiguous structured format, such as JSON Lines, with a serializer that safely escapes control characters. 4. Escape values before rendering them to a terminal. For a shell-oriented representation, `printf '%q'` can prevent raw control bytes from being replayed: ```bash _log() { local action="$1" local value="$2" printf '%s %q: %q\n' \ "$(date '+%m-%d %H:%M')" \ "$action" \ "$value" >> "$DATA_DIR/history.log" } ``` 5. Avoid storing complete user formulas where possible. Store only non-sensitive metadata, redact cell values, or make history logging opt-in. 6. Use `printf` instead of `echo` for predictable behavior across shell implementations. 7. Add tests covering embedded newlines, carriage returns, ANSI escape sequences, Unicode control characters, and permissive umask configurations. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (14)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
The code is broadly related to Excel/spreadsheet formulas and debugging, so the domain matches. However, the description overstates and partly misstates the implemented behavior. The script does not actually convert formulas; the `convert` command only prints `TODO: formula conversion`. Bilingual support is declared but not present in functionality or output. The tool also provides additional substantive capabilities not mentioned in the description, such as formula search/category browsing, cheatsheets, tips, and persistent local history logging via `~/.local/share/.../history.log`, which is an undeclared resource interaction. Therefore the description does not accurately represent the actual code behavior.

Vague Triggers

Medium
Confidence
92% confidence
Finding
The description says to use the skill for broad tasks like 'debugging errors' or 'converting formulas' without defining specific trigger phrases, exclusions, or activation constraints. This can overlap with common spreadsheet-help requests and may cause unintended invocation.

Vague Triggers

Medium
Confidence
90% confidence
Finding
Phrases like 'Calculate days between two dates' and 'Sum sales where category is Electronics' are common natural requests and are not explicitly scoped as Excel-only triggers. Without negative examples or explicit constraints, these examples may encourage overly broad activation.

Natural-Language Policy Violations

Medium
Confidence
98% confidence
Finding
The prompt explicitly instructs the model to use Chinese for explanations, regardless of the user's language preference. This is a natural-language locale policy issue because the skill imposes a specific output language rather than offering a choice or making the constraint clearly optional.

Natural-Language Policy Violations

Medium
Confidence
98% confidence
Finding
This instruction mandates Chinese explanations with no user choice. Under the policy criteria, forcing a specific language without opt-in is a reportable locale-policy violation.

Natural-Language Policy Violations

Medium
Confidence
98% confidence
Finding
The text requires the assistant to respond in Chinese only, which removes user language choice. That constitutes a natural-language policy violation under the language/locale rule.

Natural-Language Policy Violations

Medium
Confidence
98% confidence
Finding
The prompt directs explanations to be in Chinese with no opt-in or alternative locale path. This is a language policy concern because it hard-codes a locale choice for all users.

Natural-Language Policy Violations

Medium
Confidence
98% confidence
Finding
The instruction "Use Chinese" mandates a single language for output. Because the skill does not offer a user language choice, this matches the policy-violation category for forced locale/language.

Natural-Language Policy Violations

Medium
Confidence
98% confidence
Finding
This line requires Chinese output for PivotTable guidance without any user opt-in. Forcing a specific language in natural-language instructions is a policy violation under the provided criteria.

Description-Behavior Mismatch

Medium
Confidence
95% confidence
Finding
The manifest describes bilingual documentation support and use for converting formulas, but the command help and dispatch show only English output and the convert command is a TODO placeholder rather than a working implementation. This is a clear mismatch between the stated skill capabilities and the actual behavior exposed by the script.

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
SQP-3 applies to all file types and includes language or locale policy violations. This file presents all instructions and examples exclusively in Chinese, and there is no indication that users can opt into this language or that the skill is intentionally limited to a Chinese-speaking or region-specific audience.

Natural-Language Policy Violations

Low
Confidence
75% confidence
Finding
The description emphasizes bilingual documentation and includes Chinese text, but it does not explicitly state that the user can choose their preferred output language. This may create ambiguity around language behavior under a language/locale policy requiring user opt-in.

Description-Behavior Mismatch

Low
Confidence
79% confidence
Finding
The manifest says the skill can diagnose spreadsheet errors, implying analysis of user-provided formulas or failures. In code, cmd_debug only prints a fixed list of common issues and wraps the input in IFERROR, without inspecting the formula or performing real diagnosis.

Missing User Warnings

Low
Confidence
90% confidence
Finding
The script logs user-supplied search terms and formulas to a persistent history file under the user's data directory without any notice, consent, or opt-out. Formula text can contain business logic, internal identifiers, or sensitive spreadsheet content, so silent retention increases privacy and local data exposure risk, especially on shared systems or in backed-up home directories.

Static analysis

No suspicious patterns detected.