subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
if FONT_CACHE.exists() and FONT_CACHE.stat().st_size > 1_000_000: return str(FONT_CACHE) print(f"Downloading CJK font to {FONT_CACHE} ...") subprocess.run(["curl", "-sL", FONT_URL, "-o", str(FONT_CACHE), "--max-time", "120"], check=True) return str(FONT_CACHE) # --- image generation ---- Confidence
- 91% confidence
- Finding
- The script downloads an executable font asset from the network at runtime and explicitly skips integrity verification by setting the expected SHA-256 to None. This creates a supply-chain risk: if the remote source, transport, or local temp cache is tampered with, the script will trust and use unverified content, which can lead to malicious file ingestion or denial of service via malformed font files.
