Security context

What an agent needs to avoid regressing past fixes and find the next vuln in this repo.

binary-husky/gpt_academic
master @ d6bde0f
27
Fixes
29
CVEs
CRITICAL
Peak severity
47.8%
Coverage
Highlights
Path Traversal: 9 prior fixes. Scrutinize any change in this area.
main.py: most-fixed (6 issues). Treat as high-risk during review.
21 high-severity fixes in this history; regressions here are high-impact.
Recurring patterns

The bug types that recur here, drawn from past fixes, not open vulnerabilities.

Arbitrary Code Execution: The application relies on pickle deserialization for parsing user metadata and LaTeX caches, leading to direct code execution when processing untrusted inputs. Although safe subclass unpicklers were developed, they required constant maintenance and were ultimately replaced by standard JSON serialization.
Path Traversal: User uploads of compressed archives (tar, zip, rar) allowed directory traversal and symlink-based arbitrary file writes on extraction. Proper canonicalization and absolute prefix validation must be continuously enforced during archive parsing.
Command Injection: Subprocess execution for external utilities (like Nougat document processing) historically ran with shell=True or unvalidated shell strings, enabling immediate host takeover. Command arguments must be passed strictly as sanitized lists with shell execution disabled.