T09 · Insecure Skill Coding Practices
- Location
scripts/step7_summary_report.py:182- Finding
Workspace Escape and Arbitrary File Overwrite Through Unvalidated Output Name
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill has a coherent scientific docking purpose, but its helper scripts allow an untrusted executable path and an output-name path escape that users should review before installing.
Install only if you trust the user inputs and execution environment. Run the scripts in a dedicated least-privilege workspace, use a trusted absolute AutoDock Vina path, avoid attacker-controlled --vina_path and --output_name values, and do not run the report generator where unintended .md or .docx overwrites would be harmful.
scripts/step7_summary_report.py:182Workspace Escape and Arbitrary File Overwrite Through Unvalidated Output Name
scripts/step6_vina_docking.py:57Caller-Controlled AutoDock Vina Executable Allows Executable Substitution
The skill instructs use of local scripts, saving files, and running docking tooling, which implies shell execution and file writes, yet it declares no explicit tool scope or permission boundaries. Without an allowlist, an agent may execute broader-than-intended commands or write files in unexpected locations, increasing the risk of misuse if the skill or downstream inputs are adversarial or malformed.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
'obabel', '-ipdb', pdb_file,
'-opdbqt', '-O', output_path, '-xr'
]
result = subprocess.run(cmd, capture_output=True, text=True)
if result.returncode != 0:
raise RuntimeError(f"obabel failed: {result.stderr}")
print(f" Receptor prepared: {output_path}")
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
'obabel', '-ipdb', pdb_file,
'-opdbqt', '-O', output_path, '-xr'
]
result = subprocess.run(cmd, capture_output=True, text=True)
if result.returncode != 0:
raise RuntimeError(f"obabel failed: {result.stderr}")
print(f" Receptor prepared: {output_path}")
The script executes a user-controllable binary path via --vina_path, so an attacker who can influence that argument can cause arbitrary local program execution under the script's privileges. In a research workflow skill that may be run on shared compute or automation infrastructure, this is more dangerous than a normal CLI helper because the script explicitly treats the executable path as data from the caller and runs it without trust checks.
]
print(f"\nRunning Vina...")
result = subprocess.run(cmd, capture_output=True, text=True, cwd=output_dir)
output = result.stdout + result.stderr
print(output[-2000:])
The module docstring lists two outputs, including alignment_visualization.txt, implying the script generates both numerical results and a text visualization. In implementation, only alignment_results.json is written at L66-L68, and the alignment text is merely embedded inside the JSON object rather than saved as a separate text file.
The script creates an output directory and writes generated files including receptor.pdbqt, ligand.pdbqt, and docking_summary.json. While it prints status messages after some actions, there is no upfront warning in the module docstring or CLI help that running the skill will create or overwrite artifacts in the specified output directory.