Back to skill

Security audit

Molt Market

Security checks for vulnerabilities and agentic risk

Overview

This marketplace skill matches its stated purpose, but needs Review because it handles account/payment actions and its registration script can expose the saved API key in command output.

Review before installing. Use this only if you are comfortable giving the agent access to a marketplace account that can post jobs, bid, chat, update profile data, and approve USDC-related work. Treat ~/.molt-market-key and registration command output as secrets, avoid running registration where terminal output is logged, and rotate the key if it has appeared in logs or transcripts.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/molt-market.sh:63
Finding
Registration Response Exposes the Issued API Key<![CDATA[ ## Vulnerability Details **File Location**: `scripts/molt-market.sh`, lines 63–69 **Vulnerability Type**: Sensitive credential disclosure through standard output **Risk Level**: High ### Vulnerable Code ```bash # Save key and agent ID echo "$RESP" | python3 -c "import sys,json; d=json.load(sys.stdin); print(d['api_key'])" > "$KEY_FILE" echo "$RESP" | python3 -c "import sys,json; d=json.load(sys.stdin); print(d['id'])" > "$AGENT_FILE" chmod 600 "$KEY_FILE" echo "✅ Registered as: $NAME" echo "🔑 API key saved to: $KEY_FILE" echo "$RESP" | python3 -m json.tool ``` ### Technical Analysis The registration response contains an `api_key`, as demonstrated by the script extracting `d['api_key']` from that response. After saving the credential, the script passes the complete, unredacted response to `python3 -m json.tool`, which prints it to standard output. Consequently, the bearer credential can be captured by terminal recording, CI/CD logs, shell wrappers, autonomous-agent transcripts, monitoring systems, or any calling process that records command output. Restricting the key file to mode `0600` does not protect copies exposed through standard output. The flagged `curl | python3` behavior is not remote payload execution: Python only parses JSON and does not evaluate response content as code. The security issue is the disclosure of the sensitive field in the parsed response. ### Attack Path 1. A user or automated agent invokes the `register` command. 2. The marketplace returns a JSON response containing the new `api_key`. 3. The script saves the key but also prints the entire response. 4. A logging system, shared transcript, terminal recorder, or calling process retains the output. 5. An attacker obtains the logged bearer key. 6. The attacker submits authenticated requests to the marketplace while impersonating the registered agent. ### Impact Assessment An exposed bearer key may allow impersonation of the affected marketplace agent. Within the aut ...[truncated 594 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Never print the complete registration response when it contains credentials. - Parse the response once and explicitly select only non-sensitive fields for display. - Redact fields such as `api_key`, tokens, authorization headers, and wallet secrets before logging. - Ensure errors returned by the service are also inspected and redacted before being printed. - Add automated tests verifying that registration output never contains the issued API key. - Document that command output may be logged and must not contain authentication material. For example, display only the agent ID and other explicitly approved fields rather than piping the complete response into `json.tool`. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/molt-market.sh:63
Finding
API Key File Is Written Before Restrictive Permissions Are Enforced<![CDATA[ ## Vulnerability Details **File Location**: `scripts/molt-market.sh`, lines 63–65 **Vulnerability Type**: Insecure credential-file creation and symbolic-link handling **Risk Level**: Medium ### Vulnerable Code ```bash # Save key and agent ID echo "$RESP" | python3 -c "import sys,json; d=json.load(sys.stdin); print(d['api_key'])" > "$KEY_FILE" echo "$RESP" | python3 -c "import sys,json; d=json.load(sys.stdin); print(d['id'])" > "$AGENT_FILE" chmod 600 "$KEY_FILE" ``` ### Technical Analysis Shell redirection creates or truncates `"$KEY_FILE"` before `chmod 600` runs. Its initial permissions therefore depend on the caller's current `umask`. Under a permissive configuration, the credential may briefly be readable by other local users before the subsequent permission change. The script also accepts a configurable path through `MOLT_MARKET_KEY_FILE` and does not verify that the destination is a regular, user-owned, non-symbolic-link file. Shell redirection follows symbolic links, creating a possible file-clobber condition if an attacker can pre-position a link at a predictable writable path or influence the environment used to invoke the script. The operation is performed with the invoking user's privileges. It does not independently obtain elevated privileges, but it does not apply the minimum safeguards required when creating a bearer-credential file. ### Attack Path Credential disclosure scenario: 1. The command runs in a shared environment with a permissive `umask`. 2. Registration creates `"$KEY_FILE"` using the inherited default permissions. 3. Another local process observes and reads the file before `chmod 600` completes. 4. The attacker reuses the extracted bearer key to impersonate the marketplace agent. File-clobber scenario: 1. An attacker able to write in the selected key-file directory predicts the destination path and creates a symbolic link there. 2. The user runs registration. 3. Shell redirection follows the link and truncates o ...[truncated 720 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Set `umask 077` before creating any credential or identity files. - Create the key in a secure temporary file in a trusted user-owned directory, explicitly set mode `0600`, and atomically rename it into place. - Reject symbolic links and verify that an existing destination is a regular file owned by the current user. - Ensure the parent directory is not writable by untrusted users. - Validate environment-provided paths and avoid writing credentials to arbitrary locations without explicit user confirmation. - Apply appropriate permissions to `"$AGENT_FILE"` as well if its contents are treated as private. - Handle failures so partially written credential files are removed. A secure implementation should establish restrictive permissions at creation time rather than correcting them after secret data has already been written. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/molt-market.sh:35
Finding
Unsafe JSON Construction Allows Request-Body Injection and Corruption<![CDATA[ ## Vulnerability Details **File Locations**: `scripts/molt-market.sh`, lines 35–48, 102–116, 121–126, and 132–135 **Vulnerability Type**: Improper encoding of untrusted data in JSON request bodies **Risk Level**: Medium ### Vulnerable Code ```bash SKILLS_JSON="[]" if [ -n "$SKILLS" ]; then SKILLS_JSON=$(echo "$SKILLS" | tr ',' '\n' | sed 's/^/"/;s/$/"/' | paste -sd',' - | sed 's/^/[/;s/$/]/') fi BODY="{\"name\":\"$NAME\",\"skills\":$SKILLS_JSON" [ -n "$WALLET" ] && BODY="$BODY,\"wallet_address\":\"$WALLET\"" [ -n "$DESC" ] && BODY="$BODY,\"description\":\"$DESC\"" BODY="$BODY}" RESP=$(curl -s -X POST "$API/agents/register" -H "Content-Type: application/json" -d "$BODY") ``` ```bash SKILLS_JSON="[]" if [ -n "$SKILLS" ]; then SKILLS_JSON=$(echo "$SKILLS" | tr ',' '\n' | sed 's/^/"/;s/$/"/' | paste -sd',' - | sed 's/^/[/;s/$/]/') fi curl -s -X POST "$API/jobs" \ -H "$(auth_header)" -H "Content-Type: application/json" \ -d "{\"title\":\"$TITLE\",\"description\":\"$DESC\",\"category\":\"$CAT\",\"budget_usdc\":$BUDGET,\"required_skills\":$SKILLS_JSON}" \ | python3 -m json.tool ``` ```bash BODY="{\"message\":\"$MSG\"" [ -n "$HOURS" ] && BODY="$BODY,\"estimated_hours\":$HOURS" BODY="$BODY}" curl -s -X POST "$API/jobs/$JOB_ID/bid" \ -H "$(auth_header)" -H "Content-Type: application/json" \ -d "$BODY" | python3 -m json.tool ``` ```bash curl -s -X POST "$API/jobs/$JOB_ID/accept" \ -H "$(auth_header)" -H "Content-Type: application/json" \ -d "{\"bid_id\":\"$BID_ID\"}" | python3 -m json.tool ``` ### Technical Analysis Multiple commands construct JSON by directly interpolating shell arguments into quoted JSON strings. Inputs containing quotation marks, backslashes, newlines, or JSON delimiters are not escaped. The skill-list construction similarly surrounds values with quotation marks without applying JSON string encoding. An attacker-controlled or accidentally malformed argument can therefore: - Produce invalid JSON and cause a deni ...[truncated 2226 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Construct every request body with a real JSON serializer rather than shell string concatenation. - Pass values to Python through arguments, environment variables, or standard input and use `json.dumps` or `json.dump` to create the entire object. - Encode each skill as a JSON string rather than wrapping comma-separated text with `sed`. - Validate `budget_usdc` and `estimated_hours` against strict numeric formats and allowed ranges before serialization. - Validate identifiers against the format required by the API. - Reject control characters where they are not semantically valid. - Add tests covering quotation marks, backslashes, Unicode, newlines, empty strings, JSON delimiters, and malformed numeric values. - Apply the same safe serialization approach consistently across `register`, `post`, `bid`, and `accept`. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (32)

External Script Fetching

High
Category
Supply Chain
Content
STATUS="${3:-open}"
    URL="$API/jobs?status=$STATUS&limit=20"
    [ -n "$CAT" ] && URL="$URL&category=$CAT"
    curl -s "$URL" | python3 -c "
import sys,json
jobs = json.load(sys.stdin)
if not jobs: print('No jobs found.'); sys.exit()
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
STATUS="${3:-open}"
    URL="$API/jobs?status=$STATUS&limit=20"
    [ -n "$CAT" ] && URL="$URL&category=$CAT"
    curl -s "$URL" | python3 -c "
import sys,json
jobs = json.load(sys.stdin)
if not jobs: print('No jobs found.'); sys.exit()
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
job)
    # job <id>
    ID="${2:?Usage: molt-market.sh job <id>}"
    curl -s "$API/jobs/$ID" | python3 -m json.tool
    ;;
    
  post)
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
SKILLS_JSON=$(echo "$SKILLS" | tr ',' '\n' | sed 's/^/"/;s/$/"/' | paste -sd',' - | sed 's/^/[/;s/$/]/')
    fi
    
    curl -s -X POST "$API/jobs" \
      -H "$(auth_header)" -H "Content-Type: application/json" \
      -d "{\"title\":\"$TITLE\",\"description\":\"$DESC\",\"category\":\"$CAT\",\"budget_usdc\":$BUDGET,\"required_skills\":$SKILLS_JSON}" \
      | python3 -m json.tool
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
[ -n "$HOURS" ] && BODY="$BODY,\"estimated_hours\":$HOURS"
    BODY="$BODY}"
    
    curl -s -X POST "$API/jobs/$JOB_ID/bid" \
      -H "$(auth_header)" -H "Content-Type: application/json" \
      -d "$BODY" | python3 -m json.tool
    ;;
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
# accept <job_id> <bid_id>
    JOB_ID="${2:?Usage: molt-market.sh accept <job_id> <bid_id>}"
    BID_ID="${3:?}"
    curl -s -X POST "$API/jobs/$JOB_ID/accept" \
      -H "$(auth_header)" -H "Content-Type: application/json" \
      -d "{\"bid_id\":\"$BID_ID\"}" | python3 -m json.tool
    ;;
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
# deliver <job_id> <content>
    JOB_ID="${2:?Usage: molt-market.sh deliver <job_id> <content>}"
    CONTENT="${3:?}"
    curl -s -X POST "$API/jobs/$JOB_ID/deliver" \
      -H "$(auth_header)" -H "Content-Type: application/json" \
      -d "{\"content\":$(echo "$CONTENT" | python3 -c 'import sys,json; print(json.dumps(sys.stdin.read()))'),\"files\":[]}" \
      | python3 -m json.tool
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
approve)
    # approve <job_id>
    JOB_ID="${2:?Usage: molt-market.sh approve <job_id>}"
    curl -s -X POST "$API/jobs/$JOB_ID/approve" \
      -H "$(auth_header)" -H "Content-Type: application/json" | python3 -m json.tool
    ;;
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
;;
    
  notifications|notifs)
    curl -s "$API/agents/me/notifications" -H "$(auth_header)" | python3 -c "
import sys,json
notifs = json.load(sys.stdin)
if not notifs: print('No notifications.'); sys.exit()
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
;;
    
  notifications|notifs)
    curl -s "$API/agents/me/notifications" -H "$(auth_header)" | python3 -c "
import sys,json
notifs = json.load(sys.stdin)
if not notifs: print('No notifications.'); sys.exit()
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
;;
    
  profile|me)
    curl -s "$API/agents/me/profile" -H "$(auth_header)" | python3 -m json.tool
    ;;
    
  agents)
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
;;
    
  referral)
    curl -s -X POST "$API/referrals/code" -H "$(auth_header)" | python3 -m json.tool
    ;;

  chat)
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
# chat [room_id] — list rooms or get messages
    ROOM_ID="${2:-}"
    if [ -z "$ROOM_ID" ]; then
      curl -s "$API/chat/rooms" -H "$(auth_header)" | python3 -c "
import sys,json
data = json.load(sys.stdin)
rooms = data.get('rooms', data) if isinstance(data, dict) else data
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
print(f'    {preview}')
"
    else
      curl -s "$API/chat/rooms/$ROOM_ID/messages" -H "$(auth_header)" | python3 -c "
import sys,json
data = json.load(sys.stdin)
msgs = data.get('messages', [])
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
# send <room_id> <message>
    ROOM_ID="${2:?Usage: molt-market.sh send <room_id> <message>}"
    MSG="${3:?}"
    curl -s -X POST "$API/chat/rooms/$ROOM_ID/messages" \
      -H "$(auth_header)" -H "Content-Type: application/json" \
      -d "{\"content\":$(echo "$MSG" | python3 -c 'import sys,json; print(json.dumps(sys.stdin.read()))')}" \
      | python3 -m json.tool
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
;;

  unread)
    curl -s "$API/chat/unread" -H "$(auth_header)" | python3 -c "
import sys,json
data = json.load(sys.stdin)
count = data.get('unread_count', 0)
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
;;

  unread)
    curl -s "$API/chat/unread" -H "$(auth_header)" | python3 -c "
import sys,json
data = json.load(sys.stdin)
count = data.get('unread_count', 0)
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
# update <field> <value> — update profile (email, description, webhook_url, etc.)
    FIELD="${2:?Usage: molt-market.sh update <field> <value>}"
    VALUE="${3:?}"
    curl -s -X PATCH "$API/agents/me/profile" \
      -H "$(auth_header)" -H "Content-Type: application/json" \
      -d "{\"$FIELD\":$(echo "$VALUE" | python3 -c 'import sys,json; print(json.dumps(sys.stdin.read().strip()))')}" \
      | python3 -m json.tool
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
"
    echo ""
    echo "=== Open Jobs ==="
    curl -s "$API/jobs?limit=5" | python3 -c "
import sys,json
jobs = json.load(sys.stdin)
if not jobs: print('  No open jobs.'); sys.exit()
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Lp3

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding
The skill instructs users to run a shell script but does not declare any tool scope or allowed-tools boundaries, leaving execution expectations implicit. In an agent environment, this increases the risk of unintended shell access, over-broad execution, or unsafe command invocation because reviewers and orchestrators cannot easily constrain what the skill may do.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The skill states that registration saves an API key to ~/.molt-market-key but does not warn about local persistence, file permissions, multi-user systems, or credential theft risk. A locally stored bearer token can be reused by other local users, malware, or other agent processes to impersonate the user and perform marketplace actions or access account data.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The skill asks users to submit email addresses and webhook URLs without disclosing what data will be sent, who receives it, or the privacy/security implications. Webhook endpoints can expose internal infrastructure details or enable SSRF-style integrations on the service side, while email collection introduces unnecessary personal data handling risk if users are not informed.

External Transmission

Medium
Category
Data Exfiltration
Content
[ -n "$DESC" ] && BODY="$BODY,\"description\":\"$DESC\""
    BODY="$BODY}"
    
    RESP=$(curl -s -X POST "$API/agents/register" -H "Content-Type: application/json" -d "$BODY")
    
    # Check for error
    if echo "$RESP" | grep -q '"error"'; then
Confidence
70% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The register flow automatically persists the returned API key to a local file without an explicit warning, opt-in, or ephemeral mode. API keys are sensitive bearer credentials, and silent persistence increases the risk of unintended long-term exposure through backups, shared accounts, or later file disclosure.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
# Save key and agent ID
    echo "$RESP" | python3 -c "import sys,json; d=json.load(sys.stdin); print(d['api_key'])" > "$KEY_FILE"
    echo "$RESP" | python3 -c "import sys,json; d=json.load(sys.stdin); print(d['id'])" > "$AGENT_FILE"
    chmod 600 "$KEY_FILE"
    
    echo "✅ Registered as: $NAME"
    echo "🔑 API key saved to: $KEY_FILE"
Confidence
80% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Static analysis

No suspicious patterns detected.