T09 · Insecure Skill Coding Practices
- Location
scripts/firecrawl.sh:14- Finding
Arbitrary Shell Execution Through Sourced Environment Files
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a coherent Remotion video generator, but it exposes local previews publicly and handles environment files, scraping, downloads, and npm execution with insufficient safeguards.
Install only if you are comfortable with the agent scraping public websites through Firecrawl, downloading remote assets, running npm/npx commands, and exposing the local Remotion preview through a public tunnel. Avoid using it in sensitive repositories or directories with untrusted .env files, and require manual approval before scraping non-public URLs or opening any tunnel.
scripts/firecrawl.sh:14Arbitrary Shell Execution Through Sourced Environment Files
scripts/firecrawl.sh:30JSON Request Injection Through Unescaped Website URL
scripts/firecrawl.sh:67Unrestricted Download of Server-Supplied Asset URLs
SKILL.md:35Mandatory Public Exposure of an Unauthenticated Development Server
template/package.json:8Non-Reproducible npm Installation Without a Lockfile
scripts/remotion.sh:26Unconstrained Project Destination and Unsafe JSON Substitution
This code chunk does not implement an AI video production workflow or any Remotion-based video generation. Its sole behavior is scraping a target website via Firecrawl, extracting brand information and image links, and optionally downloading visual assets such as screenshots, logos, favicons, OG images, and page images. The description does mention FIRECRAWL_API_KEY for website scraping and brand asset extraction, which aligns with this helper script, but the declared primary purpose is video creation. Since the actual code's primary purpose is brand scraping/asset collection and lacks any video-production behavior, this is a material description-to-behavior mismatch.
The code is related to Remotion and video production tooling, so it partially aligns with the general domain. However, the declared description specifically advertises an AI video production workflow and says it requires FIRECRAWL_API_KEY for website scraping and brand asset extraction. This code does none of that: it only wraps Remotion commands for project initialization, rendering, still capture, previewing, listing compositions, and upgrading dependencies. The primary behavior is a local developer utility for Remotion projects, not an AI-driven production workflow with scraping/asset extraction. Therefore the description materially overstates and misrepresents the implemented capabilities.
The skill instructs starting a local dev server and exposing it publicly through a Cloudflare tunnel, then sharing the URL, without any required warning, consent, or access controls. Publicly exposing a development server can leak project contents, enable unauthorized access, and expose the host to risks if the dev server or adjacent resources are misconfigured.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
#
# Returns structured brand data + downloads reusable assets (logo, OG image, screenshot).
# If output-dir is provided, assets are saved there. Otherwise only JSON is printed.
# Requires FIRECRAWL_API_KEY in environment or .env
set -euo pipefail
The script automatically sources .env files from the workspace, skill directory, and current directory, treating them as executable shell code rather than simple key-value data. If any of those files are attacker-controlled or untrusted, this enables arbitrary command execution and unauthorized access to any secrets defined there, which is especially risky in an agent/workspace context.
SKILL_DIR="$(dirname "$SCRIPT_DIR")"
WORKSPACE_DIR="$(dirname "$(dirname "$SKILL_DIR")")"
# Load .env from multiple locations
for envfile in "$WORKSPACE_DIR/.env" "$SKILL_DIR/.env" .env; do
if [ -f "$envfile" ]; then
set -a; source "$envfile"; set +a
Using source "$envfile" executes the contents of each discovered .env file in the current shell with exported variables enabled. In this skill context, where repository or workspace files may be influenced by users or other tools, that creates a direct code-execution and secret-loading primitive from untrusted local files.
WORKSPACE_DIR="$(dirname "$(dirname "$SKILL_DIR")")"
# Load .env from multiple locations
for envfile in "$WORKSPACE_DIR/.env" "$SKILL_DIR/.env" .env; do
if [ -f "$envfile" ]; then
set -a; source "$envfile"; set +a
fi
The skill clearly instructs use of shell commands (bash, npm, curl, npx) but does not declare any explicit tool scope such as permissions or allowed-tools. That creates an authorization gap where a caller may not understand that the skill can execute code and make network requests, increasing the chance of overbroad or unintended command execution.
The trigger description is broad enough to activate the skill for many generic video-related prompts, which can cause unnecessary shell execution, scraping, dependency installation, or public tunneling in contexts where the user did not intend those actions. In an agent setting, overbroad invocation increases the attack surface and the chance of risky side effects from routine prompts.
The skill directs website scraping and automatic asset downloads, including curl fetches and Firecrawl usage, without explicit disclosure about network access, third-party processing, or trust of downloaded content. This can lead to unreviewed data exfiltration to external services, collection of copyrighted or sensitive assets, and ingestion of untrusted files into the workspace.
Using npx remotion without a pinned version allows retrieval or execution of whatever package version resolves at runtime, which can change over time or be compromised upstream. This creates a supply-chain risk and reduces reproducibility of the environment.
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
const [handle] = useState(() => delayRender());
useEffect(() => {
fetch("https://api.example.com/data")
.then((r) => r.json())
.then((d) => { setData(d); continueRender(handle); });
}, []);
This hard-coded external endpoint confirms the script sends collected target data to a remote SaaS API outside the local trust boundary. In this skill context, external transmission is intentional, but it becomes dangerous if agents can be induced to scrape confidential, intranet, or user-sensitive URLs and exfiltrate their contents through the vendor API.
exit 1
fi
RESPONSE=$(curl -s -X POST 'https://api.firecrawl.dev/v1/scrape' \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer ${FIRECRAWL_API_KEY}" \
-d "$(cat <<PAYLOAD
This hard-coded external endpoint confirms the script sends collected target data to a remote SaaS API outside the local trust boundary. In this skill context, external transmission is intentional, but it becomes dangerous if agents can be induced to scrape confidential, intranet, or user-sensitive URLs and exfiltrate their contents through the vendor API.
exit 1
fi
RESPONSE=$(curl -s -X POST 'https://api.firecrawl.dev/v1/scrape' \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer ${FIRECRAWL_API_KEY}" \
-d "$(cat <<PAYLOAD
The script invokes npx remotion render without pinning a specific package version, so execution may resolve to whatever version is available locally or fetched at runtime. In automation or agent contexts this creates a supply-chain risk: a malicious or compromised package version could be executed unexpectedly, and behavior may change between runs.
The still command also uses unpinned npx remotion, which can download or execute an unexpected package version. Because this wrapper is meant to run code-generation/rendering workflows, any compromised dependency could execute arbitrary code in the user's environment during the render step.
Running npx remotion compositions without version pinning exposes the workflow to dependency drift and potential malicious package substitution. Even a non-render command still executes package code, so the risk is code execution, not just incorrect output.
The upgrade path calls npx remotion upgrade without an explicit version, which is especially risky because it intentionally changes dependencies and may fetch the latest package code. In an agent skill, this increases supply-chain exposure and can introduce unreviewed changes or malicious code execution.
The package scripts invoke npx remotion without pinning the executable version in the command itself. Although remotion is listed as a dependency, npx may still resolve or fetch an unexpected version depending on environment and tooling behavior, which can introduce supply-chain risk or non-reproducible builds if a compromised or incompatible package is executed.
The build script uses npx remotion without version pinning at execution time. In automated or fresh environments this can lead to retrieval or execution of an unintended package version, creating supply-chain exposure and reducing build reproducibility.
The render script executes npx remotion render without explicitly pinning the resolved package version. If the execution environment permits network resolution or falls back to a remote package, an attacker controlling the supply chain or a typo/conflict scenario could cause arbitrary code execution during rendering.
The upgrade script runs npx remotion upgrade without a pinned executable version, which is especially sensitive because upgrade commands modify dependency state. An unexpected or malicious resolved package could alter the project or execute arbitrary code under developer credentials.
No suspicious patterns detected.