Back to skill

Security audit

代码

Security checks for vulnerabilities and agentic risk

Overview

This skill is mostly a Markdown guide for IRIS/ObjectScript formatting, but it asks for broad command, file, API, and credential-related capabilities that are not clearly scoped to that task.

Install only if you are comfortable granting this skill broad local file and command authority, and prefer using it on non-sensitive ObjectScript snippets or inside a sandbox. Do not provide API keys unless the external service and data flow are clarified, and require confirmation before it writes files or runs commands.

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:17
Finding

Unnecessary Command Execution and Broad Filesystem Capabilities

Content
View full analysis

Vulnerability Details

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

Vulnerable Code

yaml
tools:
- read
- exec
- write
- glob
- grep

Technical Analysis

The Skill declares unrestricted command-execution capability through exec, together with broad filesystem reading, writing, discovery, and search capabilities. Its documented purpose is to review, format, score, and return corrected InterSystems IRIS/Cache ObjectScript code. The documentation does not define a necessary command, compiler invocation, executable component, command allowlist, filesystem boundary, or sandbox policy that would justify these capabilities.

Merely declaring these tools does not prove that commands are automatically executed. However, exposing them unnecessarily expands the authority available during Skill execution. If attacker-controlled source code or embedded instructions influence the agent, the available tools could be misused beyond the legitimate formatting task.

Attack Path

  1. The Skill is loaded with the declared exec, read, write, glob, and grep capabilities.
  2. An attacker submits ObjectScript code or related content containing adversarial instructions designed to influence the agent.
  3. The agent interprets the malicious content as actionable instructions rather than inert source code.
  4. Because exec and broad filesystem tools are available, the agent may execute local commands, enumerate files, read unrelated project data, or modify accessible files.
  5. Any resulting access is bounded by the operating-system privileges and sandbox restrictions of the hosting agent process.

This exploitation path is conditional on the host exposing the declared tools without effective confirmation, sandboxing, or policy enforcement. The audited file contains no direct command payload or demonstrated automatic execution sequence.

Impact Asses

...[truncated 727 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove exec because no command execution is required by the documented formatting and review workflow.
  2. Prefer accepting ObjectScript code directly from the user and returning corrected text without filesystem access.
  3. If file processing is required, limit read, write, glob, and grep to an explicitly approved project directory and deny traversal outside that boundary.
  4. Require explicit user confirmation before overwriting files, and write corrected output to a separate file by default.
  5. Treat reviewed source code and comments as untrusted data, never as agent instructions.
  6. If compilation is later introduced, invoke a fixed executable with structured arguments, enforce a strict command allowlist, reject shell metacharacters, and run it in an isolated sandbox with minimal operating-system permissions.
  7. Document the precise reason for every retained tool and enforce the same least-privilege policy in the host-agent configuration.
Vulnerability Patterns
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (5)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The manifest sets the display name to Chinese ('代码'), and the file consistently presents the skill in Chinese without any indication that users may choose another language. Under the language/locale policy, forcing a specific language without opt-in is a natural-language policy concern unless the locale restriction is explicitly justified.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The activation description says the skill should be used for broad development tasks such as code generation, programming assistance, debugging/testing, and deployment, which greatly exceeds a formatter's legitimate scope. Overly broad routing criteria can cause this skill to intercept unrelated requests and exercise read/exec/write capabilities in contexts where a user did not intend such powerful behavior.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The environment and dependency sections state that the skill supports API-based operation and classify it as 'MD+execute()', despite the primary purpose being local code formatting and review. Unjustified external/API capability broadens the trust boundary and may lead the agent to send code or metadata to external services without a clear user expectation or necessity.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill is presented as an IRIS/ObjectScript formatter and reviewer, but the documented '主要功能' expands it into generic file handling, API integration, command execution, and information retrieval. This scope creep can cause the agent to invoke powerful capabilities in situations far beyond the user's expected formatting task, increasing the risk of unintended command execution, data exposure, or external service interaction.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The skill is described primarily as a code-formatting and review tool, but the documentation instructs users to export an API_KEY environment variable. For a formatter/reviewer skill, credential handling is not an obvious requirement unless external services are explicitly part of scope, which the main description does not clearly establish.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.