T09 · Insecure Skill Coding Practices
- Location
scripts/text_to_speech.py:406- Finding
Batch Output Path Traversal Allows Writes Outside the Designated Directory
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This speech-generation skill is mostly aligned with its purpose, but it includes unsafe guidance to disable Codex approval controls and has a batch output path weakness.
Install only if you are comfortable using a local CLI that sends your text to the OpenAI Audio API and writes generated audio files. Do not follow the documented approval_policy = "never" or --ask-for-approval never guidance unless you fully understand the broader Codex security impact; prefer approving the specific speech command instead. Treat batch JSONL files as trusted input, avoid --force on untrusted batches, and review any per-job out paths before running.
scripts/text_to_speech.py:406Batch Output Path Traversal Allows Writes Outside the Designated Directory
references/codex-network.md:11Network Troubleshooting Guidance Recommends Disabling Agent Approval Controls
SKILL.md:41OpenAI SDK Is Installed Without Version or Integrity Pinning
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
python "$TTS_GEN" speak-batch --input tmp/speech/jobs.jsonl --out-dir out --rpm 50
rm -f tmp/speech/jobs.jsonl
Notes:
The document advises users to set approval_policy = "never" and enable network access in a persistent agent config, which materially weakens execution safeguards for future sessions. In the context of a skill that requires outbound API calls, this guidance can normalize disabling approvals and expanding trust boundaries, increasing the chance that untrusted code or prompts trigger networked actions without user review.
If you trust the repo and want fewer prompts, enable network access for the relevant sandbox mode and relax the approval policy.
Example ~/.codex/config.toml pattern:
approval_policy = "never"
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.
if instructions and model in {"tts-1", "tts-1-hd"}:
_warn("instructions are not supported for tts-1 / tts-1-hd; ignoring.")
return None
return instructions
def _print_payload(payload: Dict[str, Any]) -> None:
The skill instructs the agent to read files, access environment configuration, install dependencies, and make live network API calls, but it declares no explicit tool scope or permission boundaries. That mismatch can cause the agent to invoke higher-risk capabilities implicitly, increasing the chance of overreach, accidental secret exposure, or unauthorized network/file access during normal skill execution.
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
2. Set `OPENAI_API_KEY` as an environment variable in their system.
3. Offer to guide them through setting the environment variable for their OS/shell if needed.
- Never ask the user to paste the full key in chat. Ask them to set it locally and confirm when ready.
If installation isn't possible in this environment, tell the user which dependency is missing and how to install it locally.
This is a markdown/manifest-context trigger description, so SQP-1 applies. Phrases like "accessibility reads" and "audio prompts" are relatively open-ended and the file does not provide negative examples or a bounded activation context, which could cause unintended invocation for general audio-related requests.
The markdown specifies "Voice: cedar" as a default, which can function as a language/locale or presentation constraint without any indication that the user may choose alternatives. Under the policy rule, fixed defaults that may impose a specific locale or voice characteristic without opt-in can be considered a natural-language policy concern.
Dynamic getattr() with a non-literal attribute name can access arbitrary object attributes, potentially bypassing access controls.
def _extract_retry_after_seconds(exc: Exception) -> Optional[float]:
for attr in ("retry_after", "retry_after_seconds"):
val = getattr(exc, attr, None)
if isinstance(val, (int, float)) and val >= 0:
return float(val)
msg = str(exc)