Back to skill

Security audit

File Indexer Publish

Security checks for vulnerabilities and agentic risk

Overview

This file-search skill is not clearly malicious, but it can automatically index broad local files and store file snippets in a local database with weak scope controls.

Install only if you are comfortable with a local indexer recording file paths and short content snippets from broad workspace areas. Before enabling it, restrict watched directories, avoid indexing secrets or agent configuration files, pin dependencies, and fix the relative subprocess entry point and hook path validation.

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

T05 · Unauthorized Access and Privilege Escalation

Error
Location
hook_handler.py:27
Finding

Unrestricted Hook-Controlled Local File Indexing

Content
View full analysis
str: """Extract a file content summary (first 500 characters).""" try: # Skip binary files with open(filepath, 'rb') as f: chunk = f.read(500) if b'\x00' in chunk: return '' with open(filepath, 'r', encoding='utf-8', errors='ignore') as f: content = f.read(500) return content.replace('\n', ' ').strip() except Exception: return '' ``` ### Technical Analysis The hook handler consumes event data from standard input and trusts the `file_path` supplied in `Write` and `Edit` events. It does not canonicalize the path, confirm that it belongs to an approved workspace, reject symbolic links, enforce an approved extension list, or deny sensitive filenames. `FileIndexer.add_file()` subsequently invokes `_extract_summary()`, which reads and stores the first 500 characters of any accessible file in the SQLite index. The stricter filtering applied by `scan_directory()` does not apply to files submitted through hook events. Consequently, an actor able to submit or forge hook input can cause the Skill to read files outside its intended workspace. Sensitive ...[truncated 1384 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
__main__.py:11
Finding

Current-Working-Directory Script Hijacking in the Package Entry Point

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
README.md:18
Finding

Unpinned Third-Party Dependency Installation

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • 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 (27)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
91% confidence
Finding

Using 'rm -rf' in installation documentation is dangerous because it performs irreversible deletion without confirmation, and users may execute it blindly. Although the path is scoped to the skill directory, documentation-driven destructive commands increase the chance of accidental data loss, especially if paths are mistyped, expanded unexpectedly, or copied into the wrong environment.

Content

Scanner excerpt · INSTALL.md (reported line 64)May include surrounding context.

卸载

bash
rm -rf ~/.openclaw/skills/file-indexer
rm -rf /home/t/cc_workspace/file_indexer
openclaw gateway restart

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
91% confidence
Finding

Using 'rm -rf' in installation documentation is dangerous because it performs irreversible deletion without confirmation, and users may execute it blindly. Although the path is scoped to the skill directory, documentation-driven destructive commands increase the chance of accidental data loss, especially if paths are mistyped, expanded unexpectedly, or copied into the wrong environment.

Content

Scanner excerpt · INSTALL.md (reported line 64)May include surrounding context.

卸载

bash
rm -rf ~/.openclaw/skills/file-indexer
rm -rf /home/t/cc_workspace/file_indexer
openclaw gateway restart

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

This command recursively force-deletes a workspace directory under /home/t/cc_workspace. In context it appears intended for uninstall, but it is still hazardous because it normalizes destructive shell usage and can lead to unintended deletion if the path is wrong, reused on another host, or copied by a user with different directory structure.

Content

Scanner excerpt · INSTALL.md (reported line 65)May include surrounding context.

bash
rm -rf ~/.openclaw/skills/file-indexer
rm -rf /home/t/cc_workspace/file_indexer
openclaw gateway restart

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% confidence
Finding

This command recursively force-deletes a workspace directory under /home/t/cc_workspace. In context it appears intended for uninstall, but it is still hazardous because it normalizes destructive shell usage and can lead to unintended deletion if the path is wrong, reused on another host, or copied by a user with different directory structure.

Content

Scanner excerpt · INSTALL.md (reported line 65)May include surrounding context.

bash
rm -rf ~/.openclaw/skills/file-indexer
rm -rf /home/t/cc_workspace/file_indexer
openclaw gateway restart

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · README.md (reported line 41)May include surrounding context.

md
./file_indexer add /path/to/file.py

# 标记文件为已删除
./file_indexer delete /path/to/file

# 查看文件信息
./file_indexer info /path/to/file.py

Agent Config Directory Access

High
Category
Agent Snooping
Confidence
90% confidence
Finding

The README references modifying a .claude/settings.local.json agent configuration path to auto-run the indexer. Access to or dependence on agent configuration is security-sensitive because it can establish persistent behavior, broaden monitoring scope, or hook into future agent actions in a way users may not expect.

Content

Scanner excerpt · README.md (reported line 88)May include surrounding context.

md
文件索引器已配置为自动运行。当 agent 创建或修改文件时,会自动记录到索引中。

配置位置:`/home/t/cc_workspace/.claude/settings.local.json`

## 支持的命令

Vague Triggers

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The auto-invocation triggers are very broad (for example generic requests like '找文件' or '搜索'), which can match normal conversation and cause the skill to run unexpectedly. In a skill that can scan directories and invoke CLI actions, accidental activation can expose file metadata or kick off unintended filesystem operations.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
91% confidence
Finding

The skill exposes command examples that accept arbitrary filesystem paths, including a delete-related operation, without documenting any path restrictions, validation, or confirmation requirements. Even if this only 'marks' deletion in the index, a host agent could pass attacker-influenced paths to shell-backed code, leading to path abuse, indexing manipulation, or unintended operations against sensitive locations.

Content

Scanner excerpt · SKILL.md (reported line 82)May include surrounding context.

python3 main.py scan /dir/path

标记删除

python3 main.py delete /path/to/file

text

## 配置说明

Vague Triggers

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The trigger list includes very broad everyday terms such as "find", "search", "file", "有没有", and "在哪里", which can cause the skill to activate in many unrelated conversations. Because this skill is available to multiple agents and performs file indexing/search functions, unintended invocation could expose workspace structure or file metadata more often than the user intended.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · INSTALL.md (reported line 7)May include surrounding context.

1. 克隆技能目录

bash
mkdir -p ~/.openclaw/skills/file-indexer
cp -r ~/.openclaw/workspace/skills/file-indexer-publish/* ~/.openclaw/skills/file-indexer/

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This markdown file includes destructive rm -rf commands for both the skill directory and workspace data, but the surrounding instructions do not warn the user that these deletions are irreversible. For markdown files, destructive behavior that can affect user data or system integrity should be disclosed explicitly.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
72% confidence
Finding

Nearly all user-facing documentation is written in Chinese, and the file does not indicate that other languages are supported or that the language choice is optional. This can constitute a language/locale policy issue when a skill effectively constrains users to a specific language without opt-in.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The markdown states that the tool automatically tracks file creation, modification, and deletion, and supports real-time monitoring, but it does not warn users that this behavior continuously records file activity and metadata. Because this can affect privacy and user data visibility, the skill description should disclose the monitoring behavior and its scope.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This section states that the indexer is already configured to run automatically and continuously record files when the agent creates or modifies them. Auto-enabling persistent monitoring via agent configuration without a clear opt-in, warning, or scope limitation can lead to unintended surveillance of workspace activity and collection of sensitive file metadata.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill advertises capabilities that imply file reading and shell execution, but it does not declare any explicit tool scope or permission boundaries. That makes it difficult for a host agent to constrain execution and increases the risk that the skill will be invoked with broader filesystem or command access than intended.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
80% confidence
Finding

The manifest description and usage guidance are presented in Chinese only, which can impose a language choice on users without opt-in. The policy requires avoiding forced language or locale unless the skill clearly offers a choice or documents a justified regional constraint.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The 'Use when' guidance is ambiguous and broad, especially around phrases like locating scripts or asking whether code with some feature exists. This can cause the orchestrator to select the skill in situations where the user did not intend filesystem indexing or search, increasing the chance of unnecessary access to workspace contents.

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 · __init__.py (reported line 16)May include surrounding context.

python
# 直接运行 indexer.py 的 main 块
if __name__ == '__main__':
    import subprocess
    subprocess.run([sys.executable, 'indexer.py'] + sys.argv[1:])

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 · __main__.py (reported line 14)May include surrounding context.

python
# 直接运行 indexer.py 的 main 块
if __name__ == '__main__':
    import subprocess
    subprocess.run([sys.executable, 'indexer.py'] + sys.argv[1:])

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest uses a Chinese yuan currency code (CNY) and a Chinese-only price description, which imposes a specific locale/language context in user-facing metadata. There is no indication of user choice, localization support, or a documented region-specific justification in this file.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring and function descriptions are written only in Chinese, and all user-facing log messages are likewise emitted in Chinese elsewhere in the file. This imposes a specific language/locale without user opt-in or any documented justification that the skill is intended only for Chinese-speaking users or a China-specific environment.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This code file contains natural-language documentation exclusively in Chinese, including the module docstring that explains the skill's purpose. The policy requires avoiding forced language or locale constraints unless the user is given a choice or the constraint is clearly justified, and no such opt-in or justification appears here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code includes natural-language descriptions, CLI output, and usage guidance exclusively in Chinese. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly justified, which is not present here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
81% confidence
Finding

The manifest description is written entirely in Chinese, indicating a language-specific presentation without any indication that users can choose their preferred language or locale. Under the policy, language constraints should be opt-in or clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The entire skill documentation is presented only in Chinese, including operational instructions and command descriptions, with no indication that the skill is region-specific or that another language option is available. This can violate language/locale policy when a specific language is imposed without user opt-in or justification.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.destructive_delete_command

Documentation contains a destructive delete command without an explicit confirmation gate.

Warn
Code
suspicious.destructive_delete_command
Location
INSTALL.md:64