Back to skill

Security audit

知识库归档系统

Security checks for vulnerabilities and agentic risk

Overview

This archiver is coherent at a high level, but unsafe command execution and under-scoped AI/cloud integrations could expose documents or run commands while processing crafted files.

Review before installing. Avoid running this skill on untrusted Office documents or directories until the shell-based extraction and AI/cloud command paths are replaced with argument-based subprocess calls. Keep AI classification and cloud upload disabled unless you are comfortable with document names, summaries, excerpts, or full files leaving the local machine and you have validated the destination and credentials.

Vulnerability Patterns
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (5)

T09 · Insecure Skill Coding Practices

Error
Location
_scripts/archive.mjs:163
Finding

Shell Command Injection in AI Classification

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
_scripts/archive.mjs:275
Finding

Shell and Python Code Injection in Office Document Extractors

Content
View full analysis
]*>([^<]+)', doc) print(json.dumps(''.join(texts))) except Exception as e: print(json.dumps(f'Error: {str(e)}')) "`, { encoding: 'utf-8', maxBuffer: 50 * 1024 * 1024 }); return JSON.parse(out.trim()); } ``` ```javascript function extractPptx(filePath) { const out = execSync(`python3 -c " import zipfile, re, json try: with zipfile.ZipFile('${filePath}') as z: slides = sorted([f for f in z.namelist() if f.startswith('ppt/slides/slide') and f.endswith('.xml')]) texts = [] for sf in slides: slide = z.read(sf).decode('utf-8') texts.extend(re.findall(r'([^<]+)', slide)) print(json.dumps('\\n'.join(texts))) except Exception as e: print(json.dumps(f'Error: {str(e)}')) "`, { encoding: 'utf-8', maxBuffer: 50 * 1024 * 1024 }); return JSON.parse(out.trim()); } ``` ### ...[truncated 1957 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
_scripts/archive.mjs:223
Finding

Potential Disclosure of Document Content to an Arbitrary AI Endpoint

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
_scripts/archive.mjs:353
Finding

Shell Command Injection in Optional Cloud Upload Configuration

Content
View full analysis
`coscmd upload "${filepath}" "${remotePath}"`, }; ``` ```javascript function uploadToCloud(filePath, remotePath) { if (!CLOUD_STORAGE.enabled || !CLOUD_STORAGE.command) { console.log(' ☁️ 云存储未配置,跳过上传'); return null; } try { const cmd = CLOUD_STORAGE.command(filePath, remotePath); execSync(cmd, { timeout: 120000 }); return remotePath; } catch (e) { console.error(` ❌ 云上传失败: ${e.message}`); return null; } } ``` The documented configuration pattern is: ```javascript const CLOUD_STORAGE = { enabled: true, type: 'cos', bucket: 'mybucket-1250000000', prefix: 'knowledge-base/', command: (filepath, remotePath) => `coscmd upload "${filepath}" "${remotePath}"`, }; ``` ### Technical Analysis The shipped cloud feature is disabled, which prevents exploitation in the default configuration. However, the documentation explicitly instructs users to enable a callback that returns a shell command string. Both `filePath` and `remotePath` include attacker-influenced filename data. Wrapping these values in double quotes does not prevent shell command substitution, embedded quotes, or other shell interpretation. The resulting command is executed by `execSync()`. The generic command callback also grants cloud configuration unrestricted local command-execution capability, which is broader than the privilege required to upload a file. ### Attack Path 1. An operator enables cloud storage using the documented command callback. 2. An attacker supplies a file larger than 10 MB ...[truncated 843 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
SKILL.md:127
Finding

Unpinned Dependencies and Unverified Cloud Utility Download

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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 (18)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node _scripts/archive.mjs /path/to/file.xlsx

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node _scripts/archive.mjs /path/to/file.xlsx

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node _scripts/archive.mjs /path/to/file.xlsx

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node _scripts/archive.mjs /path/to/file.xlsx

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node _scripts/archive.mjs /path/to/file.xlsx

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node _scripts/archive.mjs /path/to/file.xlsx

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node _scripts/archive.mjs /path/to/file.xlsx

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node _scripts/archive.mjs /path/to/file.xlsx

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node _scripts/archive.mjs /path/to/file.xlsx

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill documents capabilities that rely on environment variables and network access for AI classification and optional cloud uploads, but it does not declare any explicit tool scope or permissions boundary. This can cause users or hosts to underestimate the skill's ability to access configuration secrets and transmit data externally, increasing the risk of unintended data exposure.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill advertises automatic archiving, content extraction, indexing, and optional cloud upload of user files, but it does not provide a prominent upfront warning about copying, indexing, retaining, and potentially transmitting document contents. Because the skill targets bulk processing of office documents, it may handle sensitive business data, making silent storage and transfer behavior especially risky.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script invokes external shell commands and Python one-liners using file paths and document-derived text, expanding its attack surface beyond simple archiving. This is dangerous because unsafely composed command strings can lead to command injection or unintended code execution, especially where file paths are interpolated into Python snippets or shell commands.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill is presented as a local knowledge-base archiver, but its AI classification configuration supports sending document-derived content to an external CLI-backed model or remote API endpoint. This creates a confidentiality risk because sensitive document summaries and excerpts may leave the local environment without a clear, explicit disclosure at the point of use.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The optional cloud-upload capability broadens the skill from local archiving into external data transfer, which changes the trust and privacy model. Even if disabled by default, the presence of this path means archived files may be exfiltrated to third-party storage if enabled without sufficient controls or user awareness.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The AI classification path sends file name, summary, and content excerpts to an external or externally mediated model service without an explicit user-facing warning in the workflow. In a document archiving context, this can expose proprietary, personal, or regulated information during classification.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The cloud upload path can transfer archived files outside the local system without an in-band warning at the moment of archival. Because users may expect a local knowledge-base tool to keep documents on-device, this mismatch can lead to accidental disclosure of sensitive files.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The natural-language instructions and description are presented in Chinese only, which can amount to forcing a specific language without offering a choice. The policy allows locale constraints when justified or opt-in is provided, but no such justification or language-selection guidance appears here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The user-facing description, help text, and command guidance are written entirely in Chinese, including usage examples and status messages. This imposes a language choice on users without any opt-in or alternative locale, which matches the policy's language/locale violation criterion.

Content

No source excerpt is available for this finding.