T09 · Insecure Skill Coding Practices
- Location
scripts/_common.sh:3- Finding
Arbitrary Shell Command Execution Through Unsafe Configuration Loading
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill matches its Pexo video-generation purpose, but it needs review because its shell helpers execute a local config file and can send the API key to any configured base URL.
Install only if you are comfortable sending video prompts and uploaded media to Pexo. Keep ~/.pexo/config private and writable only by you, set PEXO_BASE_URL to https://pexo.ai unless you intentionally use another trusted endpoint, and avoid using this skill for sensitive or proprietary files without confirming Pexo's retention and deletion policies.
scripts/_common.sh:3Arbitrary Shell Command Execution Through Unsafe Configuration Loading
scripts/_common.sh:7Bearer API Key Disclosure Through Unvalidated Base URL
Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.
http_code=$(curl -sS --connect-timeout 10 --max-time 60 -X "$method" -H "$(_pexo_auth_header)" -H "Content-Type: application/json" -D "$header_file" -o "$body_file" -w '%{http_code}' "$@" "${PEXO_BASE_URL}${path}" 2>"$err_file") || curl_status=$?
fi
response=$(cat "$body_file"); export PEXO_LAST_HTTP_CODE="${http_code:-0}"
if [[ $curl_status -ne 0 && "${http_code:-0}" == "000" ]]; then echo "Network error: $(cat "$err_file")" >&2; rm -f "$body_file" "$header_file" "$err_file"; return 1; fi
if [[ "${http_code:-0}" -ge 400 ]]; then echo "HTTP $http_code: $response" >&2; rm -f "$body_file" "$header_file" "$err_file"; return 1; fi
echo "$response"; rm -f "$body_file" "$header_file" "$err_file"
}
Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.
http_code=$(curl -sS --connect-timeout 10 --max-time 60 -X "$method" -H "$(_pexo_auth_header)" -H "Content-Type: application/json" -D "$header_file" -o "$body_file" -w '%{http_code}' "$@" "${PEXO_BASE_URL}${path}" 2>"$err_file") || curl_status=$?
fi
response=$(cat "$body_file"); export PEXO_LAST_HTTP_CODE="${http_code:-0}"
if [[ $curl_status -ne 0 && "${http_code:-0}" == "000" ]]; then echo "Network error: $(cat "$err_file")" >&2; rm -f "$body_file" "$header_file" "$err_file"; return 1; fi
if [[ "${http_code:-0}" -ge 400 ]]; then echo "HTTP $http_code: $response" >&2; rm -f "$body_file" "$header_file" "$err_file"; return 1; fi
echo "$response"; rm -f "$body_file" "$header_file" "$err_file"
}
Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.
http_code=$(curl -sS --connect-timeout 10 --max-time 60 -X "$method" -H "$(_pexo_auth_header)" -H "Content-Type: application/json" -D "$header_file" -o "$body_file" -w '%{http_code}' "$@" "${PEXO_BASE_URL}${path}" 2>"$err_file") || curl_status=$?
fi
response=$(cat "$body_file"); export PEXO_LAST_HTTP_CODE="${http_code:-0}"
if [[ $curl_status -ne 0 && "${http_code:-0}" == "000" ]]; then echo "Network error: $(cat "$err_file")" >&2; rm -f "$body_file" "$header_file" "$err_file"; return 1; fi
if [[ "${http_code:-0}" -ge 400 ]]; then echo "HTTP $http_code: $response" >&2; rm -f "$body_file" "$header_file" "$err_file"; return 1; fi
echo "$response"; rm -f "$body_file" "$header_file" "$err_file"
}
The skill explicitly supports revising existing videos by reusing the same project_id, which introduces session persistence across interactions. If project identifiers are reused or surfaced without sufficient scoping and confirmation, later prompts may access or modify prior project state, causing unintended disclosure or actions within an ongoing external session.
---
name: pexoai-agent
description: Create professional short videos (5–60 seconds) for TikTok, Instagram Reels, YouTube Shorts, and brand ads using AI. Use when the user wants to: make a video, create a TikTok, produce a product ad, generate a promo clip, make UGC content, create social media videos, or any video creation task. Supports product videos, lifestyle content, explainer clips, and more — with automatic scriptwriting, shot composition, transitions, and music. Also handles video revision requests. Pexo outputs 16:9, 9:16 (vertical), or 1:1 aspect ratios.
homepage: https://pexo.ai
repository: https://github.com/pexoai/pexo-skills
requires: env:PEXO_API_KEY,PEXO_BASE_URL runtime:curl,jq,file
The skill description contains very broad invocation triggers such as 'any video creation task' and multiple generic social-media/video phrases. This can cause the agent to invoke the skill in situations the user did not clearly intend, increasing the chance that prompts, files, or project context are sent to an external video service unnecessarily.
The workflow instructs the agent to upload files and send the user's exact request to Pexo, but it does not include a clear user-facing disclosure that prompts, uploaded media, and project metadata are transmitted to a third-party service. This creates a privacy and data-handling risk because users may unknowingly share sensitive or proprietary content externally.
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
4. Generate a new API key
5. Copy it (starts with `sk-...`)
### 2. Create the Config File
Create a file at `~/.pexo/config` with:
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
| Error | Cause | Fix |
|-------|-------|-----|
| `Missing PEXO_API_KEY` | Config not found | Create `~/.pexo/config` |
| `INVALID_TOKEN` | Wrong or expired API key | Regenerate at pexo.ai |
| `404 Project not found` | Wrong project ID | Check project ID from create step |
| `rate limit exceeded` | Too many requests | Wait 60s and retry |
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
local body_file header_file err_file response http_code curl_status=0
body_file=$(mktemp); header_file=$(mktemp); err_file=$(mktemp)
if [[ -n "$body" ]]; then
http_code=$(curl -sS --connect-timeout 10 --max-time 60 -X "$method" -H "$(_pexo_auth_header)" -H "Content-Type: application/json" -D "$header_file" -o "$body_file" -w '%{http_code}' -d "$body" "$@" "${PEXO_BASE_URL}${path}" 2>"$err_file") || curl_status=$?
else
http_code=$(curl -sS --connect-timeout 10 --max-time 60 -X "$method" -H "$(_pexo_auth_header)" -H "Content-Type: application/json" -D "$header_file" -o "$body_file" -w '%{http_code}' "$@" "${PEXO_BASE_URL}${path}" 2>"$err_file") || curl_status=$?
fi
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
if [[ -n "$body" ]]; then
http_code=$(curl -sS --connect-timeout 10 --max-time 60 -X "$method" -H "$(_pexo_auth_header)" -H "Content-Type: application/json" -D "$header_file" -o "$body_file" -w '%{http_code}' -d "$body" "$@" "${PEXO_BASE_URL}${path}" 2>"$err_file") || curl_status=$?
else
http_code=$(curl -sS --connect-timeout 10 --max-time 60 -X "$method" -H "$(_pexo_auth_header)" -H "Content-Type: application/json" -D "$header_file" -o "$body_file" -w '%{http_code}' "$@" "${PEXO_BASE_URL}${path}" 2>"$err_file") || curl_status=$?
fi
response=$(cat "$body_file"); export PEXO_LAST_HTTP_CODE="${http_code:-0}"
if [[ $curl_status -ne 0 && "${http_code:-0}" == "000" ]]; then echo "Network error: $(cat "$err_file")" >&2; rm -f "$body_file" "$header_file" "$err_file"; return 1; fi
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
pexo_post_sse_ack() {
local path="$1"; local body="${2:-}"; local timeout="${3:-20}"
pexo_require_config
curl -sS -N --connect-timeout 10 --max-time "$timeout" -X POST -H "$(_pexo_auth_header)" -H "Content-Type: application/json" -H "Accept: text/event-stream" -d "$body" "${PEXO_BASE_URL}${path}" 2>/dev/null | sed '/^: stream opened$/q' >/dev/null
}
The script performs a network PUT upload of the provided file to a remote URL, which transmits user data off-host. Aside from argument validation, there is no confirmation prompt, logging, comment, or docstring in this file warning the user that the specified file will be uploaded to a remote service.
This code file makes an HTTP/API call to create a project via /api/biz/projects, which is a state-changing remote operation. The script contains no confirmation prompt, user-facing notice, or inline warning indicating that running it will create a remote resource.