T08 · Insecure Dependencies
- Location
scripts/cli.py:117- Finding
Unpinned Dependencies and Mutable Remote Model Supply Chain
- Content
View full analysis
Vulnerability Details
File Location:
scripts/cli.py:117-118
Vulnerability Type: Unpinned remote model dependency
Risk Level: MediumVulnerable Code
python model_dir = snapshot_download("pengzhendong/Fun-ASR-Nano-int8") return sherpa_onnx.OfflineRecognizer.from_funasr_nano(The associated installation instructions at
SKILL.md:43also install unpinned Python dependencies:bash pip install sherpa-onnx soundfile modelscopeTechnical Analysis
The Skill retrieves
pengzhendong/Fun-ASR-Nano-int8from ModelScope without specifying an immutable revision or validating expected artifact hashes. The effective model contents can therefore change after the Skill has been reviewed. The documented Python dependencies are similarly installed without pinned versions or hashes, leaving package selection dependent on mutable package-index state.This creates a third-party supply-chain trust boundary. Compromise of a dependency release, package source, ModelScope account, model repository, or mutable model revision could cause users to retrieve modified components. Malicious Python packages can execute code during installation or import. Crafted model artifacts may also exploit vulnerabilities in native model parsers or runtimes when loaded.
The automatic download additionally conflicts with the documentation's claim that the Skill operates completely offline and requires no network connection. No evidence was found that the code uploads audio, credentials, or environment data.
Attack Path
- An attacker compromises a listed package distribution channel, the ModelScope publisher account, or the mutable model repository.
- The attacker publishes a malicious package release or replaces model artifacts referenced by the unpinned repository identifier.
- A user follows the installation instructions or runs the CLI in an environment where the model is not already cached.
- The environment ...[truncated 831 chars]
- Remediation
View remediation
Remediation Suggestions
- Pin all direct and transitive Python dependencies to reviewed versions in a lock file.
- Require cryptographic hashes for downloaded Python distributions, such as with
pip --require-hashes. - Pin the ModelScope model to a reviewed immutable revision rather than resolving the repository's current state.
- Maintain and verify expected SHA-256 hashes for every model, tokenizer, and ONNX artifact before loading it.
- Replace automatic model retrieval with an explicit installation step, or require a local model-directory argument at runtime.
- Store reviewed artifacts in a controlled registry or mirror with provenance and access controls.
- Run installation and inference under a dedicated, unprivileged account or sandbox with minimal filesystem and network access.
- Update the documentation to disclose that initial setup requires network access, while clearly documenting how to operate in a strictly offline mode afterward.
