T03 · Remote Payload Retrieval and Execution
Error
- Location
- scripts/install.sh:16
- Finding
- Mutable and Unverified Third-Party Components Are Downloaded and Executed<![CDATA[ ## Vulnerability Details **File Location**: `scripts/install.sh:16-18`, `scripts/install.sh:35-38`, `scripts/install.sh:58-65`, `scripts/install.sh:72-80`, `scripts/download_models.py:11-15`, `scripts/download_models.py:65-70`, `scripts/tts.py:11-16`, `scripts/tts.py:70-76` **Vulnerability Type**: Unverified remote code retrieval and insecure dependency management **Risk Level**: High ### Vulnerable Code From `scripts/install.sh:16-18`: ```bash echo "❌ Conda not found. Installing Miniconda..." curl -LO https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-arm64.sh bash Miniconda3-latest-MacOSX-arm64.sh -b -p $HOME/miniconda3 ``` From `scripts/install.sh:35-38`: ```bash cd "$WORKSPACE" git clone --recursive https://github.com/FunAudioLLM/CosyVoice.git cosyvoice3-repo cd "$COSYVOICE_REPO" git submodule update --init --recursive ``` From `scripts/install.sh:58-65`: ```bash pip install torch==2.3.1 torchaudio==2.3.1 --index-url https://download.pytorch.org/whl/cpu # Install core dependencies echo "📦 Installing dependencies..." pip install transformers==4.51.3 modelscope onnxruntime soundfile librosa numpy==1.26.4 pip install conformer==0.3.2 diffusers==0.29.0 fastapi==0.115.6 gradio==5.4.0 pip install hydra-core==1.3.2 HyperPyYAML==1.2.2 inflect==7.3.1 lightning==2.2.4 pip install matplotlib==3.7.5 networkx==3.1 omegaconf==2.3.0 onnx==1.16.0 pip install protobuf==4.25 pydantic==2.7.0 pyworld==0.3.4 rich==13.7.1 pip install tensorboard==2.14.0 x-transformers==2.11.24 wetext==0.0.4 wget==3.2 ``` From `scripts/install.sh:72-80`: ```python try: from modelscope import snapshot_download model_dir = '/Users/lhz/.openclaw/workspace/cosyvoice3-repo/pretrained_models/Fun-CosyVoice3-0.5B' if os.path.exists(model_dir): print(" Model already downloaded") else: print(" Downloading Fun-CosyVoice3-0.5B...") snapshot_download('FunAudioLLM/Fun-CosyVoice3-0.5B-2512', local_dir=model_dir) ``` From `scripts/down ...[truncated 4457 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. **Pin and verify Miniconda** - Replace the `latest` URL with a fixed, reviewed Miniconda release. - Store the expected SHA-256 digest in the installation script or a signed manifest. - Verify the digest before invoking the installer. - Abort installation if verification fails. 2. **Pin repository and submodule revisions** - Clone without immediately trusting the remote default branch. - Check out a specific reviewed CosyVoice commit. - Pin every submodule to its expected commit and verify that the checked-out revisions match a maintained allowlist. - Consider distributing a signed source archive with a verified digest. 3. **Lock Python dependencies** - Move dependencies into a lock file generated from reviewed package versions. - Pin every direct and transitive dependency. - Use hashes and install with a command such as `pip install --require-hashes -r requirements.lock`. - Use an approved package index or internal artifact mirror where possible. - Add automated dependency vulnerability and provenance scanning. 4. **Pin and validate models** - Specify immutable ModelScope revisions where supported. - Maintain trusted checksums for downloaded model files. - Reject unexpected files and unsafe serialization formats. - Prefer formats that do not permit arbitrary object deserialization. 5. **Reduce import trust** - Do not insert an unverified external repository at the beginning of `sys.path`. - Package and install reviewed CosyVoice code into the isolated environment after integrity validation. - Validate the repository revision before every import if an editable source tree is required. 6. **Harden execution** - Run installation and inference as an unprivileged account. - Never recommend running the installer with `sudo`. - Restrict filesystem and network access during installation and model inference where feasible. - Record resolved versions, commit h ...[truncated 76 chars]
