T03 · Remote Payload Retrieval and Execution
- Location
SKILL.md:95- Finding
Unpinned Remote PhenoSnap Code Is Downloaded and Executed
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 95–129
Vulnerability Type: Mutable remote code retrieval followed by local execution
Risk Level: HighVulnerable Code
text #### If `git` is available Run: - `git clone https://github.com/WGLab/PhenoSnap.git "{baseDir}/PhenoSnap"` #### If `git` is NOT available Download zip: - URL: `https://github.com/WGLab/PhenoSnap/archive/refs/heads/main.zip` - Destination: `{baseDir}/third_party/phenosnap_main.zip` Download method (pick first available): - If `curl` exists: - `curl -L "https://github.com/WGLab/PhenoSnap/archive/refs/heads/main.zip" -o "{baseDir}/third_party/phenosnap_main.zip"` - Else on Windows PowerShell: - `Invoke-WebRequest -Uri "https://github.com/WGLab/PhenoSnap/archive/refs/heads/main.zip" -OutFile "{baseDir}/third_party/phenosnap_main.zip"` Unzip (choose by OS/tools): - Windows PowerShell: - `Expand-Archive -Path "{baseDir}/third_party/phenosnap_main.zip" -DestinationPath "{baseDir}/third_party/phenosnap_unzip" -Force` - macOS/Linux with unzip: - `unzip -o "{baseDir}/third_party/phenosnap_main.zip" -d "{baseDir}/third_party/phenosnap_unzip"` If neither unzip nor Expand-Archive is available, use Python: - `python3 -c "import zipfile; z=zipfile.ZipFile(r'{baseDir}/third_party/phenosnap_main.zip'); z.extractall(r'{baseDir}/third_party/phenosnap_unzip')"` Then rename/move the extracted folder to `{baseDir}/PhenoSnap/`: - The extracted folder is typically `{baseDir}/third_party/phenosnap_unzip/PhenoSnap-main` - Move/rename to `{baseDir}/PhenoSnap/` Final check: - Verify `{baseDir}/PhenoSnap/extract_phenotypes.py` exists.The downloaded module is subsequently executed by the dependency smoke test:
text - `python3 -c "import importlib.util; spec=importlib.util.spec_from_file_location('extract_phenotypes','extract_phenotypes.py'); m=importlib.util.module_from_spec(spec); spec.loader.exec_module ...[truncated 2512 chars]- Remediation
View remediation
Remediation Suggestions
- Vendor a reviewed PhenoSnap version inside the skill package where licensing permits, or obtain it from a controlled internal artifact repository.
- If remote retrieval is required, pin an immutable commit or versioned release rather than the default branch.
- Publish the expected SHA-256 digest in the reviewed skill and reject the artifact unless its digest matches.
- Where available, verify a release signature against a pinned, trusted maintainer key.
- Replace the executable import smoke test with static checks or a sandboxed subprocess. Importing a module is code execution.
- Execute the extractor in an isolated environment with outbound network access disabled after installation.
- Restrict filesystem access to the HPO file, redacted input, output directory, and dedicated application directory.
- Require explicit user or administrator approval before downloading and executing a new upstream version.
