Back to skill

Security audit

拆书成视频 Skill

Security checks for vulnerabilities and agentic risk

Overview

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.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
Findings (4)

T01 · Skill Instruction Hijacking

Error
Location
scripts/generate.py:62
Finding

Hardcoded Promotional Content Injected into Generated Videos

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
README.md:35
Finding

Unpinned Third-Party Dependency Installation

Content
View full analysis
Remediation
View remediation
edge-tts== ``` 2. Generate and commit a lockfile containing transitive dependencies. 3. Use cryptographic hashes and install with `pip --require-hashes`. 4. Document the expected package index and consider enforcing it with `--index-url`. 5. Run dependency vulnerability and license scans during releases. 6. Use an isolated virtual environment with only the permissions required to create the requested output. 7. Establish a controlled update process in which dependency upgrades are reviewed and tested before changing pins. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/generate.py:227
Finding

Unrestricted Download of API-Provided Image URLs

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/generate.py:505
Finding

Insufficient Path Sanitization and Unsafe FFmpeg Concat Manifests

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
Findings (33)

Tainted flow: 'headers' from os.environ.get (line 202, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/generate.py (reported line 155)May include surrounding context.

python
"temperature": 0.8,
        }
        try:
            resp = requests.post(
                f"{ARK_BASE_URL}/chat/completions",
                headers=headers,
                json=payload,

Tainted flow: 'headers' from os.environ.get (line 202, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/generate.py (reported line 218)May include surrounding context.

python
}
        for attempt in range(2):
            try:
                resp = requests.post(
                    f"{ARK_BASE_URL}/images/generations",
                    headers=headers,
                    json=payload,

Tainted flow: 'headers' from os.environ.get (line 202, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/generate.py (reported line 251)May include surrounding context.

python
}
    for attempt in range(3):
        try:
            resp = requests.post(
                f"{ARK_BASE_URL}/images/generations",
                headers=headers,
                json=payload,

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding

Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 33)May include surrounding context.

md
python scripts/generate.py --book "被讨厌的勇气" --style cinematic --sentences 10

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 56)May include surrounding context.

md
python scripts/generate.py --book "被讨厌的勇气" --style cinematic --sentences 10

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 59)May include surrounding context.

md
python scripts/generate.py --book "被讨厌的勇气" --style cinematic --sentences 10

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/generate.py (reported line 596)May include surrounding context.

python
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):

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/generate.py (reported line 598)May include surrounding context.

python
# 从 .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:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

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.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/generate.py (reported line 155)May include surrounding context.

python
"temperature": 0.8,
        }
        try:
            resp = requests.post(
                f"{ARK_BASE_URL}/chat/completions",
                headers=headers,
                json=payload,

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

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.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/generate.py (reported line 218)May include surrounding context.

python
}
        for attempt in range(2):
            try:
                resp = requests.post(
                    f"{ARK_BASE_URL}/images/generations",
                    headers=headers,
                    json=payload,

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/generate.py (reported line 251)May include surrounding context.

python
}
        for attempt in range(2):
            try:
                resp = requests.post(
                    f"{ARK_BASE_URL}/images/generations",
                    headers=headers,
                    json=payload,

Tainted flow: 'img_url' from requests.post (line 227, network input) → requests.get (network output)

Medium
Category
Data Flow
Confidence
83% confidence
Finding

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.

Content

Scanner excerpt · scripts/generate.py (reported line 229)May include surrounding context.

python
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

Tainted flow: 'img_url' from requests.post (line 227, network input) → requests.get (network output)

Medium
Category
Data Flow
Confidence
83% confidence
Finding

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.

Content

Scanner excerpt · scripts/generate.py (reported line 262)May include surrounding context.

python
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 call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/generate.py (reported line 306)May include surrounding context.

python
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

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

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.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/generate.py (reported line 370)May include surrounding context.

python
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 call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/generate.py (reported line 461)May include surrounding context.

python
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