Back to skill

Security audit

style-fingerprint

Security checks for vulnerabilities and agentic risk

Overview

The skill has a coherent writing-analysis purpose, but its local file handling can escape the documented storage area and it retains a sample of analyzed text without clearly warning users.

Review before installing. Use this only with text you are comfortable storing locally, because saved fingerprints include a short raw sample of the analyzed text. Avoid untrusted fingerprint names or output paths until the skill validates names and confines read/write/delete operations to the intended storage area.

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
style_fingerprint.py:263
Finding

Path Traversal Through Unsanitized Fingerprint Names

Content
View full analysis
Optional[Dict]: """Load fingerprint.""" filepath = FINGERPRINTS_DIR / f"{name}.json" if not filepath.exists(): return None with open(filepath, 'r', encoding='utf-8') as f: return json.load(f) @staticmethod def list_all() -> List[str]: """List all fingerprints.""" files = FINGERPRINTS_DIR.glob("*.json") return sorted([f.stem for f in files]) @staticmethod def delete(name: str) -> bool: """Delete fingerprint.""" filepath = FINGERPRINTS_DIR / f"{name}.json" if filepath.exists(): filepath.unlink() return True return False ``` ### Technical Analysis The `name` argument originates from the user-controlled `--name` command-line option and is interpolated directly into a filesystem path: ```python filepath = FINGERPRINTS_DIR / f"{name}.json" ``` The implementation neither restricts the permitted characters in a fingerprint name nor resolves and validates the resulting path ag ...[truncated 2432 chars]
Remediation
View remediation
str: if not SAFE_NAME.fullmatch(name): raise ValueError( "Invalid fingerprint name: use only letters, digits, underscores, and hyphens" ) return name ``` 2. Resolve the final path and verify that it remains inside the fingerprint directory before every read, write, or deletion: ```python def fingerprint_path(name: str) -> Path: validate_name(name) base = FINGERPRINTS_DIR.resolve() candidate = (base / f"{name}.json").resolve() if candidate.parent != base: raise ValueError("Fingerprint path escapes the storage directory") return candidate ``` 3. Replace every direct construction of `filepath` in `save()`, `load()`, and `delete()` with the centralized `fingerprint_path()` function. 4. Reject absolute paths, directory separators, `.` and `..` components explicitly, even if an allowlist is implemented, as defense in depth. 5. Consider preventing silent overwrites by opening new fingerprints in exclusive creation mode (`'x'`) or requiring an explicit overwrite option. 6. Add automated tests covering traversal and absolute-path inputs, including: ```text ../target ../../target /tmp/target ..\target nested/name ``` 7. Keep filesystem permissions on the skill process limited so that a future path-validation regression cannot modify sensitive system or user files. ]]>
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (8)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill advertises file read/write behavior through its commands and storage model, but it does not declare any tool scope such as permissions or allowed-tools. That creates an authorization and transparency gap: a host or user may not be clearly informed that the skill can read arbitrary files via --file and persist data under ./fingerprints/, increasing the chance of unintended file access or writes.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The module description explicitly defines the skill as a Chinese writing style analyzer, which constrains the skill to a single language context. Under the policy, language-specific behavior should either offer user opt-in/choice or be clearly justified as a locale-specific tool; this file does not provide such opt-in language.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The code persists up to 500 characters of source_text alongside the fingerprint, which materially changes the data-handling model from derived-style metadata to retention of original content. In contexts where users analyze sensitive drafts, prompts, or private documents, this can leak or unnecessarily retain confidential text on disk.

Content

No source excerpt is available for this finding.

Dynamic import via __import__()

Medium
Category
Dangerous Code Execution
Confidence
75% confidence
Finding

Dynamic import() can load arbitrary modules at runtime, bypassing static analysis and potentially importing malicious code.

Content

Scanner excerpt · style_fingerprint.py (reported line 271)May include surrounding context.

python
"name": name,
            "fingerprint": fingerprint,
            "source_text_sample": source_text[:500] if source_text else "",
            "created_at": str(__import__('datetime').datetime.now())
        }
        with open(filepath, 'w', encoding='utf-8') as f:
            json.dump(data, f, ensure_ascii=False, indent=2)

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The manifest presents the skill as analyzing text and saving style fingerprints for later use. Implementing a delete operation adds destructive filesystem capability that is not mentioned or obviously required by that stated purpose.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill description says data is saved under ./fingerprints/, but the export command accepts an arbitrary --output path and writes to it without restriction. In an agent setting, this expands the tool from scoped fingerprint storage into a generic file writer, which can overwrite files outside the intended directory if untrusted input controls the output path.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The description repeatedly specifies that the skill analyzes Chinese writing style and is Chinese-optimized, which imposes a language-specific constraint. Under the policy, forcing a specific language without user choice or an explicit justified locale limitation can be a natural-language policy issue.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill states that text-derived fingerprints are persistently stored, but it does not warn users that analyzed content may leave lasting artifacts on disk. If users analyze sensitive drafts or private writing, those derived fingerprints may retain stylistic signals and become an unintended privacy exposure.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.