Create a safe archive extractor script at /root/extractor.py that takes a tar archive path as its single…
Create a safe archive extractor script at /root/extractor.py that takes a tar archive path as its single…: a task in TermGrade Environments: 1,004 executable Linux tasks (Harbor dataset). The script must extract the archive's contents to /root/extracted/ ONLY IF all of the following safety…
The task
The script must extract the archive's contents to `/root/extracted/` ONLY IF all of the following safety conditions are met: 1. No extracted file path (when resolved relative to `/root/extracted/`) escapes outside `/root/extracted/` (no path traversal) 2. No extracted file is a symbolic link or hard link 3. No…
Part of ai-and/termgrade-environments.