Back to skill

Security audit

KML Toolkit

Security checks for vulnerabilities and agentic risk

Overview

This skill is a local KML/KMZ inspection helper whose behavior matches its stated purpose, with some size-handling and auto-invocation cautions.

Install only if you need local KML/KMZ inspection. Avoid running it automatically on untrusted or very large KML/KMZ files unless your environment has memory, CPU, and timeout limits; its advertised conversion-related scope is limited and should be handled by a dedicated GIS tool as the skill itself notes.

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
scripts/kml_tool.py:46
Finding

Unbounded KMZ Decompression and XML Parsing Allow Resource Exhaustion

Content
View full analysis
ParsedDocument: path = Path(path_text) suffix = path.suffix.lower() if suffix == ".kmz": with zipfile.ZipFile(path) as archive: names = [name for name in archive.namelist() if name.lower().endswith(".kml")] if not names: raise ValueError("KMZ archive does not contain a .kml file.") preferred = "doc.kml" main_name = preferred if preferred in names else names[0] data = archive.read(main_name) try: root = ET.fromstring(data) except ET.ParseError as exc: raise ValueError(f"Invalid XML inside KMZ: {exc}") from exc return ParsedDocument(source_type="kmz", root=root, origin=main_name) if suffix != ".kml": raise ValueError("Input file must end with .kml or .kmz.") try: root = ET.parse(path).getroot() ``` ### Technical Analysis The KMZ processing path selects a KML archive member and decompresses its entire contents into memory with `archive.read(main_name)`. It does not inspect or enforce limits on: - The member's declared uncompressed size. - The compression ratio between `ZipInfo.compress_size` and `ZipInfo.file_size`. - The number of archive entries. - The total decompressed archive size. - The amount of data read into memory. - The number or depth of XML elements. - The number of coordinate tuples subsequently collected into lists. After decompression, `ET.fromstring(data)` constructs an in-memory XML tree. Subsequent processing creates additional lists of XML elements and coordinates, increasing the memory required for a large payload. The plain KML path has a related issue because `ET.parse(path).get ...[truncated 2151 chars]
Remediation
View remediation
Vulnerability Patterns
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (2)

Tp4

High
Category
MCP Tool Poisoning
Confidence
90% confidence
Finding

The code substantially matches the core declared purpose of summarizing, validating, and extracting data from KML/KMZ files. It supports placemark geometry summaries, coordinate extraction, bbox generation, and basic validation, and it can read KMZ archives. However, the description overstates several capabilities. There is no conversion functionality or cleanup guidance, no actual user-facing guidance generation, no deep Folder structure inspection beyond counting Folder elements, and only limited KMZ packaging checks. Altitude values are parsed but not specifically summarized or reported as a distinct feature. So while the primary purpose is aligned, the declared description materially over-claims several implemented capabilities, making this a mismatch.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill enables implicit invocation without defining any trigger constraints, guardrails, or exclusion conditions, which can cause the agent to auto-select this skill in broader contexts than intended. Because the skill handles file inspection and extraction for KML/KMZ content, unintended invocation could expose user-provided files to unnecessary processing, create confused-deputy behavior, or let adversarial prompts steer the agent into using the skill when it should not.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.