SkillTotal

Is onnxruntime safe?

No malicious indicators - review capabilities before installing
Notable — review in context (capabilities are not malware):
  • Python shell/command execution
  • Python dynamic code execution
  • Possible command injection (shell + dynamic command)

What to do: Nothing here argues against installing it. Grant the capabilities it lists only if you expect the tool to need them.

onnxruntime is a PyPI package analyzed by SkillTotal's deterministic static scanner. The scan found no malicious indicators, though 1 risky construct is reported for review. It can: dynamic code execution, filesystem read, filesystem write, network egress and shell execution — capabilities are what the code can do, not a verdict on intent. Risk score 20/100 (low).

x 1.30.0

python_package · pypi:onnxruntime
LOW
20
/ 100 risk score
Snapshot · scanned Oct 8, 2026 · x@1.30.0 · engine 0.56.4 / ruleset 62

Automated static-analysis result. It can contain false positives and false negatives, and is not a claim about the intent of onnxruntime's authors. Report a false positive.

Capabilities — what this component can do (not a risk score):
dynamic code executionfilesystem readfilesystem writenetwork egressshell execution

Behavioral traits

How this component maps to the CSA agentic threat model. Descriptive — it never affects the risk score.

Execution authority
Tool Access Control / Direct Tool Access
Filesystem reach
Tool Execution Context
Network egress
Interaction & Communication / Direct Communication

Findings (6)

HIGHPossible command injection (shell + dynamic command)ST-CMDI-PY

The code builds an OS command out of values that can change at runtime, then runs it through a shell.

Why it matters: If any of those values come from untrusted input, an attacker can run their own commands on the machine.

Fix: Pass arguments as a list without shell=True (e.g. subprocess.run(['git', 'checkout', branch])); never build a shell string from external input. If a shell is unavoidable, quote with shlex.quote.

HIGHPython dynamic code executionST-DYN-PY

The code turns strings into live code at runtime (eval / new Function / exec).

decoder = WhisperDecoder(config, model, model_impl, no_beam_search_op).eval()
encoder_decoder_init = WhisperEncoderDecoderInit(config, model, model_impl, no_beam_search_op).eval()
encoder = WhisperEncoder(config, model, model_impl).eval()
batched_jump_times = WhisperJumpTimes(config, device, cache_dir).eval()

Why it matters: If those strings aren't fixed and trusted, they become a way to run arbitrary code.

Fix: Avoid evaluating dynamically constructed code; if unavoidable, ensure the input is a trusted constant and never derived from external data.

HIGHPython shell/command executionST-SHELL-PY

The component can run operating-system commands or spawn processes.

returned_output = subprocess.check_output("oslevel")
os.system("python convert_to_onnx.py -m gpt2 --output gpt2_fp32.onnx -o -p fp32 --use_gpu")
os.system("python convert_to_onnx.py -m gpt2 --output gpt2_fp16.onnx -o -p fp16 --use_gpu")
process = subprocess.Popen(benchmark_cmd, stdout=log_file, stderr=log_file)
subprocess.run(main_cmd + symbolic_shape_infer_args)  # noqa: PLW1510
process = subprocess.Popen(benchmark_cmd, stdout=log_file, stderr=log_file)

Why it matters: Powerful and often legitimate — confirm the commands aren't built from untrusted input.

Fix: Confirm the command and its arguments are fully controlled and not derived from untrusted input; avoid shell=True.

MEDIUMPython filesystem readST-FS-PY-READ

The component reads files from disk.

for tuning_results in [json.load(open(f)) for f in args.input_json]:  # noqa: SIM115
for tuning_results in [json.load(open(f)) for f in args.input_json]:  # noqa: SIM115
tuning_results = json.load(open(args.json_or_onnx))  # noqa: SIM115
self._file = open(model_path, "rb").read()  # noqa: SIM115
with open(qnn_json_file_path) as qnn_json_file:
with open(args.qnn_json) as qnn_json_file:
with open(csv_path, newline="") as csvfile:
with open(filename_other, "rb") as f:  # noqa: PLW2901
with open(args.input, "rb") as input_file:

Why it matters: Usually legitimate, but worth confirming it can't be steered into reading sensitive files.

Fix: Confirm which files are read and that paths cannot be influenced by untrusted input to reach sensitive locations.

MEDIUMPython filesystem write/deleteST-FS-PY-WRITE

The component writes or deletes files on disk.

os.remove(os.path.join(os.path.dirname(self._model_path), external_data_location))
with open(os.path.join(dir, "calibration.json"), "w") as file:
with open(os.path.join(dir, "calibration.flatbuffers"), "wb") as file:
with open(os.path.join(dir, "calibration.cache"), "w") as file:
json.dump(tuning_results, open(args.output_json, "w"))  # noqa: SIM115
json.dump(merger.get_merged(), open(args.output_json, "w"))  # noqa: SIM115
with open(csv_filename, mode="a", newline="", encoding="ascii") as csv_file:
with open(csv_filename, mode="a", newline="", encoding="ascii") as csv_file:
with open(csv_filename, mode="a", newline="", encoding="ascii") as csv_file:
with open(os.path.join(directory, f"input_{index}.pb"), "wb") as file:
with open(os.path.join(directory, f"output_{i}.pb"), "wb") as file:
with open(os.path.join(ckpt_dir, filename), "wb") as f:
with open(csv_filename, mode="a", newline="", encoding="ascii") as csv_file:
with open(csv_filename, mode="a", newline="", encoding="ascii") as csv_file:
with open(csv_filename, mode="a", newline="") as csv_file:
with open(csv_filename, mode="a", newline="") as csv_file:
with open(f"ort_outputs_{i}.pickle", "wb") as f:

Why it matters: Usually legitimate, but worth confirming the paths can't be controlled by untrusted input.

Fix: Confirm which files are written/deleted and that paths cannot be influenced by untrusted input.

MEDIUMPython network egressST-NET-PY

The component makes outbound network requests.

Why it matters: Usually legitimate, but confirm the destinations are expected and no sensitive data leaves.

Fix: Confirm the destination hosts are expected and that no sensitive data is sent off-host.

How attackers abuse these capabilities

Interactive labs on the attack class behind the rules above. They show the technique, not anything found in onnxruntime.

Check your own component

Run the same evidence-backed scan on any MCP server, agent skill, or package.

Scan your own component

How we determine this: deterministic static analysis (regex + AST), evidence-anchored, no code execution. Methodology →