Back to skill

Security audit

Compress

Security checks for vulnerabilities and agentic risk

Overview

The skill appears purpose-aligned, but it sends selected memory-file contents to Claude and overwrites active files without strong review safeguards.

Install only if you are comfortable sending the chosen file's full contents to Claude/Anthropic and replacing the active file afterward. Use it only on non-sensitive files you intentionally select, keep the generated backup, and review the diff before trusting compressed CLAUDE.md or other agent memory files.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (1)

T02 · Agent Memory Poisoning

Warning
Location
scripts/compress.py:113
Finding

Untrusted LLM Output Can Poison Persistent Agent Memory

Content
View full analysis
str: return f""" Compress this markdown into caveman format. STRICT RULES: - Do NOT modify anything inside ``` code blocks - Do NOT modify anything inside inline backticks - Preserve ALL URLs exactly - Preserve ALL headings exactly - Preserve file paths and commands - Return ONLY the compressed markdown body — do NOT wrap the entire output in a ```markdown fence or any other fence. Inner code blocks from the original stay as-is; do not add a new outer fence around the whole file. Only compress natural language. TEXT: {original} """ ``` ```python # Step 1: Compress print("Compressing with Claude...") compressed = call_claude(build_compress_prompt(original_text)) if compressed is None or not compressed.strip(): print("❌ Compression aborted: Claude returned an empty response.") print(" Original file is untouched (no backup created).") return False if compressed.strip() == original_text.strip(): print("❌ Compression aborted: output is identical to input.") print(" Likely causes: Claude refused, returned the prompt verbatim, or the file is") print(" already in caveman form. Original file is untouched (no backup created).") return False # Save original as backup, then verify the backup readback before # touching the input file. If the filesystem dropped bytes (encoding, # antivirus, disk full), unlink the bad backup and abort instead of # leaving the user with a corrupt backup + compressed primary. backup_path.write_text(original_text) backup_readback = backup_path.read_text(errors="ignore") if backup_readback != original_text: print(f"❌ Backup write verification failed: {backup_path}") print(" In-memory original d ...[truncated 3986 chars]
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (14)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description says the skill's purpose is to compress memory files and replace the original while saving a backup. The supplied code chunk instead benchmarks already-existing original/compressed pairs: it reads files, counts tokens, invokes validation, and prints results. There is no code that transforms content, writes compressed output, overwrites originals, or saves backups. Its primary purpose is evaluation/benchmarking of compression results, which is materially different from the declared compression behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description says the skill compresses memory files into caveman format while preserving substance, overwrites the original, and writes a backup. The supplied code chunk does none of those actions. It only classifies files as natural language/code/config/unknown using extensions and lightweight content heuristics, then determines whether they should be compressed. While this detection logic could be a supporting component of a compression skill, the chunk's actual behavior by itself is materially different from the declared primary purpose because it lacks the core compression, file modification, and backup capabilities described.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description says the skill's purpose is to compress memory files and replace the original while saving a backup. The supplied code does none of that. It defines extraction and validation routines, reads two existing files, compares structural/content-preservation properties, and prints a validation report. While the checks align with verifying a compressor's output, this chunk's primary purpose is validation, not compression. That is a material description-behavior mismatch.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/compress.py (reported line 21)May include surrounding context.

python
# Filenames and paths that almost certainly hold secrets or PII. Compressing
# them ships raw bytes to the Anthropic API — a third-party data boundary that
# developers on sensitive codebases cannot cross. detect.py already skips .env
# by extension, but credentials.md / secrets.txt / ~/.aws/credentials would
# slip through the natural-language filter. This is a hard refuse before read.
SENSITIVE_BASENAME_REGEX = re.compile(

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/compress.py (reported line 22)May include surrounding context.

python
# Filenames and paths that almost certainly hold secrets or PII. Compressing
# them ships raw bytes to the Anthropic API — a third-party data boundary that
# developers on sensitive codebases cannot cross. detect.py already skips .env
# by extension, but credentials.md / secrets.txt / ~/.aws/credentials would
# slip through the natural-language filter. This is a hard refuse before read.
SENSITIVE_BASENAME_REGEX = re.compile(
    r"(?ix)^("

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/compress.py (reported line 22)May include surrounding context.

python
# Filenames and paths that almost certainly hold secrets or PII. Compressing
# them ships raw bytes to the Anthropic API — a third-party data boundary that
# developers on sensitive codebases cannot cross. detect.py already skips .env
# by extension, but credentials.md / secrets.txt / ~/.aws/credentials would
# slip through the natural-language filter. This is a hard refuse before read.
SENSITIVE_BASENAME_REGEX = re.compile(
    r"(?ix)^("

Credential Access

High
Category
Privilege Escalation
Confidence
80% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/compress.py (reported line 27)May include surrounding context.

python
SENSITIVE_BASENAME_REGEX = re.compile(
    r"(?ix)^("
    r"\.env(\..+)?"
    r"|\.netrc"
    r"|credentials(\..+)?"
    r"|secrets?(\..+)?"
    r"|passwords?(\..+)?"

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/detect.py (reported line 14)May include surrounding context.

python
# Extensions that are code/config and should be skipped
SKIP_EXTENSIONS = {
    ".py", ".js", ".ts", ".tsx", ".jsx", ".json", ".yaml", ".yml",
    ".toml", ".env", ".lock", ".css", ".scss", ".html", ".xml",
    ".sql", ".sh", ".bash", ".zsh", ".go", ".rs", ".java", ".c",
    ".cpp", ".h", ".hpp", ".rb", ".php", ".swift", ".kt", ".lua",
    ".dockerfile", ".makefile", ".csv", ".ini", ".cfg",

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/detect.py (reported line 74)May include surrounding context.

python
# Extensions that are code/config and should be skipped
SKIP_EXTENSIONS = {
    ".py", ".js", ".ts", ".tsx", ".jsx", ".json", ".yaml", ".yml",
    ".toml", ".env", ".lock", ".css", ".scss", ".html", ".xml",
    ".sql", ".sh", ".bash", ".zsh", ".go", ".rs", ".java", ".c",
    ".cpp", ".h", ".hpp", ".rb", ".php", ".swift", ".kt", ".lua",
    ".dockerfile", ".makefile", ".csv", ".ini", ".cfg",

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill explicitly instructs the agent to run a Python module and to overwrite user-supplied files, but it declares no tool restrictions or permissions. In an agent environment, missing scope increases the chance the skill can invoke shell, read arbitrary files, and write back modified content without clear guardrails, which is risky given the destructive overwrite behavior.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The trigger phrase "when user asks to compress a memory file" is broad and can fire on casual natural-language requests, causing the skill to run shell commands and overwrite files unexpectedly. In this skill, ambiguous activation is more dangerous because the action is state-changing and destructive by design, even if a backup is intended.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill advertises file compression, but the implementation sends the full file contents to Anthropic or the Claude CLI for processing, crossing a third-party data boundary. Even with the sensitive-filename denylist, ordinary memory files may still contain secrets, internal URLs, tokens, customer data, or proprietary information that will be exfiltrated to an external service.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/compress.py (reported line 92)May include surrounding context.

python
pass  # anthropic not installed, fall back to CLI
    # Fallback: use claude CLI (handles desktop auth)
    try:
        result = subprocess.run(
            ["claude", "--print"],
            input=prompt,
            text=True,

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

For a skill described as compressing memory files, accessing ANTHROPIC_API_KEY and model-selection environment variables introduces credential and runtime-environment access that is not mentioned in the manifest. While this supports the hidden LLM integration, it is not justified by the stated local file-oriented purpose alone.

Content

No source excerpt is available for this finding.