Back to skill

Security audit

Business Blueprint

Security checks for vulnerabilities and agentic risk

Overview

The skill's purpose is coherent, but its generated HTML/SVG viewers can execute injected browser script from crafted blueprint content.

Install only if you trust the blueprint inputs and generated viewer files. Do not open generated HTML/SVG from untrusted or externally supplied blueprint data until the title/subtitle escaping bugs are fixed; treat solution.patch.jsonl, viewer HTML, and export folders as potentially sensitive business records.

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/business_blueprint/templates/html-viewer.html:191
Finding

Stored JavaScript Injection Through Blueprint Title

Content
View full analysis
const a = document.createElement('a'); a.href = url; a.download = '{{TITLE}}.svg'; ``` The `_esc()` function only applies XML escaping: ```python def _esc(s: str) -> str: return escape(str(s)) ``` ### Technical Analysis The blueprint title is attacker-controlled content. Although `_esc()` encodes XML-sensitive characters such as `<`, `>`, and `&`, it does not escape apostrophes or other characters required for safe insertion into a single-quoted JavaScript string. Consequently, a title such as: ```text ';alert(document.domain);// ``` produces JavaScript equivalent to: ```javascript a.download = '';alert(document.domain);//.svg'; ``` The payload is stored in the generated HTML viewer and executes when the affected JavaScript function is invoked. In the current template, the vulnerable statement is reached when the user selects the “Download SVG” button. The same title is inserted into ordinary HTML locations, but those locations receive XML escaping. The vulnerability specifically results from reusing XML-escaped data in a JavaScript-string context. Blueprint validation does not constrain `meta.title`, and the export command does not automatically reject dangerous title characters. ### Attack Path 1. An attacker supplies requirements, meeting notes, or blueprint data containing a crafted title. 2. The agent records that value in `m ...[truncated 1113 chars]
Remediation
View remediation
';alert(1);// ${expression} ``` 7. Ensure tests open or parse the generated viewer and verify that hostile values remain data rather than executable syntax. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/business_blueprint/export_svg.py:3403
Finding

Stored SVG and HTML Injection Through Unescaped Poster Subtitle

Content
View full analysis
' f'' f'{_esc(title)}{subtitle_line}' f'Layered Blueprint Poster' f'' ) ``` The title is escaped with `_esc(title)`, but `subtitle_line` is appended without XML escaping. The poster route is automatically reachable: ```python # scripts/business_blueprint/export_routes.py:92-96 if route == "poster": return bool(systems) and ( any(s.get("layer") for s in systems) or len(systems) >= 4 ) ``` The generated SVG is embedded directly into the generated HTML: ```python # scripts/business_blueprint/export_html.py svg_content = _build_architecture_svg(blueprint, colors, theme) ... html = html.replace("{{SVG_CONTENT}}", svg_content) ``` ### Technical Analysis `meta.subtitle` is treated as trusted SVG markup even though blueprint content may originate from untrusted requirements or imported JSON. An attacker can terminate the existing `` element and insert arbitrary SVG elements, event handlers, links, or active content. A representative payload is: ```text
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (119)

Self-Modification

High
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · REFACTOR_SUMMARY.md (reported line 183)May include surrounding context.

md
- business_blueprint/specs/ → business_blueprint/renderers/ (Python module)
- business_blueprint/specs/*.md → business_blueprint/docs/ (documentation)
- Update import paths in export_drawio.py, export_excalidraw.py
- Update SKILL.md references to docs/

All tests pass (173 passed, 1 skipped)
"

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description focuses on generating and exporting business blueprints and diagrams from source materials. In contrast, this code does not create diagrams, generate exports, render HTML, or transform presales/meeting content into new blueprints. Its primary purpose is offline schema migration of existing blueprint JSON files from one version to another, including inferred metadata backfill and batch file I/O. That is a materially different function from the declared capability, so this is a description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared purpose describes a content-generation and export skill for business blueprints and architecture/swimlane diagrams. The supplied code does not generate diagrams or transform presales/meeting materials into blueprint artifacts. Instead, it implements QA/testing utilities: scoring predicted intents against ground truth, calculating layer accuracy, comparing SVG structures, estimating migration consistency, producing simplified significance values, and generating a metrics report. While SVG is mentioned in both, the code only analyzes existing SVG outputs for evaluation, which is materially different from creating or exporting them. Therefore the actual behavior does not match the declared primary purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description centers on transforming business inputs into blueprint diagrams and exportable representations. This code chunk does not implement blueprint generation, HTML viewing, or export to SVG/draw.io/Excalidraw/Mermaid. Its primary purpose is QA/testing: loading demo fixtures, invoking IntentResolver and RuleEngine, comparing predictions to manually labeled ground truth, calculating accuracy metrics, checking thresholds, and saving a test report. While this may support the broader blueprint system, the behavior of this specific code chunk is materially different from the declared end-user functionality, so it is a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents a content-generation and export skill for creating business capability blueprints, swimlane flows, and architecture diagrams from source materials. The actual code chunk does not perform generation or export of such artifacts. Instead, it is a QA/testing utility for validating intent resolution and system layer assignment accuracy using fixtures, expected labels, metrics, and threshold checks. This is a materially different primary purpose from the declared behavior. There is no evidence here of transforming user inputs into blueprint JSON/HTML/SVG/draw.io/Excalidraw/Mermaid outputs; instead, the code assesses model/rule accuracy and saves a test report.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The description promises content-to-blueprint/diagram generation and export functionality. This code does not generate business capability blueprints, swimlane flows, application architecture diagrams, HTML viewers, or export formats like SVG/draw.io/Excalidraw/Mermaid. Instead, its primary purpose is offline test evaluation of model/system quality using fixtures, hardcoded truth labels, heuristic satisfaction scoring, and report generation. Writing a JSON report is not the same as generating blueprint JSON for user-facing outputs. This is a materially different purpose, so the description does not accurately represent the behavior of this code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description presents an end-user business diagram/blueprint generation and export capability. The actual code does not process presales requirements, meeting notes, solution materials, blueprint JSON, HTML viewers, or diagram export formats. Instead, it performs regex-based rewriting of Python import statements across a directory of source files. This is a materially different primary purpose and introduces undeclared code-maintenance/file-editing capability unrelated to the described skill behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description presents a content-to-diagram/blueprint generation and export skill. The supplied code chunk does not perform any such business transformation, diagram creation, rendering, or export. It only adjusts Python's module search path for tests by inserting the repository root into sys.path. This is a development/testing support function, not a supporting implementation detail of the described skill behavior in any observable sense from this chunk. Therefore the code and description are materially mismatched.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description centers on converting business inputs into blueprints, flows, architecture diagrams, and export formats like SVG/draw.io/Excalidraw/Mermaid. The actual code chunk does not perform those transformations or exports. Instead, it tests a prompt/audit file generator that writes markdown files with timestamped names and provenance metadata. While this may support a broader blueprint-generation system, the code shown has a materially different immediate purpose: audit-trail prompt file generation and validation. Therefore the description does not accurately represent this code chunk.

Content

No source excerpt is available for this finding.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/business_blueprint/prompt_generator.py (reported line 59)May include surrounding context.

python
encoding="utf-8",
    )

    return prompt_path


def _build_content(

Unvalidated Output Injection

High
Category
Output Handling
Confidence
95% confidence
Finding

Model output is used without validation or sanitization. Unvalidated output injected into downstream contexts (SQL, shell, HTML) enables injection attacks and arbitrary code execution.

Content

Scanner excerpt · scripts/tests/test_generate.py (reported line 21)May include surrounding context.

python
)
    output = tmp_path / "solution.blueprint.json"

    result = subprocess.run(
        [sys.executable, "-m", "business_blueprint.cli",
         "--plan", str(output), "--from", str(source), "--industry", "retail"],
        cwd=ROOT, capture_output=True, text=True,

Unvalidated Output Injection

High
Category
Output Handling
Confidence
95% confidence
Finding

Model output is used without validation or sanitization. Unvalidated output injected into downstream contexts (SQL, shell, HTML) enables injection attacks and arbitrary code execution.

Content

Scanner excerpt · scripts/tests/test_generate.py (reported line 42)May include surrounding context.

python
def test_plan_requires_source_text(tmp_path: Path) -> None:
    """--plan without --from should fail."""
    output = tmp_path / "solution.blueprint.json"
    result = subprocess.run(
        [sys.executable, "-m", "business_blueprint.cli",
         "--plan", str(output), "--industry", "retail"],
        cwd=ROOT, capture_output=True, text=True,

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown file is entirely written in Chinese, including the title and operational descriptions, with no indication that language selection is optional or that the skill is intentionally limited to a Chinese-speaking audience. Under the policy, forcing a specific language without user opt-in is a natural-language locale violation.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
85% confidence
Finding

The README explicitly states that edits are logged to a persistent JSON patch trail (solution.patch.jsonl) for full traceability. Because this skill processes presales requirements, meeting notes, and RFP materials, the patch log may retain sensitive business information, personal data, or proprietary architecture details longer than users expect, increasing exposure if the workspace is shared, synced, or exfiltrated.

Content

Scanner excerpt · README.md (reported line 53)May include surrounding context.

md
### 3. Silicon-Carbon Collaboration

**Input:** Humans write natural language (requirements, meeting notes, RFPs). AI parses into structured entities (Application Systems, Business Capabilities, Process Flows, Actors) and relations.

**Output:** The viewer is a static HTML page — no build step, no JS framework, works offline. Every node is editable in-place, and edits are logged as a JSON patch trail (`solution.patch.jsonl`) for full traceability.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The version history explicitly says 'all user-facing labels in Chinese', which is a natural-language locale constraint. The README does not present this as optional, configurable, or limited to a region-specific deployment, so it appears to force a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill instructs the agent to read and write files and execute Python scripts, but it declares no explicit tool scope or permission boundary. That increases the risk of overbroad file or shell access, especially because the skill also references multiple repository paths and direct subprocess execution patterns.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This JSON file contains the primary source excerpt entirely in Chinese, and the rest of the blueprint also uses Chinese names and titles. For a general-purpose skill artifact, this imposes a specific language/locale without indicating that users can choose another language or that the artifact is intentionally region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

Natural-language fields such as names, descriptions, and titles throughout the blueprint are consistently Chinese-only. Because no language preference, locale metadata, or opt-in mechanism is present, this appears to enforce a specific language policy across the artifact.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file states in Chinese that the agent must strictly follow the design system, and the entire specification is presented only in Chinese with no opt-in or alternative locale guidance. Under the policy, forcing a specific language or locale without user choice is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The template switches into Chinese for section headings and trigger description, implying a fixed language/locale for users consuming or invoking this skill. The file does not offer an English alternative or any user opt-in for language selection, which fits the policy category for forced language without choice.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The activation guidance says the skill applies when the user description contains any of several keywords such as 'Lambda', 'API Gateway', 'DynamoDB', 'Serverless', or '无服务器'. This is broad and lacks constraints or exclusion examples, so ordinary AWS discussions mentioning one keyword could unintentionally trigger the template.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file is entirely written as a normative specification in Chinese, including instruction phrases such as 'AI读取' and extraction guidance, with no indication that other languages are supported or that Chinese is optional. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger rule matches very generic terms like "diagram" and "--export", which can cause the skill to activate in unrelated conversations or CLI contexts. In an agentic system, over-broad routing increases the chance of unintended file generation or execution of architecture-diagram behavior on inputs that were not meant for this skill.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown file contains all user-facing guidance in Chinese, and there is no indication that the skill is region-specific or that users may opt into another language. That can violate a language/locale policy requiring neutral or user-selectable language behavior.

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 includes prompt templates written directly in Chinese as default instructions, which can impose a specific language on generated interactions or workflows. There is no stated user choice, opt-in mechanism, or documented reason that Chinese must be used for these templates.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.