Back to skill

Security audit

architecture

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a coherent architecture-documentation router, but it can discover and execute an optional diagram skill from broad local paths, including a repository-local path that could be controlled by the project being analyzed.

Review before installing. Use it only in an agent/runtime that prevents repository-local skills from being treated as trusted instructions, or manually approve the resolved archify path before any Node command runs. Be especially careful when analyzing untrusted repositories that contain ./.agents/skills/archify. There is no evidence of intentional exfiltration or destructive behavior in the inspected artifact, but the delegated-skill discovery is too broad to treat as benign by default.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (1)

T01 · Skill Instruction Hijacking

Error
Location
SKILL.md:113
Finding

Repository-local skill discovery can delegate execution to attacker-controlled instructions

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:113-117, 130-146
Vulnerability Type: Untrusted agent-skill delegation
Risk Level: High

Vulnerable Code

bash
for d in ./.agents/skills ~/.agents/skills ~/.claude/skills ~/.devin/skills \
         ~/.config/devin/skills ~/.opencode/skills ~/.config/opencode/skills \
         ~/.cursor/skills ~/.copilot/skills ~/.gemini/skills ~/.codex/skills \
         ~/.codeium/windsurf/skills; do
  [ -f "$d/archify/SKILL.md" ] && echo "FOUND: $d/archify"
done
text
Analyze this repository, then use archify to create a high-level runtime architecture diagram.
Show 8–12 core components, one primary path, external dependencies, and trust boundaries.
Put supporting detail in cards instead of adding more edges.
bash
node <archify-skill-path>/bin/archify.mjs validate architecture docs/architecture/runtime-architecture.json --quality showcase --json
node <archify-skill-path>/bin/archify.mjs deliver  architecture docs/architecture/runtime-architecture.json docs/architecture/runtime-architecture.html --quality showcase --json

The corresponding helper implements the same repository-local discovery behavior:

bash
SKILL_ROOTS="${SKILL_ROOTS:-./.agents/skills $HOME/.agents/skills $HOME/.claude/skills $HOME/.devin/skills $HOME/.config/devin/skills $HOME/.opencode/skills $HOME/.config/opencode/skills $HOME/.cursor/skills $HOME/.copilot/skills $HOME/.gemini/skills $HOME/.codex/skills $HOME/.codeium/windsurf/skills}"

find_skill() {
  local root
  for root in $SKILL_ROOTS; do
    [ -f "$root/$1/SKILL.md" ] && echo "$root/$1"
  done
  return 0
}

Technical Analysis

The skill considers ./.agents/skills/archify/SKILL.md sufficient evidence that Archify is installed and then instructs the agent to invoke and follow that skill's authoring flow. The relative path is inside the repository being analyzed, so a repository author or contributor can provide its contents.

No provenance check, truste ...[truncated 2152 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove repository-local locations such as ./.agents/skills from automatic delegated-skill discovery.
  2. Only delegate to skills registered by the agent runtime or installed in administrator-controlled directories outside the target repository.
  3. Resolve discovered paths to canonical absolute paths and verify that they remain beneath an explicit allowlist of trusted skill roots.
  4. Verify the delegated skill's approved identity and version before loading its instructions or executing its scripts.
  5. Require explicit user confirmation that displays the resolved skill path before invoking any skill found outside the trusted registry.
  6. Keep repository files as untrusted data: do not interpret a repository-provided SKILL.md as agent instructions merely because it has the expected name.
  7. If repository-local extensions are an intentional feature, run them in a restricted sandbox with no secrets, limited filesystem access, disabled network access by default, and a narrowly scoped output directory.
  8. Apply the same trust validation in both SKILL.md and scripts/architecture-doctor.sh so the helper cannot advertise an untrusted repository-local skill as installed.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
Findings (12)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The instruction mandates that all questions and confirmations to the user must be in Portuguese, which is a natural-language locale constraint. Under the policy, forcing a specific language without user opt-in is a violation unless the constraint is explicitly optional or justified as region-specific.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

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

md
0. **Preflight** (optional but recommended): run `scripts/architecture-doctor.sh` for a read-only inventory of `docs/architecture/`, the next free ADR number, engine availability (`mmdc`, `drawio` CLI), and delegated-skill detection (`mermaid-architecture`, `drawio-architecture`, `gap-analysis`, `archify`).
1. **Classify the request**: ADR, design doc, Markdown diagram, editable diagram, or interactive HTML. Multiple deliverables may apply.
2. **ADRs**: check the highest existing `AD-NNNN` number, then write the next one with the template below.
3. **Design docs**: populate the matching template from `mermaid-architecture/assets/` into `docs/architecture/`.
4. **Diagrams**: route per the table. For code-grounded diagrams, extract evidence first (entry points, DI graph, `docker-compose.yml`, Helm/Terraform, CI files).
5. **Verify**: run each engine's validation step; fix and re-run until green.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill directs the agent to inspect multiple user-home skill directories outside the repository to detect whether an optional dependency is installed. This expands access beyond the project boundary and can leak information about the user's tooling, environment layout, and other installed agent capabilities that are unrelated to the task.

Content

No source excerpt is available for this finding.

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
95% confidence
Finding

The command explicitly enumerates multiple skill directories across the user's home/config locations. Capability and installation enumeration can disclose sensitive environment details and form a reconnaissance primitive for later abuse, especially in shared or privileged agent environments.

Content

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

Check whether the archify skill is already installed in any known skills root:

bash
for d in ./.agents/skills ~/.agents/skills ~/.claude/skills ~/.devin/skills \
         ~/.config/devin/skills ~/.opencode/skills ~/.config/opencode/skills \
         ~/.cursor/skills ~/.copilot/skills ~/.gemini/skills ~/.codex/skills \
         ~/.codeium/windsurf/skills; do

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
95% confidence
Finding

This line continues enumeration of additional assistant-specific skill directories, further widening host reconnaissance. The more locations probed, the more metadata the agent can learn about installed tools, platforms, and user habits outside the repository scope.

Content

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

bash
for d in ./.agents/skills ~/.agents/skills ~/.claude/skills ~/.devin/skills \
         ~/.config/devin/skills ~/.opencode/skills ~/.config/opencode/skills \
         ~/.cursor/skills ~/.copilot/skills ~/.gemini/skills ~/.codex/skills \
         ~/.codeium/windsurf/skills; do
  [ -f "$d/archify/SKILL.md" ] && echo "FOUND: $d/archify"
done

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill instructs execution of an external Node-based CLI from a discovered path, which creates a trust boundary issue because the binary/script may be user-installed, unreviewed, or replaced. Even though the text says not to install at runtime, invoking a locally discovered third-party tool still enables code execution outside the repository's controlled contents.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The file states that gap-analysis remains read-only until the user answers its 'pt-BR gate', and includes the approval prompt only in Portuguese. This imposes a specific language on the user interaction without any opt-in or alternative, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The header claims the script is read-only and 'Writes nothing,' but its guidance encourages a later runtime action that can fetch and execute external code via npx. That mismatch can mislead operators and agents into trusting the skill as non-executing when it effectively promotes behavior that expands the attack surface.

Content

No source excerpt is available for this finding.

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
85% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

Scanner excerpt · scripts/architecture-doctor.sh (reported line 16)May include surrounding context.

sh
# Skills roots scanned for delegated/third-party skills. Extend with
# SKILL_ROOTS env var if your runtime installs elsewhere.
SKILL_ROOTS="${SKILL_ROOTS:-./.agents/skills $HOME/.agents/skills $HOME/.claude/skills $HOME/.devin/skills $HOME/.config/devin/skills $HOME/.opencode/skills $HOME/.config/opencode/skills $HOME/.cursor/skills $HOME/.copilot/skills $HOME/.gemini/skills $HOME/.codex/skills $HOME/.codeium/windsurf/skills}"

find_skill() {
  local root

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill metadata says optional engines are never installed at runtime, but the routing hint suggests 'npx -y @mermaid-js/mermaid-cli', which can fetch and run the package on demand. This contradiction is dangerous because agents may rely on the manifest's safety expectations while being nudged toward unreviewed runtime package execution.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
92% confidence
Finding

The script recommends the fallback command 'npx -y @mermaid-js/mermaid-cli', which executes an unpinned package from the registry. If an agent follows this guidance, it may run a compromised or unexpected package version, creating a supply-chain execution risk despite the script itself being otherwise read-only.

Content

No source excerpt is available for this finding.