Back to skill

Security audit

Document Spell Check

Security checks for vulnerabilities and agentic risk

Overview

The skill is a mostly coherent document spell checker, but running it can automatically install software with Homebrew or sudo without explicit opt-in.

Review before installing or running in automation. Prefer pre-installing aspell yourself, avoid running this script with passwordless sudo or elevated privileges, and use fix mode only on trusted directories until dependency installation and temporary-file handling are made explicit and safer.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (2)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/doc-spellcheck.sh:89
Finding

Automatic Privileged Package Installation Without Explicit Consent

Content
View full analysis
/dev/null; then echo -e "${YELLOW}Warning: aspell not found. Installing...${NC}" if command -v brew &> /dev/null; then brew install aspell elif command -v apt-get &> /dev/null; then sudo apt-get install aspell else echo -e "${RED}Error: Cannot install aspell automatically. Please install it manually.${NC}" exit 1 fi fi ``` ### Technical Analysis The script automatically invokes a system package manager when `aspell` is unavailable. On systems using APT, it executes `sudo apt-get install aspell`, which requests elevated privileges and attempts to modify the system-wide software environment. Dependency validation is appropriate, but automatically crossing a privilege boundary is unnecessary for the spell-checking operation itself. The user is not given an explicit confirmation prompt or an opt-in installation flag. The documentation identifies Aspell as a dependency but does not clearly disclose that invoking the script may trigger a privileged installation. This behavior does not bypass operating-system authentication: `sudo` may still require authorization, and the package comes from configured system repositories. Nevertheless, the script initiates a privileged, persistent system modification beyond its core document-processing responsibility. ### Attack Path 1. A user or automation environment invokes `scripts/doc-spellcheck.sh` to inspect documentation. 2. The environment does not have `aspell` installed. 3. The script detects `apt-get` and automatically runs `sudo apt-get install aspell`. 4. If the user authorizes the request or the environment has passwordless `sudo`, the package manager modifies the system-wide package state. 5. ...[truncated 874 chars]
Remediation
View remediation
/dev/null 2>&1; then echo "Error: aspell is required but is not installed." >&2 echo "Install it using your trusted system package manager and retry." >&2 exit 1 fi ``` ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/doc-spellcheck.sh:161
Finding

Predictable Temporary File Enables Symlink-Based File Clobbering

Content
View full analysis
Remediation
View remediation
&2 return 1 } trap 'rm -f -- "$temp_file"' RETURN cp -- "$file" "$temp_file" # Apply validated transformations here. if ! cmp -s -- "$file" "$temp_file"; then mv -- "$temp_file" "$file" fi trap - RETURN rm -f -- "$temp_file" } ``` The exact trap mechanism should be tested against the supported Bash version. The implementation should also account for platform differences between BSD and GNU `sed`. ]]>
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • 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
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script is presented as a simple spell-check utility, but it also attempts to install software automatically if aspell is missing. That hidden side effect can surprise users and, in the apt-get path, may trigger privileged system changes that are outside the expected scope of a documentation tool.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script automatically invokes package managers and may run 'sudo apt-get install aspell' without an explicit confirmation prompt. In an agent/skill context, this is dangerous because running the tool can cause unplanned system modifications and privileged package installation, expanding the blast radius beyond spell checking.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
97% confidence
Finding

Embedding 'sudo' in a script that users may run as part of routine documentation checks introduces privileged execution into a low-risk workflow. Even though the command is limited to installing aspell, it normalizes elevation and can lead to unauthorized or unexpected system changes, especially when executed by automation or agents.

Content

Scanner excerpt · scripts/doc-spellcheck.sh (reported line 96)May include surrounding context.

sh
if command -v brew &> /dev/null; then
        brew install aspell
    elif command -v apt-get &> /dev/null; then
        sudo apt-get install aspell
    else
        echo -e "${RED}Error: Cannot install aspell automatically. Please install it manually.${NC}"
        exit 1

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script forces aspell --lang=en, which imposes a specific language setting regardless of user preference or document locale. This is a natural-language policy concern because the file provides no opt-in, configuration mechanism, or justification for restricting processing to English.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.