Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Shell injection constant strings - #27840

#27840
Merged
jiafatom merged 1 commit into
mainmicrosoft/onnxruntime:mainfrom
print_conmicrosoft/onnxruntime:print_conCopy head branch name to clipboard
Mar 26, 2026
Merged

Shell injection constant strings#27840
jiafatom merged 1 commit into
mainmicrosoft/onnxruntime:mainfrom
print_conmicrosoft/onnxruntime:print_conCopy head branch name to clipboard

Conversation

@jiafatom

@jiafatom jiafatom commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

Description

See below

Motivation and Context

Summary:The vulnerability lies in the ONNX Runtime's validate_package.py script, which uses unsanitized string concatenation with os.system() to construct shell commands. This allows attackers to inject arbitrary shell commands via the --package_name argument, leading to potential remote code execution. The issue affects the release validation pipeline, which operates with elevated privileges, exposing sensitive credentials and secrets. The root cause is the lack of input sanitization and the use of os.system() for command execution.

Affected code locations:

tools/nuget/validate_package.py line 241: os.system("tar zxvf " + package_name)
tools/nuget/validate_package.py line 339: os.system("copy " + full_nuget_path + " " + nupkg_copy_name)
Suggested fix: Replace os.system() with subprocess.run() using argument lists (no shell interpolation):

# Instead of: os.system("tar zxvf " + package_name)
subprocess.run(["tar", "zxvf", package_name], check=True)

# Instead of: os.system("copy " + full_nuget_path + " " + nupkg_copy_name)
shutil.copy2(full_nuget_path, nupkg_copy_name)

@jiafatom
jiafatom enabled auto-merge (squash) March 26, 2026 02:31
@jiafatom
jiafatom merged commit 651c7cf into main Mar 26, 2026
175 of 179 checks passed
@jiafatom
jiafatom deleted the print_con branch March 26, 2026 17:26
@hariharans29 hariharans29 mentioned this pull request Apr 1, 2026
hariharans29 added a commit that referenced this pull request Apr 9, 2026
### Description
Fix ICM issue:
https://portal.microsofticm.com/imp/v5/incidents/details/31000000567822/summary

The ICM is mainly about 2 issues in `validate_package.py` which was
fixed by #27840.
But the ICM also references another issue in `whisper_jump_times.py`
which is what this PR fixes

### Motivation and Context
ICM fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.