Back to skill

Security audit

MarketUP管理

Security checks for vulnerabilities and agentic risk

Overview

This skill is a legitimate MarketUP CRM helper, but it asks the agent to handle a persistent API key and perform live CRM write actions without enough guardrails.

Review before installing. Use a least-privilege MarketUP API key, expect the key to be stored in plaintext at ~/.openclaw/.env, restrict that file's permissions, and avoid using the skill on production CRM data unless operators explicitly approve each write or pool action.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/setup-marketup-api-key.sh:16
Finding

API Key Stored in Plaintext Without Enforced Access Permissions

Content
View full analysis

Vulnerability Details

File Location: scripts/setup-marketup-api-key.sh:16-25
Related Invocation Locations: SKILL.md:11-13, references/setup-marketup-api-key.md:3-13
Vulnerability Type: Insecure credential storage and unsafe credential-file update
Risk Level: Medium

Vulnerable Code

bash
mkdir -p "${ENV_DIR}"
touch "${ENV_FILE}"

if rg -q '^MARKETUP_API_KEY=' "${ENV_FILE}"; then
  sed -i.bak "s|^MARKETUP_API_KEY=.*$|MARKETUP_API_KEY=${MARKETUP_API_KEY_INPUT}|" "${ENV_FILE}"
  rm -f "${ENV_FILE}.bak"
  echo "MARKETUP_API_KEY has been updated in ${ENV_FILE}."
else
  printf "MARKETUP_API_KEY=%s\n" "${MARKETUP_API_KEY_INPUT}" >> "${ENV_FILE}"
  echo "MARKETUP_API_KEY has been appended to ${ENV_FILE}."
fi

Technical Analysis

The setup script persistently stores MARKETUP_API_KEY as plaintext in ~/.openclaw/.env. It creates the directory and file without explicitly enforcing restrictive permissions such as 0700 for the directory and 0600 for the file. Consequently, confidentiality depends on the invoking environment's umask and any pre-existing permissions or ownership.

If the file or directory is readable by another local account or process, that principal can recover the credential. The Skill uses this credential as the Authorization header for MarketUP CRM operations, including reading leads and accounts and performing mutations.

The update branch also interpolates the credential directly into a sed replacement expression:

bash
sed -i.bak "s|^MARKETUP_API_KEY=.*$|MARKETUP_API_KEY=${MARKETUP_API_KEY_INPUT}|" "${ENV_FILE}"

Replacement-sensitive characters in the key, including &, |, and backslashes, are not escaped. Such characters can alter the replacement semantics, corrupt the saved value, or cause the update command to fail. This is not demonstrated as arbitrary shell-command execution because shell metacharacters introduced through variabl ...[truncated 1759 chars]

Remediation
View remediation

Remediation Suggestions

  1. Set a restrictive umask before creating credential-bearing paths:

    bash
    umask 077
    
  2. Create and enforce secure permissions:

    bash
    mkdir -p -m 700 "${ENV_DIR}"
    touch "${ENV_FILE}"
    chmod 600 "${ENV_FILE}"
    
  3. Verify that the directory and file are owned by the current user and reject unexpected ownership.

  4. Reject symbolic links and non-regular files before modifying .env to prevent writes through an attacker-controlled path.

  5. Avoid interpolating the API key into a sed expression. Rewrite the file through a securely created temporary file while treating the credential as opaque data, then atomically replace the destination.

  6. Ensure the temporary file is created inside the protected directory with mode 0600, and install it atomically only after successful processing.

  7. Prefer the platform's dedicated secret-management facility instead of a plaintext environment file when such a facility is available.

  8. After remediation, test keys containing &, |, backslashes, spaces, and other special characters to ensure exact round-trip storage without interpretation.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (17)

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as a CRM operations workflow, but it also instructs the agent to run a credential setup flow that prompts for an API key and writes it into a global environment file. That expands the trust boundary from normal CRM API usage into secret collection and local persistence, which is materially different behavior and can lead to users disclosing credentials without understanding they will be stored system-wide.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The discard/return-to-pool operation is potentially destructive because it changes ownership/state and may interrupt follow-up workflows or be difficult to reverse operationally. Presenting it as a routine curl example without a warning or confirmation step makes accidental execution significantly more dangerous in an agent-driven environment.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/setup-marketup-api-key.sh (reported line 6)May include surrounding context.

sh
set -euo pipefail

ENV_DIR="${HOME}/.openclaw"
ENV_FILE="${ENV_DIR}/.env"

printf "Enter MARKETUP_API_KEY (leave empty to cancel): "
IFS= read -r MARKETUP_API_KEY_INPUT

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill directs the agent to collect an API key and write it to a global '~/.openclaw/.env' file, but it does not require a clear warning that the credential is sensitive, persistent, and may be accessible to other local processes or future sessions. This can cause inadvertent overexposure of secrets and increases the blast radius if the host or agent environment is later compromised.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This reference documents account creation and account modification endpoints that directly mutate CRM customer records, but it provides no safety guidance, confirmation requirements, or warnings about production-data impact. In an agent skill context, exposing write operations without guardrails increases the risk of accidental or unauthorized changes to customer data at scale.

Content

No source excerpt is available for this finding.

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 · references/accounts-mutations-and-pool.md (reported line 20)May include surrounding context.

  • accountType: optional (DEFAULT_TYPE / ABM_TYPE)
bash
curl -sS -X POST "https://uc.marketup.cn/api/uc/v1/account/saveV2" \
  "${CURL_HEADERS[@]}" \
  -H "Content-Type: application/json" \
  -d @create-account.json

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The reference examples instruct users to place an API key in an Authorization header and query potentially sensitive account/CRM data, but they provide no warning about secure credential handling, shell history exposure, logging, or privacy considerations for returned customer data. In a CRM/account-management skill, these examples directly operate on business and personal data, so omission of handling guidance increases the risk of accidental credential leakage or inappropriate disclosure of account information.

Content

No source excerpt is available for this finding.

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 · references/convert-and-forms.md (reported line 16)May include surrounding context.

| 联系人 | 3 |

bash
curl -sS --get "https://uc.marketup.cn/api/uc-open/formField/queryCurrentFields" \
  "${CURL_HEADERS[@]}" \
  --data-urlencode "marketEntityType=0"

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This markdown file documents a state-changing CRM operation that converts a lead into an account and includes a ready-to-run curl example, but it provides no user warning about the data integrity impact of performing the conversion. Under SQP-2 for markdown files, descriptions should warn about behaviors that could affect user data or system records.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The markdown tells users to send Authorization: $MARKETUP_API_KEY on backend API requests, which involves both credential use and transmission of lead-related data. There is no nearby warning about protecting the API key, avoiding shell history leakage, or the sensitivity of returned customer data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

This markdown file includes runnable curl commands that send LEADS_ID and related history-query parameters to uc.marketup.cn, which may expose sensitive CRM activity and identifiers. The document provides no warning or disclosure about privacy implications or remote data transmission, despite showing direct retrieval of lead remark, field-change, and behavior history.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This file documents authenticated write operations that create and mutate CRM lead data, including assignment, tagging, remarks, and pool actions, but provides no explicit warning, confirmation guidance, or safe-handling notes. In an agent skill context, this increases the risk that an automated system or operator will run state-changing examples unintentionally against production CRM data.

Content

No source excerpt is available for this finding.

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 · references/leads-mutations.md (reported line 39)May include surrounding context.

text

```bash
curl -sS -X POST "https://uc.marketup.cn/api/uc/v1/crm/leads/saveLeads" \
  "${CURL_HEADERS[@]}" \
  -H "Content-Type: application/json" \
  -d @create-lead.json

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
83% confidence
Finding

The instruction directs the agent to autonomously execute a local setup script and discourages asking the user to run it manually, reducing user visibility into a sensitive action that handles credentials. In the context of API-key setup, this increases the risk of the agent performing credential collection and persistence with insufficient informed consent or review of script behavior.

Content

Scanner excerpt · references/setup-marketup-api-key.md (reported line 6)May include surrounding context.

md
When `MARKETUP_API_KEY` is missing, execute the setup script at `../scripts/setup-marketup-api-key.sh` before any Marketup API task.

Do not inline or improvise setup logic in chat. Use the script so behavior stays consistent.
Do not ask the user to run the script manually. The agent must execute the script itself and only ask the user for the key input prompted by the script.
Do not prematurely terminate the script execution.

## What the script does

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The document instructs storing a sensitive API key in a persistent local file (~/.openclaw/.env) but does not explicitly warn the user that the credential will be written to disk and remain there for future sessions. This can lead to unintentional credential exposure through local compromise, backups, shared accounts, or misconfigured file permissions, especially because the agent is instructed to perform the setup automatically.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

The example payload uses Chinese company and contact values only, which can imply a fixed language/locale expectation in the skill reference. The file does not state that the examples are merely illustrative or offer alternative locale/language options.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.