Is accelerate safe?
- Python shell/command execution
- Unsafe deserialization
- Python filesystem read
What to do: Nothing here argues against installing it. Grant the capabilities it lists only if you expect the tool to need them.
accelerate 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: filesystem read, filesystem write, scoped identity and shell execution — capabilities are what the code can do, not a verdict on intent. Risk score 20/100 (low).
accelerate-1.15.0 1.15.0
Automated static-analysis result. It can contain false positives and false negatives, and is not a claim about the intent of accelerate's authors. Report a false positive.
Behavioral traits
How this component maps to the CSA agentic threat model. Descriptive — it never affects the risk score.
Findings (5)
It loads data with a format that can rebuild arbitrary objects (e.g. pickle, or unsafe YAML).
obj = pickle.loads(obj_bytes)
result = pickle.loads(data_tensor[:real_size].cpu().numpy().tobytes())
Why it matters: Feeding such a loader untrusted data can execute code hidden inside that data.
Fix: Deserialize untrusted data with a safe format/loader: JSON, or yaml.safe_load / Loader=SafeLoader. Reserve pickle/marshal for data you fully control.
The component can run operating-system commands or spawn processes.
mps_type = subprocess.check_output(["sysctl", "-n", "machdep.cpu.brand_string"], text=True).strip()
process = subprocess.Popen(cmd, env=current_env)
process = subprocess.Popen(cmd, env=current_env)
subprocess.run(cmd)
output = subprocess.check_output(
[_nvidia_smi(), "--query-gpu=count,name", "--format=csv,noheader"], universal_newlines=True
)output = subprocess.check_output(
[_nvidia_smi(), "--query-gpu=driver_version", "--format=csv,noheader"], universal_newlines=True
)output = subprocess.check_output(
[_nvidia_smi(), "--query-gpu=compute_capability", "--format=csv,noheader"], universal_newlines=True
)mpirun_version = subprocess.check_output([mpi_app, "--version"])
subprocess.run(torch_install_cmd, check=True)
subprocess.run(xla_install_cmd, check=True)
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.
The component reads files from disk.
long_description=open("README.md", encoding="utf-8").read(),with open(config_file, encoding="utf-8") as f:
with open(json_file, encoding="utf-8") as f:
with open(yaml_file, encoding="utf-8") as f:
with open(config_file) as f:
with open(args.command_file) as f:
with open(config_file_or_dict, encoding="utf-8") as f:
with open(f"/sys/devices/system/node/node{numa_node}/cpulist") as f:with open(sagemaker_config.sagemaker_inputs_file) as file:
with open(sagemaker_config.sagemaker_metrics_file) as file:
with open(index_filename) as f:
with open(offload_index_file, encoding="utf-8") as f:
with open(os.path.join(save_folder, "index.json")) as f:
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.
The component writes or deletes files on disk.
os.remove(full_filename)
with open(save_index_file, "w", encoding="utf-8") as f:
shutil.rmtree(folder)
with open(json_file, "w", encoding="utf-8") as f:
with open(yaml_file, "w", encoding="utf-8") as f:
with open(DEEPSPEED_ENVIRONMENT_NAME, "a") as f:
with open(args.output_file, "w") as f:
with open(os.path.join(dir_name, "hparams.yml"), "w") as outfile:
shutil.rmtree(checkpoint_dir)
shutil.rmtree(state_dict_folder)
with open(offload_index_file, "w", encoding="utf-8") 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.
A short-lived, scoped, assumed identity was detected — an STS AssumeRole / session token, a cloud managed or workload identity, an impersonated service account, a projected Kubernetes service-account token, or a dynamic-secret broker. Tools authenticate with a narrowly-scoped credential that expires, rather than a long-lived embedded service credential.
{"Effect": "Allow", "Principal": {"Service": "sagemaker.amazonaws.com"}, "Action": "sts:AssumeRole"}Fix: A scoped, short-lived identity is the smallest-blast-radius execution context. Confirm the assumed role / requested scope grants only the permissions the tool needs, and that the token lifetime is minimal.
How attackers abuse these capabilities
Interactive labs on the attack class behind the rules above. They show the technique, not anything found in accelerate.
Check your own component
Run the same evidence-backed scan on any MCP server, agent skill, or package.
Scan your own componentHow we determine this: deterministic static analysis (regex + AST), evidence-anchored, no code execution. Methodology →