Back to skill

Security audit

Doc Summarize Pro

Security checks for vulnerabilities and agentic risk

Overview

This local document summarizer is mostly on-purpose, but its configuration command can be abused to run arbitrary shell commands and it persistently logs document paths.

Review before installing. Use only on non-sensitive documents unless you are comfortable with local path history being saved under your home directory, and do not let untrusted text or agents choose config keys or values until the sed-based config update is fixed with key allowlisting and safe file rewriting.

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:30
Finding
Arbitrary Command Execution Through Configuration-Based sed Injection<![CDATA[ ## Vulnerability Details **File Location**: `scripts/script.sh:30-39` **Vulnerability Type**: Shell command injection through a dynamically constructed GNU `sed` program **Risk Level**: High ### Vulnerable Code ```bash _config_set() { _config_init local key="$1" value="$2" if grep -q "^${key}=" "$CONFIG_FILE" 2>/dev/null; then sed -i "s|^${key}=.*|${key}=${value}|" "$CONFIG_FILE" else echo "${key}=${value}" >> "$CONFIG_FILE" fi echo " ✓ ${key} = ${value}" } ``` ### Technical Analysis The `config` command accepts a configuration key and value from command-line arguments. `_config_set` interpolates both values directly into a GNU `sed` substitution expression: ```bash sed -i "s|^${key}=.*|${key}=${value}|" "$CONFIG_FILE" ``` Shell quoting prevents a direct shell metacharacter injection at the outer Bash parsing layer, but it does not make the dynamically generated `sed` program safe. An attacker can inject the `|` delimiter, a newline, and GNU `sed`'s `e` substitution flag into the value. The GNU `sed` `e` flag sends the resulting pattern space to `/bin/sh` for execution. Because an attacker-controlled key is also copied into the replacement text, the attacker can place shell separators and commands in that key. The application permits arbitrary new keys, making it possible to first plant a malicious key and then update it using an injected `sed` flag. The same unsanitized key is also interpreted as a regular expression by `grep` and `sed`, allowing regex metacharacters to alter which configuration line is selected. ### Attack Path A local caller, or an Agent induced to run attacker-supplied configuration arguments, can exploit the issue as follows: 1. Create a configuration entry whose key contains a shell command and separator: ```bash bash scripts/script.sh config 'x; id >/tmp/doc-summarize-pwned #' 1 ``` Since the key does not initially exist, the application appends a line similar t ...[truncated 1749 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Restrict configuration keys to an explicit allowlist.** Only the documented settings should be accepted: ```bash case "$key" in summary_sentences|keyword_count) ;; *) echo "Error: unsupported configuration key: $key" >&2 return 1 ;; esac ``` 2. **Validate values according to their expected type and range.** Both current settings represent bounded positive integers: ```bash if [[ ! "$value" =~ ^[0-9]+$ ]] || (( value < 1 || value > 100 )); then echo "Error: value must be an integer between 1 and 100" >&2 return 1 fi ``` Use tighter setting-specific limits where practical. 3. **Do not interpolate untrusted data into a `sed` program.** Rewrite the configuration through a temporary file while passing values as data rather than source code. With strict key and numeric-value validation, an implementation can use `awk` safely: ```bash local tmp tmp=$(mktemp "$DATA_DIR/config.XXXXXX") trap 'rm -f "$tmp"' RETURN awk -F= -v target="$key" -v replacement="$value" ' BEGIN { found = 0 } $1 == target { print target "=" replacement found = 1 next } { print } END { if (!found) print target "=" replacement } ' "$CONFIG_FILE" > "$tmp" chmod 600 "$tmp" mv -- "$tmp" "$CONFIG_FILE" trap - RETURN ``` 4. **Harden configuration storage.** Create the data directory and configuration file with user-only permissions: ```bash umask 077 mkdir -p -- "$DATA_DIR" ``` 5. **Treat existing configuration files as potentially compromised.** After deploying the fix, inspect or recreate `$HOME/.doc-summarize-pro/config` because an attacker may already have planted malformed keys or values. 6. **Add regression tests.** Test keys and values containing delimiters, newlines, backslashes, regex operators, ...[truncated 127 chars]
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 (13)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
The skill metadata and documentation materially overstate and misstate behavior: it advertises translation, executive summaries, and chapter breakdowns, while also omitting side effects such as persistent history/config storage, export file creation, and batch processing. This is dangerous because users may trust the skill with sensitive documents under false assumptions about capability and data handling, leading to privacy surprises and unsafe operational use.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The skill metadata and documentation materially overstate and misstate behavior: it advertises translation, executive summaries, and chapter breakdowns, while also omitting side effects such as persistent history/config storage, export file creation, and batch processing. This is dangerous because users may trust the skill with sensitive documents under false assumptions about capability and data handling, leading to privacy surprises and unsafe operational use.

Missing User Warnings

Medium
Confidence
86% confidence
Finding
The export feature implies file creation but does not warn about output location, overwrite semantics, or the persistence of potentially sensitive derived content. Users may unintentionally create or overwrite files containing confidential summaries, especially when working in shared directories or scripted workflows.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The skill states that command history is stored on disk with timestamps, but it does not prominently warn users that their document-processing activity will be persistently logged in the home directory. This can expose sensitive filenames, usage patterns, and possibly document-related context on shared systems or in backups without informed user consent.

Context-Inappropriate Capability

Medium
Confidence
90% confidence
Finding
The script persistently records commands and user-supplied document paths to $HOME/.doc-summarize-pro/history.log without consent, minimization, or an opt-out. In a summarizer context, document names and paths can reveal sensitive project names, clients, legal matters, or internal directory structures, creating a privacy and information disclosure risk on shared or monitored systems.

Natural-Language Policy Violations

Medium
Confidence
88% confidence
Finding
The stop-word filter is explicitly English-only, and the tool's sentence and keyword logic are built around English text assumptions. Because the skill does not offer language selection or clearly document that it is limited to English processing, it imposes a locale choice without opt-in.

Description-Behavior Mismatch

Medium
Confidence
97% confidence
Finding
The manifest describes 'executive summary, chapter breakdown, multi-doc comparison, translate+summarize', but the implemented commands only provide summarize, keywords, outline, stats, compare, batch, export, history, and config. There is no translation capability, no distinct executive-summary mode, and no chapter-specific breakdown feature exposed by the script, creating a clear mismatch between the advertised behavior and the actual implementation.

Description-Behavior Mismatch

Medium
Confidence
98% confidence
Finding
The skill advertises a translate-and-summarize capability, but the implementation only echoes original text and extracts a few sentences without performing any translation. This is dangerous because users may rely on incorrect assumptions about language conversion, leading to misunderstanding of source documents, especially in business, legal, or safety-sensitive contexts.

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
A translation-related feature without language or locale selection is unsafe because any future or implied translation behavior is ambiguous and unverifiable. In this case, the danger is amplified by the fact that no translation occurs at all, increasing the risk of user confusion and misuse of the output.

Description-Behavior Mismatch

Medium
Confidence
97% confidence
Finding
The tips document claims commands and features such as `chapter`, `action`, `bullet`, `compare`, and `timeline` that are not described in the skill metadata. This can mislead users or downstream agents into invoking unsupported behaviors, creating confusion, unsafe assumptions about available functionality, or accidental routing to unintended tools if command names overlap elsewhere in an agent environment.

Missing User Warnings

Low
Confidence
93% confidence
Finding
Logging raw user-supplied file paths without disclosure leaks potentially sensitive information such as usernames, customer names, case identifiers, or confidential folder structures. The risk is lower than direct content exfiltration, but in this skill's context users reasonably expect local document analysis rather than silent persistence of activity metadata.

Description-Behavior Mismatch

Low
Confidence
90% confidence
Finding
The skill claims enhanced or smart summarization, but the code performs only simple sentence splitting and truncation. While not a code-execution flaw, this is a capability integrity issue that can mislead users into trusting low-quality output as intelligent analysis.

Description-Behavior Mismatch

Low
Confidence
89% confidence
Finding
The manifest lists smart summary, bullet extraction, executive summary, chapter breakdown, multi-doc comparison, and translate+summarize, but does not mention action item extraction or timeline extraction. These extra commands add materially different analysis functions beyond the stated feature set.

Static analysis

No suspicious patterns detected.