Back to skill

Security audit

4+1架构视图自动生成器

Security checks for vulnerabilities and agentic risk

Overview

The skill’s main architecture-documentation purpose is coherent, but it needs review because it can send source-derived diagrams to public Mermaid services and persist architecture metadata in a hidden cache.

Review before installing on private or regulated codebases. Use only with explicit acceptance that generated architecture diagrams may be sent to Mermaid public services, avoid the unpinned npx fallback unless the package version is pinned or preinstalled, and clear or disable .claude/arc4plus1-cache/ if retained architecture metadata is sensitive.

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

other

Warning
Location
SKILL.md:546
Finding

Remote Disclosure of Source-Derived Architecture Data

Content
View full analysis
or https://mermaid.live/api/v1/syntax/parse ``` The instructions require generated Mermaid blocks to be submitted to one of these public services for rendering or syntax validation. ### Technical Analysis The generated Mermaid content is derived from the project selected by the user. Depending on the analyzed project, it can contain: - Internal class and method names - API routes and entry points - Service and module relationships - Database and deployment topology - External dependency names - Runtime call chains - Internal filenames and component identifiers Base64 encoding provides no confidentiality. When the encoded diagram is placed in a URL, the data can additionally appear in web server logs, proxy logs, gateway telemetry, browser or request histories, and monitoring systems. The public `README.md` describes Mermaid validation requirements but does not clearly disclose that source-derived information may be transmitted to public third-party infrastructure. ### Attack Path 1. A user invokes the Skill against a private or proprietary source project. 2. The Skill extracts classes, functions, routes, dependencies, and deployment details. 3. The extracted information is embedded in generated Mermaid diagrams. 4. The diagrams are Base64-encoded or otherwise submitted through `WebFetch`. 5. A request is sent to `mermaid.ink` or `mermaid.live`. 6. The third-party service and intervening network infrastructure receive source-derived architecture data. 7. If URLs are logged, the encoded data may remain accessible through operational logs after validation completes. No active attacker is required for the initial disclosure. An attacker who gains access to third-party or intermediary logs could decode ...[truncated 569 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
--output <output> ``` ### Technical Analysis The fallback command asks `npx` to obtain and execute `@mermaid-js/mermaid-cli` without specifying an exact version or integrity digest. Consequently, the code executed by the Skill can change after the Skill itself has been reviewed. The command can retrieve the package and its transitive dependencies from the configured npm registry. Package installation or execution may run package-provided JavaScript and associated lifecycle behavior with the permissions o ...[truncated 1865 chars]:560
Finding

Unpinned Mermaid CLI Package Is Downloaded and Executed at Runtime

Content
View full analysis
--output ``` ### Technical Analysis The fallback command asks `npx` to obtain and execute `@mermaid-js/mermaid-cli` without specifying an exact version or integrity digest. Consequently, the code executed by the Skill can change after the Skill itself has been reviewed. The command can retrieve the package and its transitive dependencies from the configured npm registry. Package installation or execution may run package-provided JavaScript and associated lifecycle behavior with the permissions of the Agent process. This creates a supply-chain trust boundary that is not represented by the audited project files. A compromised maintainer account, registry compromise, malicious future release, altered registry configuration, or compromised transitive dependency could cause arbitrary package code to run locally. ### Attack Path 1. Remote Mermaid validation is unavailable or the Skill selects its local CLI fallback. 2. The Agent executes the documented `npx` command. 3. `npx` resolves the latest package version allowed by the unversioned specification. 4. The package and its transitive dependencies are downloaded from the configured npm registry. 5. Package-controlled code executes with the operating-system permissions of the Agent process. 6. If the resolved package or dependency is malicious, it can access files and network resources available to that process. Exploitation depends on compromise or malicious modification of the package source, registry, registry configuration, or dependency tree. The audited repository itself does not contain an embedded malicious payload. ### Impact Assessment A compromised dependency could execute arbitrary code under the Agent's existing user account. Potential a ...[truncated 536 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
SKILL.md:616
Finding

Persistent Cache Stores Sensitive Source-Derived Models Without Lifecycle or Integrity Controls

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (17)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明的核心能力是“自动生成软件架构 4+1 视图文档”,而代码并未实现任何架构分析、视图生成、目录遍历工程建模或 README 产出逻辑。相反,该脚本的唯一明确职责是对 Markdown 文件中的 Mermaid 代码块进行扫描和修复,属于 Mermaid 语法门禁/清洗工具。虽然这可能是某个更大架构生成流程的辅助组件,但就所给代码块本身而言,其实际主用途与声明的技能目的存在实质性偏离,且还包含未声明的文件原地修改能力,因此应判定为描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明描述的是一个面向最终用户的“软件架构4+1视图自动生成器”,核心能力应包括解析代码库、提取架构信息并输出五类架构视图和 README。实际代码则只是 tests/basic_check.py,一个测试/校验脚本:检查 SKILL.md、README.md、scripts/find_blocks.py 是否存在,验证 SKILL.md 中是否含有基本 frontmatter 字段,并尝试导入 find_blocks.py。该代码既没有分析工程结构,也没有生成任何视图或文档。其主要目的与声明的用户功能明显不一致,因此属于显著描述-行为不匹配。

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill allows WebFetch to send Mermaid content to external services without a clear privacy or exfiltration warning. Because those diagrams are derived from source code and infrastructure analysis, they may expose confidential architecture details to third parties without informed consent.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill is presented as a local code-analysis/document-generation tool, but it also requires remote Mermaid validation via WebFetch. That mismatch matters because users may provide proprietary code expecting local-only handling, while the skill's workflow can transmit derived content externally.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

这是一个 markdown 技能说明文件,适用 SQP-1。该行虽然列出了一组示例触发词,但以“或类似表达时触发此技能”收尾,没有给出明确的边界、排除条件或负例,导致哪些表达会触发并不清晰,容易与一般性的架构讨论语句重叠。

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
79% confidence
Finding

SQP-3 适用于所有文件类型。该技能说明从名称、描述到输出示例均默认要求中文表达,且未见提供用户可选语言或基于用户语言自动适配的说明;这可能与要求尊重用户语言偏好的组织策略相冲突。

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill writes arcview/ output and a hidden cache directory into the user's workspace, but this side effect is not clearly disclosed up front. Hidden or under-disclosed filesystem modification increases the risk of surprising users, contaminating repositories, or storing sensitive metadata in places they do not expect.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

Step (1) states Mermaid is generated only in memory and step (4) says writing happens afterward, but step (3) instructs running python scripts/find_blocks.py fix <files> before writing. Since fix is defined later as operating on files in place, the documented sequence contradicts itself about whether files exist before the write step.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill mandates external network calls to Mermaid services even though its stated purpose is local architecture generation from local code. Mermaid diagrams derived from source can reveal class names, endpoints, services, infrastructure, and internal topology, creating a confidentiality risk if sent to third-party endpoints.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding

The skill instructs use of npx -p @mermaid-js/mermaid-cli without pinning an exact package version, which allows execution of whatever version is current at runtime. In a security-sensitive workflow, this creates a supply-chain risk and weakens reproducibility, especially because the command may download and execute remote code on the analyst's machine.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Requiring persistent storage of intermediate analysis models in a hidden cache directory retains project-derived data beyond the immediate task. In the context of a code-analysis skill, those retained artifacts can contain sensitive architecture information and increase the blast radius of later compromise or accidental disclosure.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The description is entirely in Chinese and presents the skill purpose in a single fixed language, with no indication that users can choose another language or locale. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README explicitly states that the skill writes generated files into the target project directory, but it does not warn users that invoking the skill will modify their filesystem. This creates a transparency and consent problem: users may run analysis expecting read-only behavior and unintentionally alter repositories, worktrees, or sensitive paths if the target path is wrong.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

Persisting intermediate analysis models under .claude/arc4plus1-cache extends data retention beyond the stated output of arcview/ documents. Those cached models can contain sensitive structural details about a user's codebase and may remain on disk longer than expected, increasing exposure if the workspace is shared or later exfiltrated.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The example output tells users that rerunning the skill will overwrite existing files. Earlier sections define a more restrictive policy: backup before overwrite in some cases, merge warnings in others, and mandatory stop when sensitive files are present, so the example actively misstates actual intended behavior.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

This Python file contains user-facing natural-language strings entirely in Chinese, including the module description and command help text. The skill does not indicate any user opt-in or language selection, so it appears to impose a specific language/locale by default.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

This Python file contains natural-language docstrings and output strings exclusively in Chinese, such as the module description and test status messages. Under the policy rule, forcing a specific language without opt-in or a documented regional justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.dynamic_code_execution

Dynamic code execution detected.

Critical
Code
suspicious.dynamic_code_execution
Location
tests/basic_check.py:41