image_url is wrapped in single quotes by hand, without escaping: a ' in the URL ends the quoting.
local_path contains the URL's last path segment unquoted in test -f, wget -O, mv and the sha256sum line; a ;, $(…) or space in it is interpreted by the shell.
The commands run as root on the hypervisor node (_run_node_command). The same filename is built again in _cloud_image_on_node (line 227).
Who supplies image_url
In netOrk the URL comes from the OS image catalog (netork/core/os_image_catalog.py) and its sync tasks, which take it from the vendors' release feeds — e.g. "image_url": release["link"], in netork/jobs/tasks/fedora_image_sync.py:56, _BASE_URL + item["path"] for Ubuntu. Operators do not type it, so it is not reachable with operator input; it is reachable with whatever a release feed (or anyone able to tamper with it) publishes. Any other caller of create_vm_from_cloud_init passes its own URL.
Expected
All interpolated values go through shlex.quote; the cache file name is derived from the URL hash plus a sanitised basename ([A-Za-z0-9._-] only, as _import_volume_name already does for import volumes). Test-first: a URL ending in x';reboot;'.img produces commands in which the URL and path are single arguments.
Priority: P3 — root command injection on the hypervisor from data fetched off the internet; not reachable from operator input in netOrk.
Found during the bug sweep of 2026-11-01.
## What happens
`_download_cloud_image` (`napalm_proxmox/vm_provision_mixin.py` 156-216) builds its node commands from the URL:
```python
filename = image_url.rstrip("/").rsplit("/", 1)[-1]
local_path = f"{_IMAGE_CACHE_DIR}/{_url_key(image_url)}-{filename}"
...
f"mkdir -p {_IMAGE_CACHE_DIR} && test -f {local_path} "
...
f"wget -q -O {local_path}.tmp '{image_url}' "
```
- `image_url` is wrapped in single quotes by hand, without escaping: a `'` in the URL ends the quoting.
- `local_path` contains the URL's last path segment unquoted in `test -f`, `wget -O`, `mv` and the `sha256sum` line; a `;`, `$(…)` or space in it is interpreted by the shell.
The commands run as root on the hypervisor node (`_run_node_command`). The same `filename` is built again in `_cloud_image_on_node` (line 227).
## Who supplies image_url
In netOrk the URL comes from the OS image catalog (`netork/core/os_image_catalog.py`) and its sync tasks, which take it from the vendors' release feeds — e.g. `"image_url": release["link"],` in `netork/jobs/tasks/fedora_image_sync.py:56`, `_BASE_URL + item["path"]` for Ubuntu. Operators do not type it, so it is not reachable with operator input; it is reachable with whatever a release feed (or anyone able to tamper with it) publishes. Any other caller of `create_vm_from_cloud_init` passes its own URL.
## Expected
All interpolated values go through `shlex.quote`; the cache file name is derived from the URL hash plus a sanitised basename (`[A-Za-z0-9._-]` only, as `_import_volume_name` already does for import volumes). Test-first: a URL ending in `x';reboot;'.img` produces commands in which the URL and path are single arguments.
Priority: P3 — root command injection on the hypervisor from data fetched off the internet; not reachable from operator input in netOrk.
Found during the bug sweep of 2026-11-01.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What happens
_download_cloud_image(napalm_proxmox/vm_provision_mixin.py156-216) builds its node commands from the URL:image_urlis wrapped in single quotes by hand, without escaping: a'in the URL ends the quoting.local_pathcontains the URL's last path segment unquoted intest -f,wget -O,mvand thesha256sumline; a;,$(…)or space in it is interpreted by the shell.The commands run as root on the hypervisor node (
_run_node_command). The samefilenameis built again in_cloud_image_on_node(line 227).Who supplies image_url
In netOrk the URL comes from the OS image catalog (
netork/core/os_image_catalog.py) and its sync tasks, which take it from the vendors' release feeds — e.g."image_url": release["link"],innetork/jobs/tasks/fedora_image_sync.py:56,_BASE_URL + item["path"]for Ubuntu. Operators do not type it, so it is not reachable with operator input; it is reachable with whatever a release feed (or anyone able to tamper with it) publishes. Any other caller ofcreate_vm_from_cloud_initpasses its own URL.Expected
All interpolated values go through
shlex.quote; the cache file name is derived from the URL hash plus a sanitised basename ([A-Za-z0-9._-]only, as_import_volume_namealready does for import volumes). Test-first: a URL ending inx';reboot;'.imgproduces commands in which the URL and path are single arguments.Priority: P3 — root command injection on the hypervisor from data fetched off the internet; not reachable from operator input in netOrk.
Found during the bug sweep of 2026-11-01.