Back to skill

Security audit

ensp

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward eNSP topology file generator with disclosed local file output and no evidence of hidden execution, persistence, credential access, or exfiltration.

This skill is reasonable to install for generating eNSP topology files. Use caution with topology names or labels copied from untrusted sources, and prefer agents or workflows that escape XML attributes before writing the final `.topo` file.

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

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:10
Finding

Missing XML Escaping for User-Controlled Topology Values

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:10-23
Vulnerability Type: XML injection through unsafe generation instructions
Risk Level: Medium

Vulnerable Code

markdown
## How to create a topology

1. **Parse user's request** to identify:
   - Network devices (routers, switches, PCs, Cloud, etc.)
   - Connections between devices
   - Optional: text labels, area boxes

2. **Generate UUIDs** for each device using a valid UUID v4 format

3. **Calculate layout coordinates** for devices using auto-layout algorithm

4. **Build the .topo XML** following the format in `references/topo-reference.md`

5. **Write the file** to current directory using Write tool

6. **Open the result** - print the file path so user can open it in eNSP

User-controlled labels are explicitly supported at SKILL.md:124-132:

markdown
## Adding text labels (txttips)

Common labels for network diagrams:
- Loopback addresses: `Loopback0:10.0.1.1/24`
- Network segments: `10.0.12.0/24`
- Area labels: `Area0`, `Area1`, `AS 64512`
- Device roles: `Core Layer`, `Access Layer`

The destination format places these values in XML attributes, as documented at references/topo-reference.md:501-513:

xml
<txttip 
    left="100" 
    top="50" 
    right="250" 
    bottom="70" 
    content="Loopback0:10.0.1.1/24" 
    fontname="Consolas" 
    fontstyle="0" 
    editsize="100" 
    txtcolor="-16777216" 
    txtbkcolor="-7278960" 
    charset="1" />

Technical Analysis

The Skill directs the agent to parse user-supplied device names, labels, and topology data and insert them into a .topo XML document. It does not require XML-safe serialization, attribute escaping, or validation of user-controlled values.

XML metacharacters such as &, <, >, ", and ' have structural meaning. If generated through direct string interpolation, a malicious value containing a quote can ter ...[truncated 1596 chars]

Remediation
View remediation

Remediation Suggestions

  1. Generate topology files with a proper XML library or structured serializer rather than concatenating strings.
  2. Escape every user-controlled attribute and text value. At minimum, correctly encode &, <, >, ", and ' according to its XML context.
  3. Add an explicit instruction to treat all topology descriptions, device names, and annotations as data rather than raw XML.
  4. Validate device models and connection types against fixed allowlists.
  5. Constrain device names and labels by length and permitted character set where practical.
  6. Validate UUIDs, IP addresses, interface indexes, dimensions, coordinates, and color values using strict type and range checks.
  7. Reject raw XML declarations, document type declarations, entities, processing instructions, and unexpected markup in user input.
  8. Parse the completed document with a securely configured XML parser before writing it, with external entities and network access disabled.
  9. Add tests containing quotes, ampersands, angle brackets, entity syntax, and attempted attribute or element injection.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Hidden Instructions

High
Category
Prompt Injection
Confidence
70% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · references/topo-reference.md (reported line 9)May include surrounding context.

md
<?xml version="1.0" encoding="UNICODE" ?>
<topo version="1.3.00.100">
    <devices>
        <!-- Device definitions -->
    </devices>
    <lines>
        <!-- Connection lines -->

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The activation rule says to always use the skill when a user asks to create, generate, or design a network topology diagram, which is broad enough to capture many generic networking requests that may not actually require eNSP-specific file generation. This can cause unintended invocation, inappropriate file-writing behavior, or tool use in contexts where a safer or simpler response would be more appropriate.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The text label attribute table states charset | 1=UTF-8/ASCII, 134=GBK/Chinese, which introduces a locale-specific encoding expectation in natural-language documentation. Because the file does not present this as an optional user choice or clearly justify a China-specific constraint, it may violate language/locale policy guidance.

Content

No source excerpt is available for this finding.