Back to skill

Security audit

Encrypted File Reader

Security checks for vulnerabilities and agentic risk

Overview

This is a disclosed local file reader, but it can read and print sensitive files such as environment and infrastructure state files without safeguards.

Review this skill before installing. Use it only on files you intentionally choose, and avoid pointing it at secrets, production environment files, cloud state files, private configs, or untrusted Office documents unless you are prepared for their contents to be exposed to the agent output.

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
read_file.py:76
Finding
Unbounded Office archive decompression can cause resource exhaustion<![CDATA[ ## Vulnerability Details **File Location**: `read_file.py:76-107` **Vulnerable Operations**: `read_file.py:79`, `read_file.py:88`, and `read_file.py:102` **Vulnerability Type**: Uncontrolled resource consumption through ZIP decompression **Risk Level**: Medium ### Vulnerable Code ```python def read_docx(file_path): """读取 Word 文档 (.docx) 内容""" texts = [] with zipfile.ZipFile(file_path, 'r') as z: # 读取 document.xml content = z.read('word/document.xml') # 提取所有 w:t 标签中的文本 matches = re.findall(b'<w:t[^>]*>([^<]*)</w:t>', content) for match in matches: texts.append(match.decode('utf-8')) return '\n'.join(texts) def read_xlsx(file_path): """读取 Excel 表格 (.xlsx) 内容""" texts = [] with zipfile.ZipFile(file_path, 'r') as z: # 读取 sharedStrings.xml try: content = z.read('xl/sharedStrings.xml') # 提取所有 t 标签中的文本 matches = re.findall(b'<si><t>([^<]*)</t>', content) for match in matches: texts.append(match.decode('utf-8')) except KeyError: # 如果没有 sharedStrings.xml,尝试读取 worksheets for name in z.namelist(): if name.startswith('xl/worksheets/sheet') and name.endswith('.xml'): content = z.read(name) # 提取 cell 中的值 matches = re.findall(b'<v>([^<]*)</v>', content) for match in matches: try: texts.append(match.decode('utf-8')) except: pass return '\n'.join(texts) ``` ### Technical Analysis DOCX and XLSX documents are ZIP archives. The implementation calls `ZipFile.read()` on archive entries without validating the input file size, uncompressed entry size, cumulative uncompressed size, compression ratio, or number of worksheet entries. `ZipFile.read()` decompresses an ent ...[truncated 1998 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Reject input archives larger than a documented maximum before opening them. 2. Inspect every relevant `ZipInfo` entry before decompression and enforce: - A maximum number of archive entries. - A maximum uncompressed size per entry. - A maximum cumulative uncompressed size. - A maximum compression ratio, with safe handling for zero-byte compressed sizes. 3. Read entries incrementally with `ZipFile.open()` rather than using `ZipFile.read()`. 4. Parse Office XML with a streaming parser such as `xml.etree.ElementTree.iterparse()` and stop when a configured text or byte limit is reached. 5. Limit the amount of extracted text retained and written to standard output. 6. Catch `zipfile.BadZipFile`, size-limit violations, decompression errors, and decoding failures explicitly, then return a controlled error. 7. When this reader is exposed through an Agent or service, run it with memory, CPU, and execution-time limits in a sandboxed worker process. 8. Add regression tests using archives with extreme compression ratios, oversized XML entries, excessive worksheet counts, and excessive cumulative expanded size. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (10)

Credential Access

High
Category
Privilege Escalation
Content
|------|--------|
| **文本类** | .txt, .md, .markdown, .log, .csv, .tsv |
| **代码类** | .java, .py, .js, .ts, .jsx, .tsx, .c, .cpp, .h, .cs, .go, .rs, .rb, .php, .vue, .svelte |
| **配置类** | .json, .json5, .xml, .yaml, .yml, .toml, .ini, .cfg, .conf, .properties, .gradle, .config, .env |
| **Web 前端** | .html, .htm, .css, .scss, .sass, .less, .styl |
| **脚本类** | .sh, .bash, .bat, .cmd, .ps1, .sql, .graphql |
| **Git 相关** | .gitignore, .gitattributes, .gitmodules, .editorconfig |
Confidence
88% confidence
Finding
The skill explicitly advertises reading arbitrary local files including sensitive configuration files such as .env, and frames itself as usable for 'encrypted/protected' files accessible via authorized applications. In an agent setting, this materially increases the risk of secret disclosure, because .env files commonly contain API keys, tokens, passwords, and database credentials that could be exfiltrated through stdout.

Credential Access

High
Category
Privilege Escalation
Content
- **文本类**: .txt, .md, .markdown, .rst, .log, .csv, .tsv
- **代码类**: .java, .py, .js, .ts, .jsx, .tsx, .c, .cpp, .h, .cs, .go, .rs, .rb, .php, .vue
- **配置类**: .json, .xml, .yaml, .yml, .toml, .ini, .cfg, .properties, .gradle, .config, .env
- **样式类**: .html, .htm, .css, .scss, .sass, .less
- **脚本类**: .sh, .bash, .bat, .cmd, .ps1, .sql
- **Word 文档**: .docx
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
'.sql', '.graphql', '.gql',
    
    # 配置文件
    '.config', '.env', '.env.example', '.env.local', '.env.production',
    '.htaccess', '.editorconfig', '.gitignore', '.gitattributes', '.gitmodules',
    '.dockerfile', '.dockerignore',
    '.makefile', '.mk', '.cmake',
Confidence
94% confidence
Finding
Support for .env.production is especially risky because production environment files commonly contain live credentials for external services and databases. Directly reading and printing these values could lead to immediate compromise of production systems.

Credential Access

High
Category
Privilege Escalation
Content
'.sql', '.graphql', '.gql',
    
    # 配置文件
    '.config', '.env', '.env.example', '.env.local', '.env.production',
    '.htaccess', '.editorconfig', '.gitignore', '.gitattributes', '.gitmodules',
    '.dockerfile', '.dockerignore',
    '.makefile', '.mk', '.cmake',
Confidence
94% confidence
Finding
Support for .env.production is especially risky because production environment files commonly contain live credentials for external services and databases. Directly reading and printing these values could lead to immediate compromise of production systems.

Credential Access

High
Category
Privilege Escalation
Content
'.sql', '.graphql', '.gql',
    
    # 配置文件
    '.config', '.env', '.env.example', '.env.local', '.env.production',
    '.htaccess', '.editorconfig', '.gitignore', '.gitattributes', '.gitmodules',
    '.dockerfile', '.dockerignore',
    '.makefile', '.mk', '.cmake',
Confidence
94% confidence
Finding
Support for .env.production is especially risky because production environment files commonly contain live credentials for external services and databases. Directly reading and printing these values could lead to immediate compromise of production systems.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The skill documentation is written entirely in Chinese, including usage, warnings, and legal notes, with no indication that users may choose another language or locale. This can violate a language/locale policy when a skill imposes a specific language without user opt-in.

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
The package description is written entirely in Chinese and presents the skill in a single language, with no indication that users may choose another language or locale. This can violate language/locale policy when a skill implicitly mandates one language without opt-in or documented regional justification.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The program accepts an arbitrary local path, reads the file, and prints its raw contents with no path restriction, sensitivity checks, or warning to the user. In a skill/agent environment, this creates a straightforward local file exfiltration primitive that can disclose credentials, tokens, private documents, and system configuration data.

Context-Inappropriate Capability

Medium
Confidence
92% confidence
Finding
The script explicitly supports reading secret-bearing file types such as .env and .tfstate and then prints their contents directly to stdout. In an agent skill context, unrestricted local file disclosure can expose API keys, cloud credentials, database passwords, and infrastructure state far beyond what is necessary for ordinary document reading.

Natural-Language Policy Violations

Low
Confidence
86% confidence
Finding
Natural-language instructions, usage text, and descriptions are presented only in Chinese. If organizational policy requires not forcing a specific language without user choice, this is a language-policy issue because no alternate language or opt-in mechanism is provided.

Static analysis

No suspicious patterns detected.