T09 · Insecure Skill Coding Practices
- Location
scripts/generate_podcast.py:382- Finding
Batch Item Identifier Allows Arbitrary File Writes Outside the Output Directory
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This Doubao podcast skill is mostly purpose-aligned, but it needs review because its batch generator can write MP3 files outside the chosen output folder and its trigger scope is broader than its vendor-specific implementation.
Review before installing. Use this only for Doubao/ByteDance podcast TTS work, avoid processing sensitive articles or text unless you accept sending them to ByteDance, store generated MP3s in a controlled location, and do not run batch JSON from untrusted sources until file IDs are validated to prevent path traversal. Prefer a reviewed commit and pinned dependencies.
scripts/generate_podcast.py:382Batch Item Identifier Allows Arbitrary File Writes Outside the Output Directory
README.md:14Installation Instructions Use Mutable and Unpinned Third-Party Sources
The core declared purpose mostly matches the code: it is indeed a Doubao/ByteDance podcast TTS implementation that parses WebSocket binary frames, handles streaming audio, extracts audio_url from PodcastEnd, and explicitly works around timeout/stuck SessionFinished behavior. However, the description is materially broader than the actual code in several areas. The code does not implement browser-app integration patterns, caching logic, or article metadata extraction. More importantly, the description says the skill should be used for any podcast TTS or podcast generation task even without Doubao mention, while the code is tightly coupled to a specific ByteDance endpoint, header scheme, frame protocol, and event IDs. That trigger scope and some declared capabilities are broader than what the supplied code actually supports, so this should be flagged as a mismatch.
The trigger text is overly broad and instructs use for generic podcast TTS tasks even without Doubao context, which can cause misrouting of unrelated requests into a skill that assumes a specific vendor protocol and authentication model. In an automated agent setting, over-broad routing increases the risk of inappropriate handling of secrets, incorrect API usage, and file-persistence behavior being applied where it was not intended.
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 | Missing `ping_timeout=120` | WebSocket disconnects during generation |
| 5 | Discarding audio chunks on disconnect | Losing already-generated content |
| 6 | `audio_url` expires in 24 hours | CDN returns 403 after expiry |
| 7 | Python stdout buffering with nohup | No real-time logs |
| **8** | **Browser WebSocket can't set custom headers** | **Must use server-side proxy** |
| **9** | **`duration_sec` often returns 0** | **Need to estimate from audio size** |
| **10** | **RoundStart round 1 text is empty** | **Head music, real content from round 2** |
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 | Missing `ping_timeout=120` | WebSocket disconnects during generation |
| 5 | Discarding audio chunks on disconnect | Losing already-generated content |
| 6 | `audio_url` expires in 24 hours | CDN returns 403 after expiry |
| 7 | Python stdout buffering with nohup | No real-time logs |
| **8** | **Browser WebSocket can't set custom headers** | **Must use server-side proxy** |
| **9** | **`duration_sec` often returns 0** | **Need to estimate from audio size** |
| **10** | **RoundStart round 1 text is empty** | **Head music, real content from round 2** |
This markdown file documents behavior that can affect user data and privacy: content is sent through a server-side proxy to Doubao, articles may be scraped, and audio/content may be cached locally. Under the markdown-specific warning criterion, the description should explicitly disclose these behaviors and their implications, but no such warning is present in the README.
The skill describes implementations that rely on environment-held credentials, local file persistence, and reading/writing generated content, but it declares no explicit tool scope or permissions boundary. In an agent ecosystem, this can cause the skill to be invoked with broader-than-expected capabilities, increasing the chance of unintended secret access or file-system writes without clear user consent.
The guidance explicitly recommends downloading generated MP3s to local storage but does not warn about persistence, path handling, retention, or access controls. This can lead implementers to store potentially sensitive generated audio on disk by default, creating privacy exposure and increasing the blast radius if the host is shared or compromised.
The recommended production design caches source URLs, titles, audio files, and durations without any privacy, consent, or retention guidance. Even if operationally useful, retaining source-linked media and metadata can create a durable record of user activity or content that may be sensitive, especially in multi-tenant or regulated environments.
The file presents core descriptive and instructional content in Chinese alongside English, but does not indicate language options or user choice. If organizational policy requires avoiding forced language/locale assumptions, this can be a natural-language policy issue because some users may not be able to follow the guidance.
This code file contains its primary docstring, CLI description, and usage guidance entirely in Chinese, which imposes a specific language on users without any opt-in or alternative locale. The policy allows locale constraints only when explicitly justified or when users are given a choice, neither of which is present here.