Bug 2506209 (CVE-2026-16658)

Summary: CVE-2026-16658 community.proxmox: community.general: community.proxmox: proxmox_pct_remote shel injection via unquoted pct exec command allows
Product: [Other] Security Response Reporter: OSIDB Bzimport <bzimport>
Component: vulnerabilityAssignee: Product Security DevOps Team <prodsec-dev>
Status: NEW --- QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: jmitchel, kshier, pbohmill, security-response-team, teagle
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
A flaw was found in the community.proxmox Ansible collection's proxmox_pct_remote connection plugin. The _build_pct_command() method constructs a pct exec command string using unquoted string concatenation and passes it to the Proxmox host's shell via Paramiko. Shell metacharacters in the command (such as >, |, ;, &&, or $()) are interpreted on the host instead of inside the target LXC container, allowing commands intended for an unprivileged container to execute on the hypervisor host as root. This constitutes a container-to-host trust boundary crossing. The put_file and fetch_file methods in the same plugin correctly use shell quoting, indicating this is an oversight on the exec path.
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Deadline: 2026-08-22   

Description OSIDB Bzimport 2026-07-22 19:39:08 UTC
A flaw was found in the community.proxmox Ansible collection's
proxmox_pct_remote connection plugin (plugins/connection/
proxmox_pct_remote.py). The _build_pct_command() method constructs
the pct exec command by joining command arguments with spaces:
  cmd = ["/usr/sbin/pct", "exec", str(vmid), "--", cmd]
  return " ".join(cmd)
This string is passed to Paramiko's chan.exec_command(), which
executes it through the Proxmox host's shell. Shell metacharacters
in the Ansible task's command (>, <, |, ;, &&, $()) are interpreted
by the host shell as root instead of being passed to pct exec for
execution inside the target LXC container. For example, a task
"echo test > /tmp/file" results in the redirect creating the file
on the host rather than inside the container. The reporter
discovered this in production when an ansible.builtin.raw task
writing /etc/resolv.conf silently overwrote the Proxmox host's
resolver. The plugin's put_file and fetch_file methods correctly
use self._shell.quote() to wrap inner commands — the fix is to
apply the same pattern to the exec path. A deprecated copy of
this plugin also exists in community.general since version 10.3.0.
shlex is never imported in the plugin.

    Upstream: https://github.com/ansible-collections/community.proxmox
    Affected code: plugins/connection/proxmox_pct_remote.py
    Affected version: all versions containing proxmox_pct_remote
    Also in: community.general >= 10.3.0 (deprecated copy)
    Fixed version: (pending — reporter provides 1-line fix)
    Reporter: Jake Badoino (jake.badoino)