Back to skill

Security audit

code_flow_graph

Security checks for vulnerabilities and agentic risk

Overview

This graphing skill is not malicious, but it needs Review because its validator executes generated JavaScript and its HTML viewer can render project-derived text as active HTML.

Install only if you are comfortable with an agent reading the target project and generating local documentation from it. Avoid using it on untrusted repositories unless isolated, do not run the validator on data files you did not generate and review, and be cautious opening generated HTML reports because project-controlled text may execute in the browser context. Adjust the language config if Chinese output is not desired.

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

Warning
Location
example/code_flow_graph.html:441
Finding

Stored HTML Injection in the Generated Code Graph Viewer

Content
View full analysis
' + d.navLabel + '' + (d.navSub || '') + ''; item.addEventListener('click', function() { switchDiagram(key); }); navList.appendChild(item); }); function renderAttrHtml(a, isChild, parentHasChildren) { var cls = 'attr' + (isChild ? ' attr-child' : ''); var valHtml = a.val ? '' + a.val + '' : ''; var prefix = isChild ? '▸' : ''; return '
' + prefix + '' + a.name + '' + valHtml + '
'; } function switchDiagram(key) { if (currentDiagramKey === key) return; currentDiagramKey = key; var d = DIAGRAMS[key]; NODES = d.NODES; CONNECTIONS = d.CONNECTIONS; GROUPS = d.GROUPS; document.getElementById('diagramTitle').textContent = d.title; document.getElementById('diagramSub').textContent = d.sub || ''; document.querySelectorAll('.nav-item').forEach(function(el) { el.classList.toggle('active', el.dataset.diagram === key); }); var children = Array.from(canvas.children); children.forEach(function(ch) { if (ch !== svg) canvas.removeChild(ch); }); svg.innerHTML = ''; attrElements = {}; nodeElements = {}; nodePositions = {}; groupElements = {}; connData = []; selectedAttr = null; dragState = null; groupDragState = null; attrSigMap = {}; attrDescMap = {}; attrDetailMap = {}; attrIOMap = {}; attrCallChainMap = {}; attrFieldDetailMap = {}; undoStack = []; closeDetailPanel(); var s ...[truncated 5483 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/validate_data.js:18
Finding

Untrusted JavaScript Execution During Data Validation

Content
View full analysis
'); process.exit(1); } const code = fs.readFileSync(path.resolve(filePath), 'utf-8'); const errors = []; const warnings = []; // ============================================================ // Check 1: SYNTAX — Valid JS // ============================================================ let context; try { context = {}; vm.runInNewContext(code, context); } catch (e) { errors.push(`[SYNTAX] ${e.message}`); console.log('\n=== Validation: ' + filePath + ' ===\n'); console.log(`❌ ${errors.length} error(s):\n`); errors.forEach(e => console.log(` • ${e}`)); process.exit(1); } ``` ### Technical Analysis The validator accepts a caller-supplied path, reads the entire file, and passes its contents to `vm.runInNewContext`. This is execution, not syntax validation or passive data parsing. The new context does not explicitly expose Node.js `require` or `process`, which limits straightforward access to operating-system capabilities. Nevertheless, the validator executes arbitrary JavaScript statements and does not configure an execution timeout. A malicious input can therefore run infinite loops, perform expensive computation, or allocate excessive memory, blocking or terminating the validation process. Node.js documentation also cautions that the `vm` module is not a security mechanism for running hostile code. Relying on the current context contents as the sole security boundary is fragile, particularly if additional globals are exposed in a future revision or a runtime-specific sandbox escape becomes applicable. The risk is amplified by `SKIL ...[truncated 1699 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (14)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description says the skill generates interactive HTML node-graph diagrams for code visualization. The supplied code chunk does something materially different: it is a command-line validator for a code_flow_graph_data.js file. Its primary function is checking syntax and data integrity of diagram definitions, then printing errors/warnings. While the validation targets data related to diagrams, it does not itself generate, render, or display interactive HTML graphs. This is a primary-purpose mismatch, not just an implementation detail.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The comments and usage describe a benign validation script, but the implementation actually evaluates the provided file contents. This mismatch is dangerous because users may trust the tool with unreviewed inputs, not realizing they are executing code, increasing the likelihood of accidental remote code execution or denial of service in the development environment.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The validator reads an attacker-supplied file and executes it with vm.runInNewContext rather than treating it as inert data. Even in a VM context, untrusted JavaScript evaluation can trigger denial of service, sandbox escape risk, or unexpected side effects depending on Node runtime behavior and future changes, which is especially unsafe for a tool described as a validator.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README encourages broad triggering such as 'visualize code architecture' or 'generate a code graph' and describes immediate generation without much scoping, which can cause the skill to activate in situations where the user's intent is ambiguous. In an agent environment, over-broad activation can lead to unnecessary codebase analysis, generation of files, and unexpected disclosure or processing of project structure that the user did not explicitly request.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The configuration example sets 'language' to 'zh' by default without indicating that this should follow the user's preference. In an agent workflow, forcing a non-user-selected language can reduce transparency, impair review of generated artifacts, and create misleading or inaccessible outputs, especially when code documentation is expected in the user's working language.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The configuration states 'Language: Chinese for descriptions, English for code identifiers' as the default behavior. This imposes a specific language choice on users without offering an opt-in or alternative, which is a natural-language locale policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The config sets "language": "zh", which imposes a specific language setting. Under the policy, locale or language constraints should not be forced unless the user is given a choice or the restriction is clearly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The reference examples explicitly prescribe Chinese text for desc, detail, and io fields, which encourages a fixed language output format rather than letting users or implementers choose their locale. This is a natural-language policy concern because the document does not provide any opt-in, alternative locale guidance, or justification for restricting descriptions to Chinese.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The document declares lang="zh", and multiple user-facing UI strings throughout the file are Chinese-only, which imposes a specific language/locale on users. The file does not offer any language selection or explain why a Chinese-only locale is required.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The file hard-codes a Chinese navigation label alongside English text, indicating the UI/skill content may present a specific locale without offering user opt-in or selection. This matches the language/locale policy concern because the file contains natural-language labels but no indication that users can choose their preferred language.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

These navigation strings include Chinese text for the interface, but the file does not indicate that the locale is user-selectable or region-scoped. Hard-coded locale-specific labels in natural-language content can violate organizational language policy when users are not given a choice.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The UI layout section includes Chinese title/subtitle text and later Chinese placeholders/status text, but there is no natural-language indication that users can opt into this locale. This is a policy concern because the file embeds locale-specific interface content directly.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The UI layout section introduces sidebar text and legend labels such as "🖼️ UI 布局", "完整布局", and other Chinese strings as the documented format, but does not say this is optional or region-specific. Because the file is a general data format reference, this can be read as prescribing a specific locale without user choice.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

Line L183 hard-codes a Chinese sidebar label (🖼️ UI 布局) in otherwise English documentation, which implies a specific language choice without any opt-in or explanation. This matches the locale-policy concern for natural-language content that forces a language without user choice.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.