T09 · Insecure Skill Coding Practices
- Location
scripts/build_course_skill.py:1071- Finding
Arbitrary Directory Deletion Through an Unsanitized Skill Name
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill has a legitimate learning-workflow purpose, but some installer and processing scripts can unsafely delete, overwrite, or expose local files if misused or given hostile inputs.
Review before installing. Use a dedicated environment, pin or inspect dependencies, configure only trusted HTTPS provider endpoints, avoid --force with untrusted skill names, and do not process sensitive course material through external services unless you accept that provider exposure. The artifact does not show deliberate malware, but the unsafe file-handling issues should be fixed before broad use.
scripts/build_course_skill.py:1071Arbitrary Directory Deletion Through an Unsanitized Skill Name
scripts/parse_mineru_documents.py:125Zip Slip in MinerU OCR Result Extraction
install_as_skill.sh:122API Secrets Handled Through a Predictable Shared Temporary File
requirements.txt:1Unbounded Dependencies Installed Into the Active Python Environment
The destination URL is taken from an environment variable and used directly for authenticated requests carrying the Bearer API key and prompt contents. If an attacker can influence deployment environment variables or configuration, they can redirect traffic to an arbitrary host and capture credentials and submitted data, creating an SSRF/exfiltration path.
last_error: Exception | None = None
for model in models:
try:
response = requests.post(
url,
headers={
"Authorization": f"Bearer {api_key}",
The image-analysis request posts to a URL derived from an environment variable while attaching the Authorization header and embedding local image bytes in the request body. A malicious or compromised configuration can therefore exfiltrate both sensitive local file contents and the API key to an attacker-controlled endpoint.
for model in models:
try:
print(f" 🚀 图像模型: {model}, images={len(image_paths)}", flush=True)
response = requests.post(
url,
headers={
"Authorization": f"Bearer {api_key}",
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
while True:
if timeout > 0 and time.time() - started > timeout:
raise TimeoutError(f"MinerU parse timeout after {timeout}s: {batch_id}")
response = requests.get(url, headers=mineru_headers(token), timeout=60)
response.raise_for_status()
result = response.json()
if result.get("code") != 0:
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
with open(audio_path, "rb") as f:
mime_type = mimetypes.guess_type(audio_path)[0] or "application/octet-stream"
response = requests.post(
f"{AUDIO_TRANSCRIBE_BASE_URL.rstrip('/')}/audio/transcriptions",
headers={"Authorization": f"Bearer {AUDIO_TRANSCRIBE_API_KEY}"},
files={"file": (os.path.basename(audio_path), f, mime_type)},
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# Copy this file to .env and fill only the providers you actually use.
# Do not commit .env. Keep tokens, private endpoints, and local course paths out of git.
# Audio transcription: OpenAI-compatible /audio/transcriptions
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# Copy this file to .env and fill only the providers you actually use.
# Do not commit .env. Keep tokens, private endpoints, and local course paths out of git.
# Audio transcription: OpenAI-compatible /audio/transcriptions
Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.
- A traceable organization of the course knowledge and working methods.
- A sensible learning path with practical exercises.
- Feedback on concrete attempts, revision guidance, and review suggestions.
- Clear statements about material completeness, evidence strength, and capability boundaries.
- A personal method proposal only after enough practice, and only with your approval.
When the material is rich enough, Lineage can support full coaching. When it supports explanation but not reliable practice or assessment, the Skill clearly falls back to source lookup or guided learning instead of pretending to be a complete mentor.
Use of external audio transcription APIs plus local multimedia tooling such as ffmpeg/ffprobe introduces both outbound data transfer and local command execution surfaces that are not clearly bounded in the permission model. In the context of processing user-supplied media, this raises confidentiality risk and increases the blast radius if the host grants unrestricted shell or filesystem access.
Use of external audio transcription APIs plus local multimedia tooling such as ffmpeg/ffprobe introduces both outbound data transfer and local command execution surfaces that are not clearly bounded in the permission model. In the context of processing user-supplied media, this raises confidentiality risk and increases the blast radius if the host grants unrestricted shell or filesystem access.
Use of external audio transcription APIs plus local multimedia tooling such as ffmpeg/ffprobe introduces both outbound data transfer and local command execution surfaces that are not clearly bounded in the permission model. In the context of processing user-supplied media, this raises confidentiality risk and increases the blast radius if the host grants unrestricted shell or filesystem access.
Use of external audio transcription APIs plus local multimedia tooling such as ffmpeg/ffprobe introduces both outbound data transfer and local command execution surfaces that are not clearly bounded in the permission model. In the context of processing user-supplied media, this raises confidentiality risk and increases the blast radius if the host grants unrestricted shell or filesystem access.
Use of external audio transcription APIs plus local multimedia tooling such as ffmpeg/ffprobe introduces both outbound data transfer and local command execution surfaces that are not clearly bounded in the permission model. In the context of processing user-supplied media, this raises confidentiality risk and increases the blast radius if the host grants unrestricted shell or filesystem access.
Use of external audio transcription APIs plus local multimedia tooling such as ffmpeg/ffprobe introduces both outbound data transfer and local command execution surfaces that are not clearly bounded in the permission model. In the context of processing user-supplied media, this raises confidentiality risk and increases the blast radius if the host grants unrestricted shell or filesystem access.
Use of external audio transcription APIs plus local multimedia tooling such as ffmpeg/ffprobe introduces both outbound data transfer and local command execution surfaces that are not clearly bounded in the permission model. In the context of processing user-supplied media, this raises confidentiality risk and increases the blast radius if the host grants unrestricted shell or filesystem access.
Use of external audio transcription APIs plus local multimedia tooling such as ffmpeg/ffprobe introduces both outbound data transfer and local command execution surfaces that are not clearly bounded in the permission model. In the context of processing user-supplied media, this raises confidentiality risk and increases the blast radius if the host grants unrestricted shell or filesystem access.
Use of external audio transcription APIs plus local multimedia tooling such as ffmpeg/ffprobe introduces both outbound data transfer and local command execution surfaces that are not clearly bounded in the permission model. In the context of processing user-supplied media, this raises confidentiality risk and increases the blast radius if the host grants unrestricted shell or filesystem access.
Use of external audio transcription APIs plus local multimedia tooling such as ffmpeg/ffprobe introduces both outbound data transfer and local command execution surfaces that are not clearly bounded in the permission model. In the context of processing user-supplied media, this raises confidentiality risk and increases the blast radius if the host grants unrestricted shell or filesystem access.
Use of external audio transcription APIs plus local multimedia tooling such as ffmpeg/ffprobe introduces both outbound data transfer and local command execution surfaces that are not clearly bounded in the permission model. In the context of processing user-supplied media, this raises confidentiality risk and increases the blast radius if the host grants unrestricted shell or filesystem access.
Use of external audio transcription APIs plus local multimedia tooling such as ffmpeg/ffprobe introduces both outbound data transfer and local command execution surfaces that are not clearly bounded in the permission model. In the context of processing user-supplied media, this raises confidentiality risk and increases the blast radius if the host grants unrestricted shell or filesystem access.
Use of external audio transcription APIs plus local multimedia tooling such as ffmpeg/ffprobe introduces both outbound data transfer and local command execution surfaces that are not clearly bounded in the permission model. In the context of processing user-supplied media, this raises confidentiality risk and increases the blast radius if the host grants unrestricted shell or filesystem access.
Use of external audio transcription APIs plus local multimedia tooling such as ffmpeg/ffprobe introduces both outbound data transfer and local command execution surfaces that are not clearly bounded in the permission model. In the context of processing user-supplied media, this raises confidentiality risk and increases the blast radius if the host grants unrestricted shell or filesystem access.
Use of external audio transcription APIs plus local multimedia tooling such as ffmpeg/ffprobe introduces both outbound data transfer and local command execution surfaces that are not clearly bounded in the permission model. In the context of processing user-supplied media, this raises confidentiality risk and increases the blast radius if the host grants unrestricted shell or filesystem access.
Use of external audio transcription APIs plus local multimedia tooling such as ffmpeg/ffprobe introduces both outbound data transfer and local command execution surfaces that are not clearly bounded in the permission model. In the context of processing user-supplied media, this raises confidentiality risk and increases the blast radius if the host grants unrestricted shell or filesystem access.
Use of external audio transcription APIs plus local multimedia tooling such as ffmpeg/ffprobe introduces both outbound data transfer and local command execution surfaces that are not clearly bounded in the permission model. In the context of processing user-supplied media, this raises confidentiality risk and increases the blast radius if the host grants unrestricted shell or filesystem access.
Use of external audio transcription APIs plus local multimedia tooling such as ffmpeg/ffprobe introduces both outbound data transfer and local command execution surfaces that are not clearly bounded in the permission model. In the context of processing user-supplied media, this raises confidentiality risk and increases the blast radius if the host grants unrestricted shell or filesystem access.