T09 · Insecure Skill Coding Practices
- Location
scripts/convert.py:77- Finding
Predictable Shared Temporary Files Permit Local File Clobbering
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a coherent PDF conversion skill, but its install guidance and temporary-file handling create review-worthy local environment and file-safety risks.
Install only if you are comfortable with a local PDF converter that writes converted files to disk and uses third-party PDF libraries. Prefer using a virtual environment instead of the documented --break-system-packages commands, avoid running conversion as root or administrator, and be careful with sensitive PDFs until the temporary-file handling is fixed.
scripts/convert.py:77Predictable Shared Temporary Files Permit Local File Clobbering
INSTALL.md:24Unpinned Dependencies Are Installed into the System Python Environment
该文档从标题开始即以中文提供全部安装说明,未见任何语言选择、双语支持或对仅限中文的明确说明。根据规则,强制特定语言且没有用户选择或合理限定,属于自然语言层面的语言/地区策略违例。
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
Ubuntu/Debian:
sudo apt-get install poppler-utils
Windows:
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
Ubuntu/Debian:
sudo apt-get install poppler-utils
Windows:
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
Ubuntu/Debian:
sudo apt-get install poppler-utils
Windows:
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
Ubuntu/Debian:
sudo apt-get install poppler-utils
Windows:
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
Ubuntu/Debian:
sudo apt-get install poppler-utils
Windows:
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
Ubuntu/Debian:
sudo apt-get install poppler-utils
Windows:
Natural-language guidance throughout the skill is presented only in Chinese, including usage instructions and troubleshooting. Per the policy, forcing a specific language without user opt-in or justification is a locale-policy violation unless the skill clearly offers alternatives or documents a justified region-specific scope.
This Python file contains user-facing docstrings and printed messages entirely in Chinese, including status output and installation instructions. Under the policy rule for natural-language violations, forcing a specific language without user opt-in is a locale/language policy issue when no alternative or justification is provided.
Dynamic import() can load arbitrary modules at runtime, bypassing static analysis and potentially importing malicious code.
import_name = package_name
try:
__import__(import_name)
return True
except ImportError:
return False
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
def check_poppler():
"""检查 poppler 是否已安装"""
try:
result = subprocess.run(['which', 'pdfinfo'],
capture_output=True, text=True)
return result.returncode == 0
except:
This code file contains natural-language strings that force a specific language for usage instructions, error messages, and help output. Under the policy, language restrictions should either offer user opt-in/choice or be explicitly justified as region-specific.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
print(" pip3 install --break-system-packages pdf2image python-pptx pdf2docx Pillow")
print("\n还需要安装 poppler:")
print(" macOS: brew install poppler")
print(" Ubuntu: sudo apt-get install poppler-utils")
sys.exit(1)
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
print(" pip3 install --break-system-packages pdf2image python-pptx pdf2docx Pillow")
print("\n还需要安装 poppler:")
print(" macOS: brew install poppler")
print(" Ubuntu: sudo apt-get install poppler-utils")
sys.exit(1)
The script's description and usage messages are entirely in Chinese, and there is no indication that language selection is optional or that the tool is intentionally limited to a Chinese-speaking context. This can violate language/locale policy when a skill imposes a specific language without user opt-in.
This markdown file uses Chinese throughout headings, instructions, examples, and FAQs, which effectively imposes a specific language on users. Under the policy rule, language constraints should either be optional for users or explicitly justified as region-specific.
This is a markdown file, so SQP-2 applies to omissions in user-facing warnings. The usage section shows commands that generate converted files, including batch mode, but does not explicitly disclose that the skill will create output files on disk and may produce multiple files when run on a directory.
This markdown file documents that outputs are written either to a specified path or, by default, alongside the source PDF, and also supports batch conversion. Because file creation can affect user data locations and disk contents, the skill description should explicitly warn users that running it will create new PPTX/DOCX files, especially in batch mode.
The log method is documented and implemented as taking only a single message argument, yet batch_convert calls self.log(f"[{i}/{len(pdf_files)}] ", end="") at L178 as if it were a print-like wrapper supporting keyword arguments. This is an intent/code divergence because the surrounding code treats the helper as having behavior it does not actually implement, leading to a runtime failure in batch mode.
This code invokes a converter to transform the input PDF into a PPTX or DOCX, which likely creates a new file on disk. In this file there is no explicit confirmation, user-facing notice, or comment warning that the operation will write output files, so the file-writing behavior is not disclosed here.
No suspicious patterns detected.