T08 · Insecure Dependencies
- Location
scripts/mind_map_generator.py:151- Finding
Unverified Mutable Remote Font Dependency
- Content
View full analysis
Path: cache_dir = Path.home() / ".cache" / "mind-map-skill" cache_dir.mkdir(parents=True, exist_ok=True) return cache_dir / "chinese_font.ttc" def _ensure_cached_font() -> Optional[str]: cached = _get_cached_font_path() if cached.exists() and cached.stat().st_size > 1024: return str(cached) try: with urllib.request.urlopen(FONT_DOWNLOAD_URL, timeout=8) as resp: data = resp.read() if len(data) > 1024: cached.write_bytes(data) return str(cached) except Exception: return None return None ``` The dependency specification is also not version-locked: ```text pillow>=10.0.0 ``` ### Technical Analysis On first use, the application downloads a binary TrueType Collection font from the `main` branch of a personal GitHub repository. The `main` branch is mutable, so the downloaded content can change after the Skill has been reviewed. The implementation only verifies that the response contains more than 1,024 bytes. It does not verify: - A cryptographic digest or digital signature - An immutable source revision - The response content type - The expected font format or headers - A maximum permitted response size - The identity or integrity of a previously cached file The downloaded binary is subsequently passed to `ImageFont.truetype()`, which causes Pillow and its underlying font-processing stack to parse attacker-influenced data. Malformed fonts have historically represented a native parser attack surface. The broad `p ...[truncated 1834 chars]- Remediation
View remediation
