Back to skill

Security audit

URLMitra Link Manager

Security checks for vulnerabilities and agentic risk

Overview

The skill fits a URLMitra link-management purpose, but its command examples use unsafe user-input placeholders that could let crafted input run local shell commands.

Review before installing. Use a tightly scoped URLMitra API key, avoid running the shown command templates with untrusted URL, alias, or search text, and prefer a version that builds JSON safely with jq or another structured API call instead of direct placeholder substitution.

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

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:39
Finding

Shell Command Injection Through Unsafe Shortlink Parameter Interpolation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 39–43
Vulnerability Type: Shell command injection through unsafe interpolation of user-controlled values
Risk Level: High

Vulnerable Code

bash
curl -s -X POST \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $URLMITRA_API_KEY" \
  -d '{"url": "{url}", "alias": "{slug}"}' \
  https://api.urlmitra.com/api/v1/links

Technical Analysis

The documented command instructs the agent to replace {url} and {slug} inside a single-quoted shell argument. These values may originate from user input, but the skill neither validates them nor safely serializes them as JSON.

If the command is constructed through literal placeholder substitution, a value containing a single quote can terminate the shell-quoted argument. Subsequent shell metacharacters can then be interpreted as executable syntax rather than request data. JSON escaping alone is insufficient because shell quoting is processed before curl receives the argument.

The weakness applies to both the destination URL and alias fields. Using HTTPS protects data in transit but does not prevent local command injection during command construction.

Attack Path

  1. An attacker asks the agent to shorten a URL or create an alias containing a single quote followed by shell syntax.
  2. The agent substitutes that value directly for {url} or {slug} in the documented command.
  3. The injected single quote closes the existing shell argument.
  4. The shell interprets the remaining metacharacters and attacker-controlled text as commands.
  5. The injected command executes with the same operating-system permissions and environment as the agent process.

A conceptual malicious value could follow this structure:

text
' ; attacker_controlled_command ; #

Impact Assessment

Successful exploitation could execute arbitrary shell commands with the privileges of the OpenClaw agen ...[truncated 584 chars]

Remediation
View remediation

Remediation Suggestions

Do not insert user-controlled values into shell source code. Store values in variables, construct JSON with jq, and pass the resulting payload as a quoted argument:

bash
payload=$(jq -n \
  --arg url "$url" \
  --arg alias "$slug" \
  '{url: $url, alias: $alias}')

curl -sS --fail-with-body -X POST \
  -H 'Content-Type: application/json' \
  -H "X-API-Key: $URLMITRA_API_KEY" \
  --data-binary "$payload" \
  'https://api.urlmitra.com/api/v1/links'

Additional hardening should include:

  • Validate destination URLs with a proper URL parser and permit only required schemes such as HTTPS.
  • Restrict aliases to a strict allowlist, such as letters, digits, hyphens, and an explicitly defined maximum length.
  • Never generate commands by replacing placeholders in a command string and then evaluating that string.
  • Prefer direct process invocation with an argument array when supported, avoiding an intermediate shell.
  • Run the agent with least privilege and scope the API key to only the URLMitra operations required by this skill.
  • Avoid logging request headers or environment variables containing the API key.

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:67
Finding

Shell Command Injection Through Unsafe Semantic Search Query Interpolation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 67–71
Vulnerability Type: Shell command injection through unsafe interpolation of a search query
Risk Level: High

Vulnerable Code

bash
curl -s -X POST \
  -H "Content-Type: application/json" \
  -H "X-API-Key: $URLMITRA_API_KEY" \
  -d '{"query": "{searchTerm}"}' \
  https://api.urlmitra.com/api/v1/mitra/search

Technical Analysis

The semantic-search command places {searchTerm} directly inside a single-quoted JSON argument. Search terms are naturally free-form and may contain quotes or other special characters. The skill provides no shell-safe encoding or JSON serialization step.

If an implementation performs literal replacement, a single quote in the search term can escape the quoted argument. Shell operators appearing after it can then execute attacker-selected commands. This is particularly exposed because semantic search is explicitly designed to accept unrestricted natural-language input.

The vulnerability occurs locally before the HTTPS request reaches URLMitra; therefore, server-side API validation cannot mitigate it.

Attack Path

  1. An attacker provides a semantic-search request containing a single quote and shell control syntax.
  2. The agent substitutes the text directly into {searchTerm}.
  3. The single quote terminates the -d argument's shell quoting.
  4. The shell parses the remainder as one or more commands.
  5. Those commands execute under the agent process's identity and can access its environment and authorized resources.

A conceptual malicious search term could use the following structure:

text
' ; attacker_controlled_command ; #

Impact Assessment

Exploitation could result in arbitrary command execution with the privileges of the agent process. Potential consequences include:

  • Disclosure of URLMITRA_API_KEY and other environment variables.
  • Unauthorized reading or modifica ...[truncated 508 chars]
Remediation
View remediation

Remediation Suggestions

Serialize the search term with jq instead of embedding it into shell syntax:

bash
payload=$(jq -n \
  --arg query "$search_term" \
  '{query: $query}')

curl -sS --fail-with-body -X POST \
  -H 'Content-Type: application/json' \
  -H "X-API-Key: $URLMITRA_API_KEY" \
  --data-binary "$payload" \
  'https://api.urlmitra.com/api/v1/mitra/search'

The implementation should also:

  • Treat search text strictly as data and never evaluate a generated command string.
  • Prefer direct process execution with separate arguments rather than invoking a shell.
  • Enforce a reasonable maximum query length to reduce abuse and resource exhaustion.
  • Keep the API credential out of logs, error reports, and command traces.
  • Execute the skill in a least-privileged sandbox with restricted filesystem and network access.
  • Add tests containing single quotes, double quotes, command substitutions, newlines, and shell metacharacters to confirm that all input remains a single inert request value.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (7)

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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 10)May include surrounding context.

md
env:
        - URLMITRA_API_KEY
      bins:
        - curl
        - jq
    primaryEnv: URLMITRA_API_KEY
---

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 39)May include surrounding context.

md
-H "Content-Type: application/json" \
      -H "X-API-Key: $URLMITRA_API_KEY" \
      -d '{"url": "{url}", "alias": "{slug}"}' \
      https://api.urlmitra.com/api/v1/links
    ```

### 2. Live Redirect Health Diagnostics

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 47)May include surrounding context.

md
-H "Content-Type: application/json" \
      -H "X-API-Key: $URLMITRA_API_KEY" \
      -d '{"url": "{url}", "alias": "{slug}"}' \
      https://api.urlmitra.com/api/v1/links
    ```

### 2. Live Redirect Health Diagnostics

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 53)May include surrounding context.

md
-H "Content-Type: application/json" \
      -H "X-API-Key: $URLMITRA_API_KEY" \
      -d '{"url": "{url}", "alias": "{slug}"}' \
      https://api.urlmitra.com/api/v1/links
    ```

### 2. Live Redirect Health Diagnostics

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 59)May include surrounding context.

md
-H "Content-Type: application/json" \
      -H "X-API-Key: $URLMITRA_API_KEY" \
      -d '{"url": "{url}", "alias": "{slug}"}' \
      https://api.urlmitra.com/api/v1/links
    ```

### 2. Live Redirect Health Diagnostics

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 70)May include surrounding context.

md
-H "Content-Type: application/json" \
      -H "X-API-Key: $URLMITRA_API_KEY" \
      -d '{"url": "{url}", "alias": "{slug}"}' \
      https://api.urlmitra.com/api/v1/links
    ```

### 2. Live Redirect Health Diagnostics

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

This markdown file describes an operation that, when no alias is provided, will sweep all active workspace redirects. Because the skill description presents this broad workspace action without an explicit caution or user-facing warning about scope, API impact, or account-wide effects, it lacks the disclosure expected for potentially impactful behavior in markdown guidance.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.