Back to skill

Security audit

Source To Architecture

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its diagram-generation purpose, but its installer and workflow can make broad local changes without clear opt-in or safeguards.

Install only after reviewing the installer commands. Prefer running this in a disposable or containerized environment, avoid sudo/global installs where possible, back up any existing Dockerfile, and explicitly limit which project directories are scanned before allowing Git hooks or scheduled synchronization.

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)

T08 · Insecure Dependencies

Error
Location
scripts/install-tools.sh:22
Finding

Unpinned and Unverified Dependencies Installed with Elevated or Global Privileges

Content
View full analysis
/dev/null; then sudo apt-get update && sudo apt-get install -y ripgrep elif command -v yum &> /dev/null; then sudo yum install -y ripgrep elif command -v brew &> /dev/null; then brew install ripgrep else echo "⚠️ Cannot automatically install ripgrep. Please install it manually." fi # 安装 tree (用于目录结构) echo "🌳 Installing tree..." if command -v apt-get &> /dev/null; then sudo apt-get install -y tree elif command -v yum &> /dev/null; then sudo yum install -y tree elif command -v brew &> /dev/null; then brew install tree else echo "⚠️ Cannot automatically install tree. Please install it manually." fi ``` The generated Dockerfile also contains unpinned and unverified installation operations: ```dockerfile # Install drawio-desktop RUN npm install -g drawio-desktop # Install ripgrep RUN apt-get update && apt-get install -y wget && \ wget https://github.com/BurntSushi/ripgrep/releases/download/13.0.0/ripgrep_13.0.0_amd64.deb && \ dpkg -i ripgrep_13.0.0_amd64.deb && \ rm ripgrep_13.0.0_amd64.deb ``` ### Technical Analysis The installer retrieves `drawio-desktop` without specifying an exact version or validating package integrity. Consequently, the effective package contents can change after the Skill has been audited. npm packages may execute lifecycle scripts during installation, so a compromised package, registry account, or dependency could execute arbitrary commands under the privileges available to the global npm installation. The script also inst ...[truncated 1886 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/drawio-generator.py:199
Finding

XML Injection in Generated DrawIO Documents

Content
View full analysis
""" ``` Connection labels and identifiers are also interpolated without XML encoding: ```python if label: return f""" """ ``` ### Technical Analysis The generator loads component data from a caller-supplied JSON file. Values such as `name`, `tech`, and derived identifiers are inserted into XML attributes through string interpolation without XML escaping. An attacker can include characters such as quotation marks, angle brackets, or ampersands in a component field. A quotation mark can terminate the intended attribute, after which attacker-controlled XML attributes or elements can be introduced. Even when a payload does not produce valid injected elements, it can corrupt the document and cause denial of service during parsing. The vulnerability is not limited to visible labels. The component name is transformed only by replacing spaces and lowercasing it, which does not make it safe as an XML attribute value or a unique DrawIO identifier. Duplicate or crafted identifiers may also alter edge references and document structure. ### Attack Path 1. An attacker creates or modifies an analysis JSON file containing a crafted component `name` or `tech` value. 2. A victim runs `drawio- ...[truncated 1161 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
scripts/install-tools.sh:58
Finding

Installer Unconditionally Overwrites the Current Directory's Dockerfile

Content
View full analysis
Dockerfile << 'EOF' FROM python:3.9-slim # Install system dependencies RUN apt-get update && apt-get install -y \ nodejs \ npm \ tree \ && rm -rf /var/lib/apt/lists/* # Install drawio-desktop RUN npm install -g drawio-desktop # Install ripgrep RUN apt-get update && apt-get install -y wget && \ wget https://github.com/BurntSushi/ripgrep/releases/download/13.0.0/ripgrep_13.0.0_amd64.deb && \ dpkg -i ripgrep_13.0.0_amd64.deb && \ rm ripgrep_13.0.0_amd64.deb # Set working directory WORKDIR /workspace # Copy scripts COPY scripts/ /workspace/scripts/ # Make scripts executable RUN chmod +x /workspace/scripts/*.py CMD ["bash"] EOF ``` ### Technical Analysis The redirection operator `>` creates or truncates `Dockerfile` in the process's current working directory. The installer does not first determine its own directory, check whether the destination already exists, request confirmation, or create a backup. Although the comment describes Docker support as optional, Dockerfile creation occurs unconditionally whenever the installer reaches this section. The affected location depends on the directory from which the user invokes the script, rather than a destination explicitly scoped to the Skill. ### Attack Path 1. A user enters a project directory containing an existing `Dockerfile`. 2. The user invokes `scripts/install-tools.sh` from that directory. 3. The shell evaluates `cat > Dockerfile`. 4. The existing Dockerfile is immediately truncated and replaced with the Skill's template. 5. Subsequent local or CI/CD builds use the replacement configuration, or fail because the original build instructions have been lost. ### Impact Assessment The issue permits destructive modification of one file writable by the invoking user: `Dock ...[truncated 392 chars]
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (24)

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · scripts/install-tools.sh (reported line 35)May include surrounding context.

sh
# 安装 ripgrep (用于代码搜索)
echo "🔍 Installing ripgrep..."
if command -v apt-get &> /dev/null; then
    sudo apt-get update && sudo apt-get install -y ripgrep
elif command -v yum &> /dev/null; then
    sudo yum install -y ripgrep
elif command -v brew &> /dev/null; then

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The title and overall documentation present the skill in Chinese and do not indicate that users can choose another language or locale. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly justified.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding

Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill explicitly instructs scanning project directories and source code but does not warn users that proprietary code, secrets in files, internal paths, or metadata may be exposed to the agent or included in generated outputs. In this context, the omission is security-relevant because architecture extraction inherently traverses potentially sensitive repository content and can surface more information than users expect.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The workflow states that the skill can set up Git hooks and periodic synchronization, but it does not warn that this may modify repository configuration or affect developer workflows. That is dangerous because users may invoke what appears to be a documentation/diagramming skill without realizing it can persist changes and automation inside the repo.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The package description is written entirely in Chinese and presents the skill as a Chinese-language experience without offering any language choice or documenting a region-specific constraint. This creates a natural-language locale policy issue because it implicitly enforces a specific language for users who may not have opted into that locale.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script's user-facing comments and status messages are predominantly in Chinese, including installation guidance and success output. This imposes a specific language on users without opt-in, which matches the language/locale policy violation criteria for natural-language content.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/install-tools.sh (reported line 35)May include surrounding context.

sh
# 安装 ripgrep (用于代码搜索)
echo "🔍 Installing ripgrep..."
if command -v apt-get &> /dev/null; then
    sudo apt-get update && sudo apt-get install -y ripgrep
elif command -v yum &> /dev/null; then
    sudo yum install -y ripgrep
elif command -v brew &> /dev/null; then

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/install-tools.sh (reported line 37)May include surrounding context.

sh
# 安装 ripgrep (用于代码搜索)
echo "🔍 Installing ripgrep..."
if command -v apt-get &> /dev/null; then
    sudo apt-get update && sudo apt-get install -y ripgrep
elif command -v yum &> /dev/null; then
    sudo yum install -y ripgrep
elif command -v brew &> /dev/null; then

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/install-tools.sh (reported line 47)May include surrounding context.

sh
# 安装 ripgrep (用于代码搜索)
echo "🔍 Installing ripgrep..."
if command -v apt-get &> /dev/null; then
    sudo apt-get update && sudo apt-get install -y ripgrep
elif command -v yum &> /dev/null; then
    sudo yum install -y ripgrep
elif command -v brew &> /dev/null; then

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/install-tools.sh (reported line 49)May include surrounding context.

sh
# 安装 ripgrep (用于代码搜索)
echo "🔍 Installing ripgrep..."
if command -v apt-get &> /dev/null; then
    sudo apt-get update && sudo apt-get install -y ripgrep
elif command -v yum &> /dev/null; then
    sudo yum install -y ripgrep
elif command -v brew &> /dev/null; then

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/install-tools.sh (reported line 59)May include surrounding context.

sh
# 安装 ripgrep (用于代码搜索)
echo "🔍 Installing ripgrep..."
if command -v apt-get &> /dev/null; then
    sudo apt-get update && sudo apt-get install -y ripgrep
elif command -v yum &> /dev/null; then
    sudo yum install -y ripgrep
elif command -v brew &> /dev/null; then

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/install-tools.sh (reported line 61)May include surrounding context.

sh
# 安装 ripgrep (用于代码搜索)
echo "🔍 Installing ripgrep..."
if command -v apt-get &> /dev/null; then
    sudo apt-get update && sudo apt-get install -y ripgrep
elif command -v yum &> /dev/null; then
    sudo yum install -y ripgrep
elif command -v brew &> /dev/null; then

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The module docstring says the tool extracts code structure, dependencies, and call chains, and the result structure even includes a call_chains field. However, no function computes call chains and that field is never populated anywhere in the code, so the documentation overstates what the skill actually does.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This Python file contains user-facing documentation, comments, status messages, and usage/help text in Chinese, with no indication that other languages are supported. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy violation.

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 · scripts/source-analyzer.py (reported line 25)May include surrounding context.

python
"""分析代码目录结构和文件依赖"""
        # 使用 tree 命令获取目录结构
        try:
            result = subprocess.run(['tree', '-J', self.project_path], 
                                  capture_output=True, text=True, check=True)
            tree_data = json.loads(result.stdout)
            self.analysis_result['code_structure'] = tree_data

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 · scripts/source-analyzer.py (reported line 69)May include surrounding context.

python
# Python imports
        try:
            py_result = subprocess.run([
                'rg', '--type', 'python', '--json', 
                r'(?:import|from)\s+([a-zA-Z_][a-zA-Z0-9_.]*)'
            ], cwd=self.project_path, capture_output=True, text=True)

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

The entire skill description and examples are presented in Chinese, with no indication that users may choose another language or locale. Under SQP-3, forcing a specific language without opt-in can be a natural-language policy issue unless the locale restriction is explicitly documented and justified.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The inline comment and echo text describe Graphviz as optional, which implies it is not required or automatically applied. However, the code immediately proceeds to install graphviz via apt, yum, or brew without prompting the user, creating a direct intent/documentation mismatch.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
98% confidence
Finding

The comment labels Dockerfile creation as optional, but the script unconditionally overwrites or creates a Dockerfile using a here-document. This is an active contradiction between the documented intent and the actual behavior, and it also introduces an unexpected filesystem side effect.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

Low
Category
Tool Misuse
Confidence
15% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/install-tools.sh (reported line 75)May include surrounding context.

sh
nodejs \
    npm \
    tree \
    && rm -rf /var/lib/apt/lists/*

# Install drawio-desktop
RUN npm install -g drawio-desktop

Tool Parameter Abuse

Low
Category
Tool Misuse
Confidence
15% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · scripts/install-tools.sh (reported line 75)May include surrounding context.

sh
nodejs \
    npm \
    tree \
    && rm -rf /var/lib/apt/lists/*

# Install drawio-desktop
RUN npm install -g drawio-desktop

Chaining Abuse

Low
Category
Tool Misuse
Confidence
15% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · scripts/install-tools.sh (reported line 75)May include surrounding context.

sh
nodejs \
    npm \
    tree \
    && rm -rf /var/lib/apt/lists/*

# Install drawio-desktop
RUN npm install -g drawio-desktop

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The analyze_dependencies docstring broadly states it analyzes inter-file dependencies, but the implementation only runs a ripgrep pattern for Python import/from statements. This is a narrower behavior than the documentation suggests, especially in a source analyzer that scans multiple language file types elsewhere.

Content

No source excerpt is available for this finding.