T09 · Insecure Skill Coding Practices
- Location
instant-article.sh:6- Finding
Arbitrary Shell Execution Through Sourced Credential Files
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill does what it says broadly, but it can automatically publish YouTube-derived content and images to third-party services while loading broad local credential files.
Review before installing. Use this only if you want YouTube summaries turned into public or externally hosted Telegraph articles. Do not point it at private, unlisted, sensitive, or embargoed videos unless you accept that frames and generated text may leave your machine. Avoid the wrapper and fixed .env sourcing; provide only the needed TELEGRAPH_TOKEN and OPENAI_API_KEY through a scoped environment or secret manager, and treat debug mode as retaining local extracted media.
instant-article.sh:6Arbitrary Shell Execution Through Sourced Credential Files
scripts/generate.sh:15Predictable Temporary Directory Used for Untrusted File Operations
scripts/generate.sh:38Debug Mode Retains Extracted Video Frames in Shared Temporary Storage
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
./scripts/setup.sh
This creates a Telegraph account and outputs your access token.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
./scripts/setup.sh
This creates a Telegraph account and outputs your access token.
The manifest frames the skill as a YouTube summarization/formatting helper, but the instructions reveal stronger side effects: uploading extracted images to catbox.moe, publishing content to Telegraph, and invoking an external summarize pipeline. That mismatch is dangerous because users may provide a URL expecting local summarization while the skill actually redistributes derived content and sends data to multiple third parties without clear consent or disclosure.
The manifest frames the skill as a YouTube summarization/formatting helper, but the instructions reveal stronger side effects: uploading extracted images to catbox.moe, publishing content to Telegraph, and invoking an external summarize pipeline. That mismatch is dangerous because users may provide a URL expecting local summarization while the skill actually redistributes derived content and sends data to multiple third parties without clear consent or disclosure.
The explicit instruction to source /Users/viticci/clawd/.env grants the skill access to whatever secrets are stored in that file, not just the minimum needed for the task. In an agent-execution environment, this creates an unnecessary credential exposure path and could enable abuse of unrelated tokens if the script or downstream tools are compromised or over-permissive.
source /Users/viticci/clawd/.env && {baseDir}/scripts/generate.sh "$ARGUMENTS"
Referencing access tokens is not inherently malicious, but declaring reliance on a Telegraph access token confirms the skill performs authenticated external actions beyond simple summarization. That increases risk because the token can be used to publish content or act on behalf of the operator if mishandled, logged, or exposed through debugging or subprocess behavior.
## Environment Variables
Required environment variables are loaded from `/Users/viticci/clawd/.env`:
- `TELEGRAPH_TOKEN` - Telegraph API access token
- `OPENAI_API_KEY` - For GPT-5.2 summarization
## Output
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/bin/bash
# Wrapper script - sources .env and runs generate.sh
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
# Source .env if it exists
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#!/bin/bash
# Wrapper script - sources .env and runs generate.sh
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
# Source .env if it exists
source "$SCRIPT_DIR/.env" executes the contents of .env as shell code in the current process, which can expose credentials, alter execution flow, or run arbitrary commands if the file is malicious or unexpectedly modified. Because this skill only needs to transform YouTube content, loading executable configuration from disk is unnecessary and makes the wrapper materially more dangerous.
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
# Source .env if it exists
[[ -f "$SCRIPT_DIR/.env" ]] && source "$SCRIPT_DIR/.env"
[[ -f "$HOME/clawd/.env" ]] && source "$HOME/clawd/.env"
exec "$SCRIPT_DIR/scripts/generate.sh" "$@"
source "$HOME/clawd/.env" is especially risky because it imports and executes a broad user-scoped shared environment file outside the skill directory, increasing the chance of privilege boundary crossing, secret leakage, or arbitrary code execution from unrelated configuration. In the context of a content-processing skill, this behavior is not aligned with the stated purpose and significantly increases the attack surface.
# Source .env if it exists
[[ -f "$SCRIPT_DIR/.env" ]] && source "$SCRIPT_DIR/.env"
[[ -f "$HOME/clawd/.env" ]] && source "$HOME/clawd/.env"
exec "$SCRIPT_DIR/scripts/generate.sh" "$@"
The skill uses 'shell' capability that is not listed in its permissions. This may indicate deceptive intent or missing permission declarations.
Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.
[[ -z "$URL" ]] && { echo "Usage: $0 <youtube_url> [--slides-max N]"; exit 1; }
# Cleanup
cleanup() { [[ "$DEBUG" == "false" ]] && rm -rf "$SLIDES_DIR" 2>/dev/null || true; }
trap cleanup EXIT
mkdir -p "$SLIDES_DIR"
The script prints a live Telegraph access token directly to stdout and instructs the user to store it in shell profiles or a project .env file. While this is not active credential theft, exposing tokens in terminal history, logs, shared shells, or repository-adjacent .env files increases the chance of credential leakage and unauthorized article/account access.
echo ""
echo " export TELEGRAPH_TOKEN=\"$TOKEN\""
echo ""
echo "Or create a .env file in your project:"
echo ""
echo " echo 'TELEGRAPH_TOKEN=$TOKEN' >> .env"
echo ""
The instruction to append TELEGRAPH_TOKEN to a .env file encourages storing a credential in a commonly committed or shared project file. In the context of an install/setup script for a content-processing skill, this raises the risk of accidental disclosure through version control, backups, CI logs, or team sharing.
echo ""
echo "Or create a .env file in your project:"
echo ""
echo " echo 'TELEGRAPH_TOKEN=$TOKEN' >> .env"
echo ""
echo "To manage your articles, visit:"
echo " $AUTH_URL"
The README explicitly states that extracted slides are uploaded to catbox.moe and published via Telegraph, but it does not clearly warn users that video-derived content and metadata will be sent to third-party services. In a skill intended to process user-supplied YouTube URLs by default, this can cause unintended external sharing of user-requested content and generated artifacts, creating privacy and data-handling risk.
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.
mkdir -p ~/.summarize
echo '{"model": "openai/gpt-5.2"}' > ~/.summarize/config.json
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.
Create ~/.summarize/config.json:
{
"model": "openai/gpt-5.2"
The quick-start command sources a fixed local .env file before running the script, exposing the skill to local secret material unrelated to the immediate user request. In an agent context, instructing execution with sourced credentials broadens the trust boundary and can enable unintended use of API keys or tokens during processing and publication.
The skill describes outputs and architecture but does not warn that summaries and extracted slide images are uploaded to Telegraph and catbox.moe. In this context, the omission is meaningful because the skill is marked as the default handler for YouTube links, increasing the chance that users trigger external publication without understanding the data flow.
Extracted video slides are uploaded to catbox.moe, a third-party file host, without any visible consent gate or disclosure in the script flow. This can expose user-requested content, potentially including private/unlisted video material or generated frames, to an external service outside the primary publication target.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
echo "🌐 Publishing..." >&2
RESPONSE=$(curl -s -X POST "https://api.telegra.ph/createPage" \
-H "Content-Type: application/json" \
-d "$(jq -n \
--arg t "$TELEGRAPH_TOKEN" \
The script sends the TELEGRAPH_TOKEN in a POST request to api.telegra.ph to create a page. Although the script checks for the environment variable and logs that publishing is occurring, it does not clearly disclose to the user that their access token is being transmitted to a remote service as part of publication.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
echo "Creating Telegraph account..."
# Create Telegraph account
RESPONSE=$(curl -s "https://api.telegra.ph/createAccount" \
-d "short_name=$SHORT_NAME" \
-d "author_name=$AUTHOR_NAME")
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
echo "Creating Telegraph account..."
# Create Telegraph account
RESPONSE=$(curl -s "https://api.telegra.ph/createAccount" \
-d "short_name=$SHORT_NAME" \
-d "author_name=$AUTHOR_NAME")
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
echo "Creating Telegraph account..."
# Create Telegraph account
RESPONSE=$(curl -s "https://api.telegra.ph/createAccount" \
-d "short_name=$SHORT_NAME" \
-d "author_name=$AUTHOR_NAME")
No suspicious patterns detected.