Back to skill

Security audit

金石知识库

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a project-specific DingTalk archiving skill, but it needs review because it reads business records and writes local files with weak scoping and filename controls.

Install only in the intended DingTalk/Jinshi environment after confirming mcporter is trusted, the connected table may be archived locally, and the bundled project data is acceptable. Before enabling automation, narrow the triggers, add explicit permissions and retention controls, and fix filename generation with allowlisted item types, validated record IDs, and a resolved-path check under the docs directory.

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
archive_checker.py:120
Finding

Path Traversal Through Unsanitized Filename Components

Content
View full analysis
:"/\\|?*]', '', title)[:30] timestamp = datetime.now().strftime('%Y%m%d') return f"{item_type}_{safe_title}_{record_id}_{timestamp}.md" ``` ```python cells = record.get('cells', {}) item_type = get_cell_value(cells, "XVSa9uv") if not item_type: print(f" [跳过] {record_id} 无事项类型") continue print(f" [处理] {item_type}: {record_id}") # 根据类型生成文档 if item_type == "问题": doc_content, title = generate_problem_report(cells, record_id) elif item_type == "需求": doc_content, title = generate_requirement_doc(cells, record_id) elif item_type == "任务": doc_content, title = generate_task_summary(cells, record_id) else: doc_content, title = generate_problem_report(cells, record_id) # 保存文档 filename = generate_doc_filename(item_type, title, record_id) filepath = os.path.join(DOCS_DIR, filename) with open(filepath, 'w', encoding='utf-8') as f: f.write(doc_content) ``` ### Technical Analysis The filename generator sanitizes only `title`. The `item_type` and `record_id` values are incorporated into the filename without validation. In particular, path separators, absolute paths, and traversal sequences remain permitted in `item_type`. The processing logic accepts any nonempty item type. Unknown values fall through to `generate_problem_report`, so an unexpected item type is not rejected before it reaches the filesystem sink. When a filename beginning with `/` is passed to `os.path.join`, the intended `DOCS_DIR` prefix is discarded. Relative components such as `../` can likewise cause the resolved path to escape the documentation directory. The script then opens the resulting path in write mode, ...[truncated 2218 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (11)

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The documented behavior claims continuous monitoring and automatic archiving of DingTalk items, but the finding indicates the implementation only performs a one-time check and marks items locally rather than writing archive status back to the source table. This mismatch is dangerous because operators may rely on the skill for workflow completion, auditability, or record integrity when in fact upstream records remain unchanged and processing state is tracked only in a local file.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding

The skill advertises shell execution and local file read/write behavior via its documented usage and outputs, but it does not declare any explicit tool scope such as permissions or allowed-tools. This creates an authority mismatch where an agent may invoke broader capabilities than users or platform policy reviewers can easily verify, increasing the risk of unintended file modification or command execution.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger phrases are generic terms such as '归档', '知识库', and '生成文档', which can match many normal conversations unrelated to this specific DingTalk workflow. Overly broad triggers raise the chance of accidental invocation, causing unintended document generation, filesystem writes, or external data access without a clear user intent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill description does not prominently warn users that it can automatically generate and write archive documents on a schedule. Missing disclosure of autonomous write behavior is risky because users and administrators may not realize that local artifacts are being created without per-run approval, which can affect storage, confidentiality, and operational expectations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The script sends base/table IDs, record IDs, and requested fields to an external helper tool to retrieve record data, but gives no user-facing notice that project data will be accessed through that tool. In this skill context, the tool interaction is expected for functionality, but the lack of transparency and trust-boundary documentation can expose sensitive project data to a separate component that may log, relay, or mishandle it.

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

python
try:
        args_json = json.dumps(args_dict)
        cmd = ['mcporter', 'call', 'dingtalk-ai-table', 'query_records', '--args', args_json, '--output', 'json']
        result = subprocess.run(cmd, capture_output=True, text=True, encoding='utf-8', errors='replace', timeout=30)
        if result.returncode == 0 and result.stdout:
            return json.loads(result.stdout)
    except:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The script persists project-derived content and metadata to local files under docs/ and archived-items.json automatically, without any consent, disclosure, retention control, or access restriction. In a knowledge-base/archive skill, this increases the chance of unintentionally storing sensitive business data, personal data, or internal incident details on disk where other local users, backups, or tools may access it.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The skill metadata description is written as a fixed Chinese-only instruction and presents the skill as operating in that locale without any opt-in or alternative language behavior. Under the stated policy, forcing a specific language without user choice can be a natural-language policy violation unless 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
83% confidence
Finding

The description and author metadata are written only in Chinese, which indicates a language-specific presentation without any visible opt-in, alternative locale, or justification in this file. Under the policy rule, natural-language content that effectively constrains language without user choice can be a locale-policy issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The module title and behavior description are entirely in Chinese, and the script's user-facing console messages and generated document templates are also Chinese-only. There is no indication that the skill is region-specific or that users can opt into another language, which may violate language/locale choice policy.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

This manifest-like JSON includes multiple natural-language fields such as titles and filenames that are fixed to Chinese. Because the file provides no opt-in, language selection, or documented region-specific justification, it may violate the policy against forcing a specific language or locale.

Content

No source excerpt is available for this finding.