Skip to content

Commit e0e3708

Browse files
authored
fix: Ensure model name cannot be used to escape model repository (#8400)
1 parent 4a12210 commit e0e3708

File tree

1 file changed

+5
-0
lines changed
  • python/openai/openai_frontend/engine/utils

1 file changed

+5
-0
lines changed

python/openai/openai_frontend/engine/utils/triton.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,11 @@ def _get_vllm_lora_names(
362362
repo_paths = [repo_paths]
363363
for repo_path in repo_paths:
364364
model_path = os.path.join(repo_path, model_name)
365+
if os.path.normpath(model_path) != model_path:
366+
raise ValueError(
367+
f"Invalid model name: '{model_name}'. Model names must be valid file-system-path segment names."
368+
)
369+
model_path = os.path.normpath(model_path)
365370
if not os.path.isdir(model_path):
366371
# Cloud path?
367372
return None

0 commit comments

Comments
 (0)