Back to skill

Security audit

Api Magic Gen

Security checks for vulnerabilities and agentic risk

Overview

The skill is not visibly malicious, but it asks for broad file-writing and command-execution authority while giving unclear and inconsistent instructions.

Review this skill carefully before installing. Use it only in a sandboxed project workspace, avoid administrator/root execution, and require explicit approval for every file write, command execution, dependency install, or outbound API/webhook call. Treat the magic-api guidance as advisory because the input/output contract is inconsistent with the advertised purpose.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:27
Finding

Excessive Command-Execution and File-Write Permissions

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 27–30
Vulnerability Type: Excessive tool permissions and violation of least privilege
Risk Level: Medium

yaml
tools:
- read
- exec
- write

Technical Analysis

The Skill requests unrestricted command-execution and file-write capabilities even though the package contains only a Markdown instruction file and no implementation demonstrating a legitimate need for these permissions. Its documented functions primarily consist of configuration examples and operational guidance that can be delivered using read-only access.

Granting both exec and write expands the Skill's authority beyond its stated purpose. If attacker-controlled instructions, command parameters, file paths, or API-generation content are processed during a Skill invocation, the Agent could use these tools to execute arbitrary local commands or modify files outside the intended project scope.

The risk is compounded by troubleshooting guidance at SKILL.md lines 420 and 443 that recommends running as an administrator when permissions are insufficient. Although this guidance does not itself elevate privileges automatically, following it could substantially increase the consequences of an unsafe command or write operation.

Attack Path

  1. A user or external data source supplies attacker-controlled content to a workflow using this Skill.
  2. The content is interpreted as requiring file generation, command execution, dependency setup, or troubleshooting.
  3. The Skill uses its declared write capability to create or alter a local file, or its exec capability to run a command influenced by the supplied content.
  4. If the operation fails because of insufficient permissions, the documented troubleshooting guidance may encourage rerunning the Agent or operation with administrator privileges.
  5. The attacker-influenced operation then executes with broader access, potentially modifyin ...[truncated 765 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove exec and write from the declared tools unless a documented workflow strictly requires them.
  2. Prefer read-only operation for configuration analysis, documentation generation, and advisory responses.
  3. If file output is required, restrict writes to a dedicated project-relative output directory and reject absolute paths, traversal sequences, symbolic-link escapes, and writes to existing sensitive files.
  4. If command execution is required, use an explicit allowlist of fixed executables and arguments rather than passing generated or user-controlled strings to a shell.
  5. Require explicit user confirmation before every command execution or filesystem modification, showing the exact command, arguments, and destination path.
  6. Run the Skill in a sandbox with minimal filesystem access, no administrative privileges, limited environment variables, and network access disabled unless specifically needed.
  7. Replace the administrator-execution recommendations at lines 420 and 443 with least-privilege diagnostics. Elevated execution should not be presented as a routine solution to permission errors.
  8. Document concrete permission requirements and validate all user-controlled content before it can influence tool names, command arguments, file paths, or generated scripts.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (5)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The activation text is extremely broad ('use when API integration, system connection, monitoring, logging, deployment...'), which increases the chance the agent will select this skill in unrelated contexts. Because the skill advertises read, write, exec, and API capabilities, ambiguous triggering can expose files, execute commands, or send data externally when a narrower skill would have sufficed.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The description states '支持中文交互' as part of the operating behavior, but does not indicate that language is optional or user-selectable. This can violate language/locale policy because it suggests a fixed interaction language without opt-in or a documented regional justification.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The documented parameters and JSON return schema describe a generic code-review/scoring workflow rather than the advertised magic-api generation/pro-configuration skill. This mismatch can cause the agent to invoke the skill under false assumptions, leading to unintended handling of sensitive code, incorrect automation paths, or unsafe follow-on actions based on misleading outputs.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill advertises file writing, command execution, and external API operations but does not prominently disclose their side effects, data flow, or safety constraints. In an agent setting, this omission is dangerous because users may not realize the skill can modify the filesystem, run system commands, or transmit data off-host, enabling destructive or privacy-impacting actions through normal-looking invocations.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The file primarily documents a local/enterprise magic-api setup using Spring Boot, databases, interceptors, and optional webhooks, but the usage constraint states broadly that the skill requires an API Key and cannot be used without one. This is an active contradiction in intent because the documented core workflow does not consistently depend on an external API-key-gated service.

Content

No source excerpt is available for this finding.