Back to skill

Security audit

Visual Architecture Clawhub V180

Security checks for vulnerabilities and agentic risk

Overview

The skill is local and mostly coherent, but generated HTML/SVG artifacts can run injected browser scripts if diagram JSON is untrusted.

Review or fix the HTML/SVG escaping before installing for workflows that consume untrusted specs or publish generated galleries. Use it only on trusted local JSON, review generated artifacts for private paths or repo details before sharing, and avoid opening or deploying generated HTML/SVG from unreviewed contributions.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/render_architecture.py:1446
Finding

Stored Script Injection Through Unescaped SVG Attributes

Content
View full analysis
' return f''' ``` The same unsafe attribute-encoding pattern is used for node identifiers: ```python shape_group = f'\n' + "\n".join(shape_parts) + "\n" ``` It also affects share-card SVG titles: ```python title = escape(data.get("title", "visual-architecture")) ... return f''' ``` ### Technical Analysis `xml.sax.saxutils.escape()` escapes XML text characters such as `&`, `<`, and `>`, but it does not escape quotation marks unless an additional entity mapping is explicitly supplied. The escaped value is inserted into a double-quoted XML attribute. An attacker-controlled title containing a double quote can therefore terminate the `aria-label` value and introduce additional SVG attributes. For example: ```json { "title": "x\" onload=\"alert(document.domain)" } ...[truncated 1866 chars]
Remediation
View remediation
' ``` Apply the same treatment to every value placed in an XML or HTML attribute: ```python node_id_attr = quoteattr(str(node.get("id", ""))) shape_group = f'...' ``` Additional hardening should include: 1. Audit all generated HTML and SVG attributes and distinguish text-content encoding from attribute encoding. 2. Continue using `escape()` for XML text nodes, but use `quoteattr()` for XML attributes. 3. Add regression tests using double quotes, single quotes, ampersands, angle brackets, and event-handler payloads. 4. Test both standalone SVG output and SVG embedded by `render_html()`. 5. Consider a restrictive Content Security Policy for generated HTML as defense in depth, while recognizing that CSP does not replace correct output encoding. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/render_architecture.py:1775
Finding

Stored Cross-Site Scripting Through Inline Gallery JSON

Content
View full analysis
const artifacts = {gallery_payload}; const featuredTitles = new Set({json.dumps(sorted(featured_names))}); ``` ### Technical Analysis `json.dumps()` produces valid JSON and JavaScript string literals, but it does not make the result safe for direct inclusion in an HTML `` even when it appears inside a JavaScript string. An attacker can place a payload in an example specification field such as `title`, `summary`, or a story value: ```json { "title": "" } ``` When the gallery is generated, the first `` closes the intended script element. The remaining attacker-controlled text is parsed as active HTML and JavaScript. The gallery’s later use of `textContent` does not mitigate this issue because the payload executes during initial HTML parsing, before the JavaScript-driven DOM rendering occur ...[truncated 1495 chars]
Remediation
View remediation
", "\\u003e") .replace("&", "\\u0026") .replace("\u2028", "\\u2028") .replace("\u2029", "\\u2029") ) ``` Use the helper consistently: ```python gallery_payload = script_json(payload) featured_payload = script_json(sorted(featured_names)) ``` A preferable design is to avoid interpolating data into executable JavaScript: ```html ``` The JSON content must still encode `<` as `\u003c` because HTML parsing recognizes `` regardless of the script element’s MIME type. Additional hardening should include: 1. Move gallery behavior into an external JavaScript file. 2. Apply a Content Security Policy that disallows inline script execution. 3. Add regression tests containing ``, ``, HTML tags, and Unicode line separators. 4. Generate galleries from reviewed or explicitly trusted specifications where practical. 5. Verify the final generated HTML with a browser-based test that confirms injected marker code cannot execute. ]]>
Vulnerability Patterns
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (14)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% 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 · Makefile (reported line 13)May include surrounding context.

text
python3 -m json.tool "$$spec" >/dev/null; \
		python3 scripts/render_architecture.py validate "$$spec" --json >/dev/null; \
	done
	rm -rf /tmp/visual-architecture-validate
	mkdir -p /tmp/visual-architecture-validate
	@for spec in $$(find examples -maxdepth 1 -name '*.json' ! -name '*.receipt.json' | sort); do \
		name=$$(basename "$$spec" .json); \

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
90% 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 · Makefile (reported line 13)May include surrounding context.

text
python3 -m json.tool "$$spec" >/dev/null; \
		python3 scripts/render_architecture.py validate "$$spec" --json >/dev/null; \
	done
	rm -rf /tmp/visual-architecture-validate
	mkdir -p /tmp/visual-architecture-validate
	@for spec in $$(find examples -maxdepth 1 -name '*.json' ! -name '*.receipt.json' | sort); do \
		name=$$(basename "$$spec" .json); \

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill instructs the agent to run local shell commands, read repository contents, and write output artifacts, but it declares no explicit tool scope or permission boundaries. That mismatch is dangerous because an agent may execute broader-than-necessary filesystem, shell, or potential network-capable actions without clear policy constraints, increasing the chance of unintended command execution, repository overreach, or data exposure.

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/render_architecture.py (reported line 876)May include surrounding context.

python
command = ["git", "diff", "--name-status", base]
    else:
        command = ["git", "diff", "--name-status", f"{base}..{head}"]
    result = subprocess.run(command, text=True, capture_output=True, check=False)
    if result.returncode != 0:
        return []
    changes = []

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The Makefile executes rm -rf /tmp/visual-architecture-validate, which is a destructive file deletion operation. In this file there is no confirmation prompt, user-facing log message, or comment/docstring disclosing that cleanup will remove that directory before validation runs.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
67% confidence
Finding

The extract-repo . command processes the current repository and writes extracted data, which implies access to local project contents. This Makefile line provides no user-facing warning, comment, or explanatory text about scanning repository data during validation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
66% confidence
Finding

The extract-pr --base origin/master --head HEAD command inspects pull-request or git diff context and outputs extracted data. There is no visible prompt, log statement, or inline documentation warning users that validation reads repository history and branch comparison data.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

This JSON manifest describes an agent workflow as a general-purpose 'Agent Runtime Proof Loop' that turns 'a task brief into a checked artifact,' but it does not specify when this skill should or should not be invoked. In a manifest file, such broad, generic phrasing can create ambiguous trigger scope because there are no explicit activation constraints or negative examples.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

This is a JSON manifest file, so vague-trigger review applies. The phrase "The tool writes SVG, HTML, share card, and receipt as one reviewable unit" describes behavior broadly but does not clarify under what specific conditions this workflow should be invoked or what inputs qualify, which could contribute to overly broad activation in systems that derive triggers from manifest text.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

The manifest describes deterministic, local-first creation of architecture artifacts, including validation, SVG/HTML rendering, and source-backed receipts. This SVG showcases an additional publication-oriented flow via the 'publish' label and 'README Proof' with 'Gallery and share cards', which suggests broader outward distribution behavior not mentioned in the stated scope.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

This JSON file appears to describe a skill artifact or case study, but it provides only high-level metadata such as mode, theme, title, and summary. It does not define when this skill should activate, what exact trigger phrases apply, or any exclusion conditions, which could lead to ambiguous invocation behavior if used as a manifest-like descriptor.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

This manifest-style JSON describes the skill at a high level with a generic summary and title, but it provides no explicit activation phrases, scope limits, or negative examples indicating when the skill should or should not be invoked. For manifest files, this can make invocation conditions overly broad or ambiguous if downstream systems use these fields for routing.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

This code emits HTML documents with lang="en", which forces an English locale in generated artifacts. The file does not offer any user-selectable language/locale option or document that the output is intentionally English-only for a justified regional purpose.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

The gallery generator outputs an HTML page with lang="en", imposing a specific locale on all generated gallery pages. There is no visible mechanism for user opt-in or locale selection, so this conflicts with the language/locale policy criteria.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.