Back to skill

Security audit

smart-storage-triage

Security checks for vulnerabilities and agentic risk

Overview

ClawScan marks this skill suspicious because scanners report that indexing may send private media and search data to a configurable external endpoint and may include files outside the intended scope.

Consider avoiding installation unless you need this skill and can restrict its indexed storage and embedding destination. Before using it, verify where embedding requests will go and whether indexing requires explicit confirmation; the scan is partial, so some referenced paths or generated files were not resolved.

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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/semantic_media.py
Finding

Automatically discovered workspace configuration can redirect private embedding requests

Content
View full analysis

Impact

Search sends the user's query to the attacker. Indexing can send image contents, sampled video frames, and document filenames from the user's otherwise unchanged configured storage. The attacker receives the request even if their response subsequently fails embedding validation.

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/semantic_media.py
Finding

Tree snapshot paths can escape the approved storage boundary

Content
View full analysis

Impact

The indexer reads an out-of-scope image and sends its visual contents to the embedding router. Video paths can similarly cause out-of-scope frame extraction. This is a scope-escape vulnerability, not unrestricted extraction of arbitrary document contents.

Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (23)

Tainted flow: 'req' from os.environ.get (line 219, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
94% confidence
Finding

The network request is legitimate for embeddings, but its destination can be silently overridden by a .smart-storage-triage.json file discovered in the current working directory or script ancestors. An attacker-controlled workspace configuration can redirect image content, video frames, filenames, and search queries to an external endpoint despite the skill's local-only description; this is not evidence of environment credentials being transmitted.

Content

Scanner excerpt · scripts/semantic_media.py (reported line 221)May include surrounding context.

python
try:
            req = urllib.request.Request(
                ROUTER, data=body, headers={"Content-Type": "application/json"})
            with urllib.request.urlopen(req, timeout=HTTP_TIMEOUT) as r:
                out = json.loads(r.read())
            data = sorted(out["data"], key=lambda d: d["index"])
            import numpy as np

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 · README.md (reported line 18)May include surrounding context.

md
## Security & Privacy (Safety First)

- **Zero-Secret Tree & Content Exclusion:** strictly excludes `.env*`, private keys (`*.pem`, `*.key`, `id_rsa*`, `id_ed25519*`), cloud tokens, and sensitive credential stores (`credentials.json`, `token.json`, `auth.json`, `*.kdbx`) from **both** full-text indexing and the `tree.json.gz` snapshot.
- **Symlink Boundary Protection:** directory symlinks are pruned to prevent directory traversal loops; file symlinks resolving outside the target directory boundary are ignored and never followed.
- **Broad Scope Safety Guard:** indexing system root (`/`), `/home`, `/root`, or the entire user home directory (`~`) is blocked in code to prevent accidental broad data exposure. Requires the explicit confirmation flag `--allow-broad`.
- **Sensitive Directory Exclusion:** `.ssh`, `.aws`, `.gnupg`, `.azure`, `.kube`, `.secrets`, and `secrets` folders are never scanned or indexed.

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 · SKILL.md (reported line 27)May include surrounding context.

md
## Security & Privacy (Safety First)

1. **Automatic Secret & Credential Exclusion:**
   - Files matching `.env*`, `credentials.json`, `token.json`, `auth.json`, `secrets.json`, `id_rsa*`, `id_ed25519*`, `*.pem`, `*.key`, `*.kdbx`, `*.pfx`, `*.p12` are strictly excluded from **both** full-text indexing and directory tree snapshots (`tree.json.gz`).
   - Sensitive directories (`.ssh`, `.aws`, `.gnupg`, `.azure`, `.kube`, `.secrets`, `secrets`) are completely skipped.
2. **Symlink Boundary Protection:**
   - Directory symlinks are pruned to prevent directory traversal loops.

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/semantic_media.py (reported line 69)May include surrounding context.

python
VIDEO_FRAMES = 6
DOC_BATCH = 32
HTTP_TIMEOUT = 300
SECRET_NAMES = {".env", "credentials.json", "token.json", "auth.json",
                "secrets.json", "id_rsa", "id_ed25519"}

# Resolved by resolve_config() before any command runs.

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/triage_index.py (reported line 24)May include surrounding context.

python
}

SENSITIVE_FILE_EXACT = {
    ".env", "credentials.json", "token.json", "auth.json", "secrets.json",
    "id_rsa", "id_ed25519", "id_ecdsa", "id_dsa"
}

Description-Behavior Mismatch

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The core semantic-search behavior matches the declared purpose, but the explicit confirmation safeguard is absent: main() dispatches directly to cmd_index(), which begins processing without prompting or checking prior approval. The default empty active prefix allows root-wide snapshot indexing. The local-only characterization is also not enforced because the router endpoint is freely configurable. This does not establish that data is actually sent to an external service, but the code permits it. FTS5 search and router-side failover may reside in other components; their absence from this supplied chunk is not independently treated as a mismatch.

Content

No source excerpt is available for this finding.

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 · SKILL.md (reported line 27)May include surrounding context.

md
## Security & Privacy (Safety First)

1. **Automatic Secret & Credential Exclusion:**
   - Files matching `.env*`, `credentials.json`, `token.json`, `auth.json`, `secrets.json`, `id_rsa*`, `id_ed25519*`, `*.pem`, `*.key`, `*.kdbx`, `*.pfx`, `*.p12` are strictly excluded from **both** full-text indexing and directory tree snapshots (`tree.json.gz`).
   - Sensitive directories (`.ssh`, `.aws`, `.gnupg`, `.azure`, `.kube`, `.secrets`, `secrets`) are completely skipped.
2. **Symlink Boundary Protection:**
   - Directory symlinks are pruned to prevent directory traversal loops.

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/semantic_media.py (reported line 70)May include surrounding context.

python
DOC_BATCH = 32
HTTP_TIMEOUT = 300
SECRET_NAMES = {".env", "credentials.json", "token.json", "auth.json",
                "secrets.json", "id_rsa", "id_ed25519"}

# Resolved by resolve_config() before any command runs.
ROOT = None

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/triage_index.py (reported line 24)May include surrounding context.

python
}

SENSITIVE_FILE_EXACT = {
    ".env", "credentials.json", "token.json", "auth.json", "secrets.json",
    "id_rsa", "id_ed25519", "id_ecdsa", "id_dsa"
}

Code capability 'env' detected in scripts/archive_find.py but not covered by declared permissions.

High
Category
MCP Least Privilege
Confidence
75% confidence
Finding

The skill uses 'env' capability that is not covered by the declared 'allowed-tools' preapproval. Review the host runtime's actual enforcement policy; runtime permissions are unknown unless separately verified, and this declaration alone does not establish a permission ceiling.

Content

No source excerpt is available for this finding.

Code capability 'network' detected in scripts/semantic_media.py but not covered by declared permissions.

High
Category
MCP Least Privilege
Confidence
75% confidence
Finding

The skill uses 'network' capability that is not covered by the declared 'allowed-tools' preapproval. Review the host runtime's actual enforcement policy; runtime permissions are unknown unless separately verified, and this declaration alone does not establish a permission ceiling.

Content

No source excerpt is available for this finding.

Code capability 'shell' detected in scripts/semantic_media.py but not covered by declared permissions.

High
Category
MCP Least Privilege
Confidence
75% confidence
Finding

The skill uses 'shell' capability that is not covered by the declared 'allowed-tools' preapproval. Review the host runtime's actual enforcement policy; runtime permissions are unknown unless separately verified, and this declaration alone does not establish a permission ceiling.

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/semantic_media.py (reported line 69)May include surrounding context.

python
VIDEO_FRAMES = 6
DOC_BATCH = 32
HTTP_TIMEOUT = 300
SECRET_NAMES = {".env", "credentials.json", "token.json", "auth.json",
                "secrets.json", "id_rsa", "id_ed25519"}

# Resolved by resolve_config() before any command runs.

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/triage_index.py (reported line 24)May include surrounding context.

python
}

SENSITIVE_FILE_EXACT = {
    ".env", "credentials.json", "token.json", "auth.json", "secrets.json",
    "id_rsa", "id_ed25519", "id_ecdsa", "id_dsa"
}

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/triage_index.py (reported line 46)May include surrounding context.

python
def is_sensitive_file(filename: str, rel_path: str) -> bool:
    """Checks if a file or path is a private credential or secret to prevent data leakage."""
    lower_name = filename.lower()
    if lower_name.startswith(".env"):
        return True
    if lower_name in SENSITIVE_FILE_EXACT:
        return True

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/triage_index.py (reported line 299)May include surrounding context.

python
d for d in dirs
            if d not in IGNORE_DIRS
            and not d.startswith(".")
            and not d.lower().startswith(".env")
            and not (Path(root) / d).is_symlink()
        ]

In-target symlink aliases bypass the documented strict credential exclusion.

High
Category
Excessive Agency
Confidence
99% confidence
Finding

The symlink check permits targets inside the indexing root, but credential filtering examines only the alias filename and relative path. A harmless-looking alias such as notes.txt pointing to .env or .ssh/id_rsa inside that root therefore passes filtering, and normal file opening follows it, copying secret contents into the searchable SQLite index despite the documented exclusions.

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/semantic_media.py (reported line 260)May include surrounding context.

python
def video_frame_urls(abs_path):
    """6 evenly spaced frames via ffmpeg (fast seek), each -> data URL."""
    probe = subprocess.run(
        ["ffprobe", "-v", "error", "-show_entries", "format=duration",
         "-of", "json", abs_path],
        capture_output=True, timeout=60)

Tainted flow: 'abs_path' from os.environ.get (line 375, credential/environment) → subprocess.run (code execution)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/semantic_media.py (reported line 260)May include surrounding context.

python
def video_frame_urls(abs_path):
    """6 evenly spaced frames via ffmpeg (fast seek), each -> data URL."""
    probe = subprocess.run(
        ["ffprobe", "-v", "error", "-show_entries", "format=duration",
         "-of", "json", abs_path],
        capture_output=True, timeout=60)

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/semantic_media.py (reported line 272)May include surrounding context.

python
urls = []
    for i in range(VIDEO_FRAMES):
        t = dur * (i + 0.5) / VIDEO_FRAMES
        fr = subprocess.run(
            ["ffmpeg", "-v", "error", "-ss", "%.3f" % t, "-i", abs_path,
             "-frames:v", "1", "-f", "image2", "-vcodec", "mjpeg", "pipe:1"],
            capture_output=True, timeout=180)

Tainted flow: 'abs_path' from os.environ.get (line 375, credential/environment) → subprocess.run (code execution)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · scripts/semantic_media.py (reported line 272)May include surrounding context.

python
urls = []
    for i in range(VIDEO_FRAMES):
        t = dur * (i + 0.5) / VIDEO_FRAMES
        fr = subprocess.run(
            ["ffmpeg", "-v", "error", "-ss", "%.3f" % t, "-i", abs_path,
             "-frames:v", "1", "-f", "image2", "-vcodec", "mjpeg", "pipe:1"],
            capture_output=True, timeout=180)

Broad directory indexing proceeds without the user confirmation required by the manifest.

Medium
Category
Excessive Agency
Confidence
97% confidence
Finding

The index command immediately loads and processes snapshot entries without enforcing the user confirmation promised by the metadata. With an empty active prefix it can process the whole snapshot and send media or filename metadata to the router; an external agent might obtain consent, but no such enforcement is visible in this file.

Content

No source excerpt is available for this finding.

Dynamic attribute access via getattr()

Low
Category
Dangerous Code Execution
Confidence
50% confidence
Finding

Dynamic getattr() with a non-literal attribute name can access arbitrary object attributes, potentially bypassing access controls.

Content

Scanner excerpt · scripts/semantic_media.py (reported line 115)May include surrounding context.

python
cfg = {**cfg, **local}

    def pick(cli, env, key, default=None):
        v = getattr(args, cli, None) if args is not None else None
        return v or os.environ.get(env) or cfg.get(key) or default

    ROOT = pick("root", "STORAGE_MEDIA_ROOT", "root")