Back to skill

Security audit

FapiaoClaw

Security checks for vulnerabilities and agentic risk

Overview

The skill is an invoice organizer, but it can permanently delete or move files across a chosen directory and its command template is unsafe with user-supplied keywords.

Review before installing. Use it only on a dedicated invoice-only folder, not a project, home, downloads, or shared directory. Expect it to rename files, permanently delete some files, and move PDFs. Prefer a revised version that uses shell-free invocation, confirms destructive actions, supports dry-run or quarantine, limits deletion to verified PDFs, handles destination collisions, and pins PyMuPDF.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (5)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:17
Finding

Shell Command Injection Through Unquoted User-Controlled Arguments

Content
View full analysis
` if it is missing from their request. Do not guess it. 3. **Execute Command**: - Construct and run the following terminal command (replacing placeholders with extracted values): `python main.py process -d ` ``` ### Technical Analysis The skill instructs the Agent to interpolate the user-controlled `keyword` and directory directly into a terminal command. It does not require shell-free execution, argument-array construction, escaping, quoting, or input validation. Both inputs may contain shell metacharacters. This is especially significant for the keyword because semicolons are explicitly accepted as keyword separators, while a shell also interprets a semicolon as a command separator. If the Agent invokes the resulting string through a shell, crafted input can change the command's structure rather than remaining a literal argument. The Python `argparse` implementation does not mitigate this issue because shell parsing occurs before `main.py` receives its arguments. ### Attack Path 1. An attacker supplies an invoice-processing request with a crafted keyword or directory containing shell syntax. 2. The Agent follows `SKILL.md` and directly substitutes the attacker-controlled value into the documented command string. 3. The Agent runs that string through a terminal shell. 4. The shell ...[truncated 720 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
main.py:50
Finding

Recursive Duplicate Removal Permanently Deletes Unrelated File Types

Content
View full analysis
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
main.py:77
Finding

Filename-Based Rule Permanently Deletes Arbitrary Files

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
main.py:130
Finding

PDF Moves Do Not Safely Handle Destination Filename Collisions

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
requirements.txt:1
Finding

PyMuPDF Dependency Is Installed Without a Version or Integrity Pin

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (9)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill advertises invoice processing but does not clearly warn that running it may delete duplicate files, remove files deemed invalid, and move files into other directories. This can cause unintended data loss or surprising filesystem changes if a user invokes the skill without understanding its side effects, especially because the workflow is framed as routine organization.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The docstring for process_duplicates says "Find and remove duplicate files based on MD5 hash," but the step banner at runtime says "Checking for duplicate files," which suggests a non-destructive check. The implementation actually calls os.remove(file_path), so the inline intent communicated to users is contradicted by destructive behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script permanently deletes files identified as duplicates without prior confirmation, quarantine, or a safe rollback path. In an agent/skill context, this is dangerous because a user may invoke it expecting analysis or cleanup and instead lose data irreversibly across a directory tree.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

Files whose names contain the hard-coded keyword are deleted immediately with no confirmation or recovery mechanism. This can cause unintended data loss, especially in a bulk-processing skill where directory contents may be broader than expected and filename matching may catch legitimate documents.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

check_pdf_content is documented as a check for whether PDFs contain target keywords, which implies inspection only. In reality, it creates invoices/unknown directories and moves every processed PDF into either invoices or invoices/unknown, which is materially different from a passive check.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The function performs bulk reorganization of files based on parsed PDF contents without upfront warning, confirmation, or transactional safeguards. In an automated skill setting, this can unexpectedly alter a large corpus of files, break downstream references, and hide or misclassify documents if parsing is inaccurate.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The default filename keyword '行程单' and later Chinese-specific invoice parsing/output indicate the skill is tailored to a specific language/locale. Because the script presents this behavior as general invoice processing without opt-in or explicit locale scoping, it can violate the language/locale policy requirement.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
96% confidence
Finding

The dependency is unpinned, so builds are not reproducible and may silently pull in newer releases with security regressions or breaking changes. In a security context this increases supply-chain risk because the installed version cannot be reviewed or constrained.

Content

Scanner excerpt · requirements.txt (reported line 1)May include surrounding context.

text
PyMuPDF

Unverifiable Dependency: PyMuPDF has 2 known advisory(ies) (CVE-2026-3029 (PyMuPDF has a path traversal in _main_.py); CVE-2026-3029 (PyMuPDF has a path traversal in _main_.py)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
89% confidence
Finding

PyMuPDF has known advisories, and because the manifest does not pin a version there is no way to verify whether installation will select an affected release. That uncertainty is dangerous because deployments may resolve to a vulnerable version, potentially exposing path traversal risk depending on how the package is used.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.