Back to skill

Security audit

Enterprise File Writer

Security checks for vulnerabilities and agentic risk

Overview

This is a disclosed local file-writing skill, but its broad overwrite authority and confirmed data-integrity flaws make it something users should review carefully before installing.

Install only if you trust agents to write local files on your behalf and can closely review every path and content payload. Avoid using it for production configs, .env files, scripts, or existing spreadsheets unless you have backups and explicitly approve the write; do not rely on --encoding for non-UTF-8 output or on XLSX append to preserve existing workbook data.

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
write_file.py:490
Finding

XLSX append mode silently destroys existing spreadsheet data

Content
View full analysis
([^<]*)', shared_strings_content) # 读取 worksheet 获取行列结构 worksheet_content = zf.read('xl/worksheets/sheet1.xml').decode('utf-8') # 简单解析:获取行数 row_matches = re.findall(r'
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
write_file.py:185
Finding

Sensitive-path protection can be bypassed through symbolic links and path replacement races

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • 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 (14)

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 · FIX_REPORT_1.3.0.md (reported line 126)May include surrounding context.

md
# 预期输出: [操作中止] 检测到潜在安全风险,请使用 --force 参数确认执行

# 测试 2: 写入敏感文件类型(应被中止)
python write_file.py "/path/to/.env" "SECRET=test"
# 预期输出: [安全警告] 警告:目标文件可能包含敏感信息

# 测试 3: 写入可执行脚本(应输出警告)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill presents itself as enterprise-safe, but its documented behavior still permits writing to sensitive paths, executable scripts, and credential-related files with only warning-based controls and a bypass flag. This creates a dangerous trust mismatch: an agent may invoke it assuming meaningful policy enforcement, while the tool can still be used to overwrite configs, persistence scripts, or secret-bearing files.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
92% confidence
Finding

Explicitly supporting writes to .env files enables modification of credential-bearing configuration commonly used for secrets, API keys, and service credentials. In the context of a generic file-writing skill, this is especially dangerous because an agent can be induced to plant, replace, or corrupt secrets, redirect services, or weaken security controls with a single file write.

Content

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

md
|------|--------|----------|
| **文本类** | .txt, .md, .markdown, .rst, .log, .csv, .tsv | UTF-8 文本写入 |
| **代码类** | .java, .py, .js, .ts, .jsx, .tsx, .c, .cpp, .h, .cs, .go, .rs, .rb, .php, .vue | UTF-8 文本写入 |
| **配置类** | .json, .xml, .yaml, .yml, .toml, .ini, .cfg, .properties, .gradle, .config, .env | UTF-8 文本写入 |
| **样式类** | .html, .htm, .css, .scss, .sass, .less | UTF-8 文本写入 |
| **脚本类** | .sh, .bash, .bat, .cmd, .ps1, .sql | UTF-8 文本写入 |
| **Office** | .docx (Word), .xlsx (Excel) | OpenXML ZIP 格式写入 |

Credential Access

High
Category
Privilege Escalation
Confidence
89% confidence
Finding

Allowing writes to .env.production is especially dangerous because production deployments commonly ingest it automatically, so a single file modification can change credentials, service endpoints, feature flags, or execution behavior at runtime. In an enterprise file-writer skill, this raises the impact from ordinary file output to potential production compromise and persistence.

Content

Scanner excerpt · write_file.py (reported line 101)May include surrounding context.

python
'.sql', '.graphql', '.gql',
    
    # 配置文件
    '.config', '.env', '.env.example', '.env.local', '.env.production',
    '.htaccess', '.editorconfig', '.gitignore', '.gitattributes', '.gitmodules',
    '.dockerfile', '.dockerignore',
    '.makefile', '.mk', '.cmake',

Credential Access

High
Category
Privilege Escalation
Confidence
89% confidence
Finding

Allowing writes to .env.production is especially dangerous because production deployments commonly ingest it automatically, so a single file modification can change credentials, service endpoints, feature flags, or execution behavior at runtime. In an enterprise file-writer skill, this raises the impact from ordinary file output to potential production compromise and persistence.

Content

Scanner excerpt · write_file.py (reported line 101)May include surrounding context.

python
'.sql', '.graphql', '.gql',
    
    # 配置文件
    '.config', '.env', '.env.example', '.env.local', '.env.production',
    '.htaccess', '.editorconfig', '.gitignore', '.gitattributes', '.gitmodules',
    '.dockerfile', '.dockerignore',
    '.makefile', '.mk', '.cmake',

Credential Access

High
Category
Privilege Escalation
Confidence
89% confidence
Finding

Allowing writes to .env.production is especially dangerous because production deployments commonly ingest it automatically, so a single file modification can change credentials, service endpoints, feature flags, or execution behavior at runtime. In an enterprise file-writer skill, this raises the impact from ordinary file output to potential production compromise and persistence.

Content

Scanner excerpt · write_file.py (reported line 101)May include surrounding context.

python
'.sql', '.graphql', '.gql',
    
    # 配置文件
    '.config', '.env', '.env.example', '.env.local', '.env.production',
    '.htaccess', '.editorconfig', '.gitignore', '.gitattributes', '.gitmodules',
    '.dockerfile', '.dockerignore',
    '.makefile', '.mk', '.cmake',

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This markdown file is written entirely in Chinese and does not indicate that language is optional or limited to a justified region-specific context. Under the policy, forcing a specific language without user opt-in is a natural-language locale violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The manifest description, activation conditions, safety guidance, and usage instructions consistently require Chinese comprehension. This effectively forces a specific language/locale for users and agents without documenting an opt-in or justified region-specific constraint.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The report explicitly validates overwrite-capable file writing but does not mention any safeguard, warning, or confirmation requirement around destructive writes. In a file-writer skill, this omission can normalize unsafe usage and increase the risk of accidental data loss or abuse to replace important local files, especially in enterprise contexts where sensitive configuration or document files may exist.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The natural-language description is entirely in Chinese and presents the skill's behavior and support scope only in that language. For a general-purpose file writer, this appears to impose a language/locale constraint without user opt-in or a documented region-specific justification, which matches the policy-violation criteria.

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 presents the skill name, usage, supported file types, and operational description entirely in Chinese, which imposes a specific language on users. Under the policy, locale/language constraints should either be optional for the user or explicitly justified as region-specific; this file does neither.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest explicitly claims correct UTF-8/GBK handling to avoid garbled text, and the CLI exposes an --encoding option, but the actual text write path hard-codes content.encode('utf-8'). This means GBK or any non-UTF-8 encoding request is not honored, so the implemented behavior does not match the stated capability.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The argparse description, help text, examples, warning prompts, success messages, and error output are all written in Chinese. This creates a language policy issue because users are not given a choice of language and no business or regional justification is stated in the file.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The help text explicitly documents '--encoding gbk' as a supported usage example, creating a clear expectation that encoding selection affects file output. In practice, the write path ignores the encoding argument and always writes UTF-8 bytes, so the documentation contradicts actual behavior.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.