T01 · Skill Instruction Hijacking
- Location
scripts/generate.py:62- Finding
Hardcoded Promotional Content Injected into Generated Videos
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill appears intended to make book-summary videos, but it needs review because it combines API-key use, third-party services, shell media processing, file writes, and some under-disclosed or under-scoped behavior.
Install only if you are comfortable sending book titles, prompts, generated text, and narration text to third-party services, and review generated scripts before publishing. Prefer a virtual environment with pinned dependencies, a scoped ARK_API_KEY, a controlled output directory, and avoid untrusted book/output values until path and URL validation are tightened.
scripts/generate.py:62Hardcoded Promotional Content Injected into Generated Videos
README.md:35Unpinned Third-Party Dependency Installation
scripts/generate.py:227Unrestricted Download of API-Provided Image URLs
scripts/generate.py:505Insufficient Path Sanitization and Unsafe FFmpeg Concat Manifests
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
"temperature": 0.8,
}
try:
resp = requests.post(
f"{ARK_BASE_URL}/chat/completions",
headers=headers,
json=payload,
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
}
for attempt in range(2):
try:
resp = requests.post(
f"{ARK_BASE_URL}/images/generations",
headers=headers,
json=payload,
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
}
for attempt in range(3):
try:
resp = requests.post(
f"{ARK_BASE_URL}/images/generations",
headers=headers,
json=payload,
Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.
Referenced artifact was not completely inspected
python scripts/generate.py --book "被讨厌的勇气" --style cinematic --sentences 10
Referenced artifact was not completely inspected
python scripts/generate.py --book "被讨厌的勇气" --style cinematic --sentences 10
Referenced artifact was not completely inspected
python scripts/generate.py --book "被讨厌的勇气" --style cinematic --sentences 10
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
help="跳过文案生成,用已有的 JSON")
args = parser.parse_args()
# 从 .env 文件加载 ARK_API_KEY
if not ARK_API_KEY:
env_path = os.path.expanduser("~/.baoyu-skills/.env")
if os.path.exists(env_path):
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# 从 .env 文件加载 ARK_API_KEY
if not ARK_API_KEY:
env_path = os.path.expanduser("~/.baoyu-skills/.env")
if os.path.exists(env_path):
with open(env_path) as f:
for line in f:
The README states that the skill sends content to external services for ARK text generation, 豆包 image generation, and Microsoft edge-tts, but it does not warn users that book titles, prompts, generated text, and voice content may be transmitted to third-party providers. This creates a real privacy and compliance risk, especially if users adapt the skill for sensitive, copyrighted, or internal material and assume processing is local.
The parameter table specifies the book name as Chinese and all documented voice options are zh-CN voices, while the README does not present this as an optional or justified locale-specific constraint. This is a natural-language locale policy concern because the documentation effectively mandates a specific language/locale without user opt-in.
The skill documents capabilities that imply access to environment variables, filesystem, network, and shell execution, but it does not declare any explicit tool scope or permission boundaries. In an agent ecosystem, this increases the chance of over-privileged execution or unsafe invocation because reviewers and enforcement layers cannot easily constrain what the skill is allowed to do.
The trigger set contains broad phrases such as 'book video' and generic production terms that could match ordinary user requests outside the intended scope. Over-broad activation can cause unintended invocation of a skill that performs network access, file writes, and shell-based media rendering, increasing the attack surface and the chance of surprising side effects.
The read-when conditions are broad and ambiguous, including general user desires like making a book into a short video or mentioning related tools. This raises the likelihood that the skill will auto-activate in contexts where the user did not intend execution, which is risky given the skill's ability to call APIs, access secrets, write files, and invoke ffmpeg.
The parameter table specifies the book title as Chinese and defaults the voice to a Chinese locale (zh-CN-YunxiNeural), while the rest of the instructions assume Chinese text and Windows Chinese font assets. The file does not offer an explicit user opt-in or language/locale choice, so it imposes a locale-specific behavior by default.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"temperature": 0.8,
}
try:
resp = requests.post(
f"{ARK_BASE_URL}/chat/completions",
headers=headers,
json=payload,
The code submits prompts containing the provided book name and generation instructions to a remote chat completions API. While network use is central to the feature, the code lacks an explicit user-facing notice in arguments, startup logs, or comments that input data will be transmitted to external services.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
}
for attempt in range(2):
try:
resp = requests.post(
f"{ARK_BASE_URL}/images/generations",
headers=headers,
json=payload,
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
}
for attempt in range(2):
try:
resp = requests.post(
f"{ARK_BASE_URL}/images/generations",
headers=headers,
json=payload,
This code performs a second-stage network fetch using a URL supplied by a prior remote response, with no origin or content validation. In an automation skill that handles external content, that increases risk because a malicious or tampered API response could redirect the script to retrieve internal resources or malicious payloads for local storage.
if "data" in data and len(data["data"]) > 0:
img_url = data["data"][0].get("url")
if img_url:
img_data = requests.get(img_url, timeout=60).content
with open(output_path, "wb") as f:
f.write(img_data)
return True
The script downloads an image from a URL returned by a remote API without validating the scheme, host, content type, or size. If the upstream service or response is compromised, this can become a server-side request forgery or unsafe file download path, causing connections to unexpected internal or attacker-controlled endpoints and writing untrusted content to disk.
if "data" in data and len(data["data"]) > 0:
img_url = data["data"][0].get("url")
if img_url:
img_data = requests.get(img_url, timeout=60).content
with open(output_path, "wb") as f:
f.write(img_data)
return True
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
img = Image.new("RGB", (w, h), c)
img.save(path, "JPEG", quality=85)
except Exception:
subprocess.run([
"ffmpeg", "-y", "-f", "lavfi", "-i",
f"color=c=0x{c[0]:02x}{c[1]:02x}{c[2]:02x}:s={w}x{h}:d=1",
"-frames:v", "1", path
The text for each script line is sent through edge-tts, which is a network-backed TTS workflow, and the returned audio is written to disk. The code names the dependency but does not clearly warn users that their text content will be sent to an external service.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
if not audio_path or not os.path.exists(audio_path):
return 3.0
try:
result = subprocess.run(
["ffprobe", "-v", "quiet", "-show_entries", "format=duration",
"-of", "default=noprint_wrappers=1:nokey=1", audio_path],
capture_output=True, text=True, timeout=10
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
output_path
]
result = subprocess.run(cmd, capture_output=True, text=True, timeout=60)
if result.returncode != 0:
print(f" ⚠️ FFmpeg 渲染失败: {result.stderr[-200:]}")
return False