HF RL Explorer

Create a safe archive extractor script at /root/extractor.py that extracts tar archives while preventing…

Create a safe archive extractor script at /root/extractor.py that extracts tar archives while preventing…: a task in TermGrade Environments: 1,004 executable Linux tasks (Harbor dataset). The script must: - Accept exactly one argument: path to a tar file - Extract contents to a directory named…

The task

The script must: - Accept exactly one argument: path to a tar file - Extract contents to a directory named after the archive (e.g., `archive.tar.gz` → `archive/`) created in the current working directory - REJECT extraction if ANY file in the archive would extract outside the target directory (path traversal via…

Part of ai-and/termgrade-environments.