Back to skill

Security audit

File Converter

Security checks for vulnerabilities and agentic risk

Overview

This file-converter skill is mostly local and purpose-related, but its documentation and scripts expose mismatched commands plus unsafe converters that users should review before installing.

Install only if you are comfortable reviewing and constraining this skill first. Treat it as a broad local file utility, not just the four frontmatter commands; avoid running it on untrusted filenames or arguments, do not execute generated SQL without review, and do not render generated HTML/XML in sensitive contexts without sanitization.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/script.sh:149
Finding

Bash Arithmetic Expansion Allows Command Injection

Content
View full analysis
/dev/null | head -$((n / 16 + 1)) || od -A x -t x1z "$file" | head -$((n / 16 + 1)) } ``` ### Technical Analysis The second argument to `hex` is copied directly into `n` and then evaluated inside Bash arithmetic expansion: ```bash $((n / 16 + 1)) ``` Bash can recursively interpret variable values as arithmetic expressions. Crafted expressions involving array subscripts and command substitutions can therefore cause shell commands to execute while Bash evaluates the ostensibly numeric value. Quoting the initial assignment does not make the later arithmetic evaluation safe. The value must be validated as a decimal integer before it is used in an arithmetic context. ### Attack Path 1. An attacker persuades a user or automated process to invoke `scripts/script.sh hex` with an attacker-controlled second argument. 2. The argument contains a malicious arithmetic expression that triggers command substitution during recursive arithmetic evaluation. 3. `cmd_hex` evaluates the argument in `$((n / 16 + 1))`. 4. The embedded command executes before `head` receives its numeric argument. 5. The command runs with the operating-system privileges of the user or service executing the skill. ### Impact Assessment Successful exploitation provides arbitrary command execution as the current skill process account. The attacker can read or modify files accessible to that account, invoke local programs, alter project data, and potentially access credentials available in the process environment or user account. This does not independently grant elevated system privileges, but its scope includes all resources already accessible to the invoking account. ]]>
Remediation
View remediation
[n]}" local n="${2:-256}" local lines [[ "$n" =~ ^[0-9]+$ ]] || { printf 'Invalid byte count: %s\n' "$n" >&2 return 2 } (( n <= 1048576 )) || { printf 'Byte count exceeds the permitted limit\n' >&2 return 2 } lines=$((n / 16 + 1)) if command -v xxd >/dev/null 2>&1; then xxd "$file" 2>/dev/null | head -n "$lines" else od -A x -t x1z "$file" | head -n "$lines" fi } ``` Use a reasonable upper bound to prevent resource abuse. Do not evaluate arbitrary user strings as arithmetic expressions. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
<table>}" local table="${2:?}" FILE="$file" TABLE="$table" python3 << 'PYEOF' import csv, os with open(os.environ["FILE"]) as f: for row in csv.DictReader(f): cols = ', '.join(row.keys()) vals = ', '.join("'{}'".format(v.replace("'","''")) for v in row.values()) print('INSERT INTO {} ({}) VALUES ({});'.format(os.environ["TABLE"], cols, vals)) PYEOF } ``` ### Technical Analysis CSV field values have single quotes escaped, but two classes of SQL identifiers are emitted wi ...[truncated 1623 chars]:81
Finding

Generated SQL Contains Unvalidated Table and Column Identifiers

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/convert.sh:274
Finding

JSON-to-XML Conversion Emits Unescaped Names, Attributes, and Text

Content
View full analysis
".format(prefix, tag, attrs)) for k, v in children: if k == "_text_": print("{} {}".format(prefix, v)) elif isinstance(v, list): for item in v: to_xml(item, k, indent + 1) else: to_xml(v, k, indent + 1) print("{}".format(prefix, tag)) elif isinstance(obj, list): for item in obj: to_xml(item, "item", indent) else: val = "" if obj is None else str(obj) print("{}<{}>{}".format(prefix, tag, val, tag)) ``` ### Technical Analysis The converter constructs XML through string interpolation rather than an XML serialization library. It does not: - Validate JSON keys before using them as XML element or attribute names. - Escape quotation marks or entity characters in attribute values. - Escape `<`, `>`, or `&` in text nodes. - Reject malformed or namespace-manipulating names. Consequently, attacker-controlled JSON can terminate attributes or elements and inject additional XML structure. It can also generate malformed output that is interpreted differently by downstream parsers. ### Attack Path 1. An attacker supplies or modifies a JSON document processed by `json2xml`. 2. The JSON contains crafted keys, attribute values, or scalar text with XML metacharacters. 3. `to_xml` interpolates those values direct ...[truncated 763 chars]
Remediation
View remediation
`, `&`, single quotes, and double quotes. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/script.sh:58
Finding

Markdown-to-HTML Conversion Permits Active HTML Injection

Content
View full analysis
\1', t, flags=re.MULTILINE) t = re.sub(r'^## (.+)$', r'

\1

', t, flags=re.MULTILINE) t = re.sub(r'^# (.+)$', r'

\1

', t, flags=re.MULTILINE) t = re.sub(r'\*\*(.+?)\*\*', r'\1', t) t = re.sub(r'\*(.+?)\*', r'\1', t) print(t) PYEOF } ``` ### Technical Analysis The function reads arbitrary Markdown and emits it as HTML after applying a few regular-expression substitutions. It neither escapes source HTML nor sanitizes the generated output. Raw tags, event-handler attributes, script-capable elements, and dangerous URLs therefore remain in the result. Malicious content can also be placed inside heading or emphasis captures and is inserted verbatim into generated tags. Regular expressions are not an appropriate HTML security boundary. A proper Markdown parser must be combined with explicit raw-HTML handling and output sanitization. ### Attack Path 1. An attacker creates a Markdown file containing active HTML or malicious attributes. 2. A user or automated process converts the file with `md2html`. 3. The converter copies the malicious markup into its output without escaping or sanitization. 4. The output is opened in a browser or embedded into a web application. 5. If the rendering context permits active content, attacker-controlled script executes in that context. ### Impact Assessment In a browser-based downstream context, exploitation may allow script execution under the origin where the converted HTML is served. This can expose page data, perform actions available to the victim, modify displayed content, or ...[truncated 193 chars]
Remediation
View remediation
`, event-handler attributes, dangerous links, SVG content, and malicious markup inside headings and emphasis. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
scripts/convert.sh:7
Finding

Promotional Text Is Appended to Machine-Readable Conversion Output

Content
View full analysis
" ``` For example, the `yaml2json` branch appends the following after serialized JSON: ```bash print(json.dumps(data, indent=2, ensure_ascii=False)) PYEOF echo "" echo "// $BRAND" ``` ### Technical Analysis Multiple conversion branches append fixed branding to standard output. For machine-readable formats, this changes the converted artifact rather than providing separate diagnostic information. In particular, `// Powered by ...` is not valid JSON. Redirecting `yaml2json` or `xml2json` output to a file therefore produces a document that strict JSON parsers reject. Similar suffixes can alter CSV, YAML, XML, minified code, or other generated artifacts and may be propagated into downstream systems without the user noticing. The text is fixed rather than attacker-controlled, so this is not instruction hijacking. The issue is silent corruption of output integrity. ### Attack Path 1. A user runs a conversion command and redirects standard output to a destination file. 2. The converter emits the requested data. 3. It then appends promotional text to the same standard-output stream. 4. A downstream parser or application consumes the file as a machine-readable artifact. 5. Parsing fails, or the unintended content is accepted and propagated as part of the artifact. ### Impact Assessment The likely impact is denial of processing, broken automation, invalid configuration files, and unintended content propagation. It does not directly provide code execution or additional privileges. The scope includes workflows that trust stand ...[truncated 62 chars]
Remediation
View remediation
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • 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
Findings (11)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This finding shows substantial divergence between the declared purpose and the apparent implementation, including missing advertised conversions and several undeclared capabilities such as SQL generation, base64 handling, URL encoding/decoding, hex inspection, and Markdown-to-HTML conversion. Such discrepancies are risky because they expand the skill's effective attack surface, undermine reviewability, and can cause agents to expose, inspect, or transform sensitive content in ways operators did not authorize.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

This finding shows substantial divergence between the declared purpose and the apparent implementation, including missing advertised conversions and several undeclared capabilities such as SQL generation, base64 handling, URL encoding/decoding, hex inspection, and Markdown-to-HTML conversion. Such discrepancies are risky because they expand the skill's effective attack surface, undermine reviewability, and can cause agents to expose, inspect, or transform sensitive content in ways operators did not authorize.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The front-matter description and body documentation describe different command sets and capabilities, which creates a misleading interface contract for users and automated agents. In a skill ecosystem, inconsistent documentation can cause unsafe invocation decisions, missed review of real behavior, and misuse of commands that were not expected from the manifest.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The documentation claims YAML/XML/CSV/Markdown conversion support, but the listed command interface does not substantiate those features and instead documents a different set of utilities. This inconsistency is dangerous because users may trust unsupported or differently implemented conversions, while hidden functionality can be invoked without appropriate scrutiny, especially in automation contexts handling untrusted files.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script implements additional capabilities beyond those declared in the skill metadata, including md2csv, xml2json, json2xml, minify, and prettify. Undeclared functionality weakens review and policy enforcement because users or orchestrators may invoke behaviors that were never security-assessed, creating hidden attack surface and trust-boundary violations.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script exposes capabilities beyond the manifest’s stated scope, including SQL generation, base64 operations, file inspection, and markdown-to-HTML conversion. Scope drift is dangerous in agent skills because users and orchestrators may grant trust based on the declared purpose, while the extra commands can be used to inspect, transform, or exfiltrate data in ways not expected from a simple format converter.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The hex dump command provides raw file-inspection functionality unrelated to the declared conversion purpose. In an agent context, this can be abused to read and expose contents of arbitrary local files, including binary secrets or sensitive headers, making the skill more useful for reconnaissance and data extraction than its manifest suggests.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The help text advertises commands that are not listed in the manifest, reinforcing the existence of undocumented functionality and making it easier for users to discover and use unreviewed features. While the issue is primarily metadata inconsistency, in an agent skill ecosystem this can bypass allowlisting, confuse security controls, and expose operators to unexpected file-processing behaviors.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The comment states base64 decode was removed, but the command remains exposed in the dispatcher, creating misleading security expectations and undefined behavior. Even though the function currently only expands a user-supplied filename and performs no decode, mismatches between comments and exposed interfaces are risky because they hide real runtime behavior and can undermine review and policy enforcement.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The manifest says the skill's commands are detect, json2yaml, yaml2json, and csv2md, but this tips file also instructs users to use minify, prettify, and xml2json. That indicates documented behavior beyond the explicitly declared command set, creating a mismatch between the claimed interface and the documented capabilities.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.