-
Notifications
You must be signed in to change notification settings - Fork 176
fix: Add input validation to model load #404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR improves the security and reliability of the Python backend stub launcher by replacing shell-based command execution with direct process execution and adding input validation. The changes eliminate shell injection vulnerabilities and add safeguards against malicious input.
- Replaces
bash -c
shell execution with directexecv
/execve
calls - Adds input validation for model names and shared memory region names
- Implements custom environment handling for Python virtual environments
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
File | Description |
---|---|
src/stub_launcher.cc | Refactored stub process launching to use direct execution instead of shell commands, added input validation |
src/pb_utils.h | Added utility function declarations for input validation and environment handling |
src/pb_utils.cc | Implemented input validation and environment parsing utilities |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work preventing injection into stub launch command!
What does the PR do?
Simplify the model load command by invoking the python backend stub without shell interpretation. Additionally add checks for invalid characters in provided model names
Checklist
<commit_type>: <Title>
Commit Type:
Check the conventional commit type
box here and add the label to the github PR.
Related PRs:
Tests for these changes have been added here: triton-inference-server/server#8276
Where should the reviewer start?
The majority of the changes are in the src/stub_launcher.cc
Review the updated flow for building the model load command.
Test plan:
Added testing to: triton-inference-server/server#8276
31707450
Caveats:
Background
Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)