-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Open
Description
Describe the bug
CosyVoice contains several insecure-by-default behaviors in runtime/example code that can expose deployments to avoidable security risk:
- Broad CORS (
allow_origins=["*"]) in FastAPI runtime service. - TLS certificate validation disabled (
verify=False) in reward client. - Remote dataset code execution enabled (
trust_remote_code=True) in inference scripts. - Unsafe checkpoint deserialization (
weights_only=False) in Triton model loaders. - Shell invocation in utility (
os.system('sed ...')) where in-process file editing is safer.
Files in Questions
- server.py
- reward_tts.py
- file_utils.py
- streaming_inference.py
- token2wav_dit.py
- offline_inference.py
- model.py
To Reproduce
- Go to
runtime/python/fastapi/server.pyand run the server with defaults. - From any browser origin, call inference endpoints and observe permissive CORS behavior.
- Go to
examples/grpo/cosyvoice2/reward_tts.pyand run score request against a TLS endpoint with invalid cert. - Observe request still proceeds due to
verify=False. - Go to
runtime/triton_trtllm/streaming_inference.py(oroffline_inference.py) and run dataset loading. - Observe
load_dataset(..., trust_remote_code=True)executes remote code if dataset defines it. - Go to Triton model loaders and observe
torch.load(..., weights_only=False)forspk2info.pt.
Expected behavior
- Default CORS should be restricted (localhost or explicit allow-list).
- TLS verification should be on by default.
trust_remote_codeshould be opt-in, not default.- Model loading should prefer
weights_only=Truewhen feasible. - Avoid shell command execution for local file edits.
## Screenshots
N/A (code-level security issue).
## Desktop (please complete the following information):
- OS: macOS
- Browser: Chrome
- Version: latest
## Smartphone (please complete the following information):
- Device: N/A
- OS: MacOs
- Browser: Chrome
- Version: N/A
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels