subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
try: from PIL import Image, ImageDraw, ImageFont except ImportError: subprocess.check_call([sys.executable,"-m","pip","install","pillow","-q"]) from PIL import Image, ImageDraw, ImageFont _ttf_dir = os.path.dirname(os.path.abspath(__file__))- Confidence
- 97% confidence
- Finding
- The script automatically runs pip install at runtime if Pillow is missing, which causes network access and arbitrary package installation during normal execution. This is dangerous because package resolution and installation execute untrusted external code in the current environment without user consent, expanding the attack surface well beyond the stated chart-rendering purpose.
