Back to skill

Security audit

swagger-skill

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a real Swagger API helper, but it automatically installs npm packages and can send credentials, API data, and local files to arbitrary endpoints with limited safeguards.

Install only if you are comfortable reviewing the code and controlling where it runs. Use it with trusted Swagger URLs, prefer HTTPS, avoid entering broad tokens or cookies, do not upload sensitive local files unless the destination is verified, and be aware that first import may install npm packages into the skill directory.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (3)

T08 · Insecure Dependencies

Warning
Location
index.js:10
Finding

Automatic Installation of Unpinned Dependencies During Module Import

Content
View full analysis
{ try { require.resolve(dep); return false; } catch { return true; } }); if (missing.length > 0) { const pkgJsonPath = path.join(__dirname, 'package.json'); try { require.resolve(pkgJsonPath); } catch { execSync(`npm init -y --prefix "${__dirname}" && node -e "const fs=require('fs');const p=JSON.parse(fs.readFileSync('${pkgJsonPath}','utf8'));p.type='module';fs.writeFileSync('${pkgJsonPath}',JSON.stringify(p,null,2))"`, { stdio: 'pipe' }); } execSync(`npm install --prefix "${__dirname}" ${missing.join(' ')}`, { stdio: 'pipe' }); } } ensureDependencies(); ``` ### Technical Analysis Importing `index.js` immediately invokes `ensureDependencies()`. If `axios` or `form-data` cannot be resolved, the Skill runs `npm install` using package names without pinned versions or lockfile verification. This introduces a supply-chain trust boundary at runtime. The effective package content depends on the npm registry and configuration present when the Skill is imported, rather than on artifacts reviewed with the Skill. npm package installation may also execute package lifecycle scripts with the privileges of the current process. Automatic package installation and creation or modification of `package.json` are import-time side effects. They exceed the minimum privileges necessary for loading an API client module because dependency provisioning can be performed explicitly before execution. ### Attack Path 1. The Skill is imported in an environment where one or both dependencies are absent. 2. `ensureDependencies()` executes automatically. 3. The process resolves the unversioned package names through the config ...[truncated 835 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
index.js:112
Finding

Authentication Credentials Can Be Transmitted Over Plaintext HTTP

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
cli.js:35
Finding

CLI Authentication Secrets Are Echoed in Cleartext During Entry

Content
View full analysis
{ rl.question(question, resolve); }); } ``` ### Technical Analysis Node.js `readline.question()` uses normal terminal input and does not suppress character echo. Tokens and serialized cookie values are therefore displayed visibly as the user types them. Although the code does not subsequently print the secret values, the original entry can remain visible in the terminal scrollback and may be captured by terminal session recording, screen sharing, screenshots, or nearby observers. ### Attack Path 1. The user starts the interactive CLI. 2. The CLI requests an authentication token or cookie object. 3. The user types the secret using a normal `readline.question()` prompt. 4. The terminal displays each entered character. 5. A nearby observer, screen-sharing participant, terminal recorder, or captured screenshot obtains the secret. 6. The observer reuses the credential against the associated ...[truncated 400 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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (14)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 37)May include surrounding context.

md
import SwaggerAPISkill from './index.js';

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 69)May include surrounding context.

md
import SwaggerAPISkill from './index.js';

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 398)May include surrounding context.

md
import SwaggerAPISkill from './index.js';

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill runs npm init and npm install at runtime via execSync, causing code and package changes on the host without explicit user approval. This expands the trust boundary from the skill code to the npm registry and install scripts, creating supply-chain and arbitrary code execution risk that is unrelated to basic Swagger querying functionality.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The upload feature reads arbitrary local file paths using fs.createReadStream and posts them over HTTP without disclosure or confirmation. This can exfiltrate sensitive local files if the caller is tricked into invoking uploads against an attacker-controlled or untrusted API endpoint.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 42)May include surrounding context.

md
const skill = new SwaggerAPISkill();

// 1. 加载 Swagger 规范
await skill.fetchSwaggerSpec('https://api.example.com/swagger.json');

// 2. 获取所有接口
const allAPIs = skill.getAllAPIs();

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill explicitly supports fetching remote Swagger specs, invoking arbitrary APIs, and uploading files, but its safety guidance does not warn users that these operations may transmit sensitive data to third parties or perform state-changing actions on remote systems. In an agent context, missing disclosure increases the chance of unintended data exfiltration, unsafe file transfer, or accidental modification/deletion of remote resources.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The code prompts for a Token and Cookie, stores them, and passes them into fetchSwaggerSpec for a network request. Although the user is asked to provide credentials, there is no explicit disclosure that these sensitive values will be sent to the remote URL they entered, which is a privacy- and safety-relevant operation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The callAPI flow accepts any path and HTTP method, including POST, PUT, and DELETE, and immediately executes the request after collecting parameters. There is no user-facing warning or confirmation that the action may modify or delete remote data, making safety-critical operations insufficiently disclosed.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The code automatically initializes a package and installs missing dependencies with no disclosure or consent. Even if intended as convenience behavior, it performs privileged environment modification and may trigger package install scripts, which users would not reasonably expect from an API helper skill.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

fetchSwaggerSpec can send bearer tokens and cookies to arbitrary URLs supplied to the skill, without validation or user-facing confirmation. In a skill designed to consume external Swagger endpoints, this creates SSRF-style credential exposure and accidental secret transmission risk if an attacker influences the target URL.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The general API execution path sends request bodies, query data, custom headers, and stored authentication headers to whatever endpoint was loaded, with no confirmation or guardrails. Because this skill is expressly built to invoke APIs from natural-language instructions, mistaken endpoint selection or maliciously chosen specs can lead to unintended state-changing requests and credential leakage.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

Nearly all user-facing prompts and status messages are written only in Chinese, with no option to select another language. This creates a natural-language policy concern because the skill imposes a specific locale on all users without opt-in or documented justification.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The file contains numerous user-facing strings and inline comments in Chinese, such as status/error messages returned to callers, with no indication that language selection is optional. That can violate a language/locale policy when the skill implicitly forces one language without user opt-in or documented regional scope.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.dangerous_exec

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
index.js:18