T03 · Remote Payload Retrieval and Execution
- Location
README.md:70- Finding
Unpinned Remote Model Code Can Execute Locally
- Content
View full analysis
Vulnerability Details
File Location:
README.md, lines 70-75
Vulnerability Type: Remote payload execution through a mutable model repository and unpinned dependencies
Risk Level: HighComplete Code Snippet:
bash pip install funasr modelscope # Download model from ModelScope python -c " from funasr import AutoModel model = AutoModel(model='iic/SenseVoiceSmall', trust_remote_code=True, device='cuda:0') result = model.generate(input='test.wav')Technical Analysis
The documented call enables
trust_remote_code=True, allowing Python code supplied by the remote model repository to execute on the local system. The model identifier does not specify an immutable revision, commit, or verified artifact hash. Thefunasrandmodelscopepackages are also installed without pinned versions or hashes.Consequently, the code ultimately executed by a user can change after this Skill has been reviewed. Compromise of the model publisher, model repository, package publisher, dependency chain, or delivery infrastructure could result in arbitrary Python execution.
This behavior appears in optional documentation and is not automatically invoked by
scripts/tts.py. Exploitation therefore requires a user to follow the documented alternative ASR setup.Attack Path
- An attacker compromises the referenced model repository, publisher account, dependency, or package distribution channel.
- The attacker introduces malicious Python code into a model revision or dependency that remains compatible with the documented mutable identifiers.
- A user follows the README and installs the unpinned packages.
- The user executes the documented
AutoModelcall withtrust_remote_code=True. - The malicious remote code executes with the same operating-system privileges and environment access as the invoking user.
Impact Assessment
Successful exploitation permits arbitrary code execution with the invo ...[truncated 442 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove
trust_remote_code=Trueand use a model implementation provided by a reviewed, locally installed library whenever possible. - If remote model code is unavoidable, pin the model to a reviewed immutable commit or revision.
- Verify downloaded model files and code against cryptographic hashes or signed release metadata.
- Pin
funasr,modelscope, and their transitive dependencies to reviewed versions and install them using a hash-locked requirements file. - Load third-party models in a sandbox or container with no sensitive mounts, minimal filesystem permissions, restricted outbound networking, and no inherited credentials.
- Explicitly warn users that enabling remote model code executes third-party Python and is not required for the core TTS function.
- Remove
