T09 · Insecure Skill Coding Practices
- Location
references/qga-exec.md:28- Finding
Proxmox API token transmitted without TLS certificate verification
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is coherent for enrolling Windows Proxmox VMs into Wazuh, but its documented workflow gives very high system access and includes unsafe installer and API-token handling patterns.
Review this skill carefully before installing. Use it only for trusted operators and known target VMs, require explicit confirmation before guest execution, do not use curl -k with Proxmox API tokens, pin and verify the Wazuh MSI hash and publisher signature, and keep the registration password out of command lines, logs, and chat.
references/qga-exec.md:28Proxmox API token transmitted without TLS certificate verification
references/wazuh-agent-enroll.md:37Externally retrieved MSI is installed as SYSTEM without integrity or publisher verification
Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.
qm guest exec takes --pass-stdin 1 (REST: input-data=). Feed the Wazuh registration password as stdin and read it in-guest with [Console]::In.ReadLine(), so it never lands in the process table, the command line, or QGA logs.
printf '%s\n' "$REG_PW" | sudo qm guest exec <vmid> --timeout 180 --pass-stdin 1 -- \
powershell.exe -NoProfile -NonInteractive -Command \
"\$pw=[Console]::In.ReadLine(); <build the msiexec arg list from \$pw and run it>"
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
# simple cmd — instant
sudo qm guest exec <vmid> --timeout 120 -- cmd /c "hostname"
# base64 PowerShell — avoids quoting hell, decodes & runs in-guest
b64=$(printf '%s' '<powershell>' | base64 -w0)
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
# simple cmd — instant
sudo qm guest exec <vmid> --timeout 120 -- cmd /c "hostname"
# base64 PowerShell — avoids quoting hell, decodes & runs in-guest
b64=$(printf '%s' '<powershell>' | base64 -w0)
This example decodes attacker-controllable Base64 and executes it with Invoke-Expression inside the Windows guest as NT AUTHORITY\SYSTEM. In this skill's context, that creates a powerful arbitrary-code-execution primitive in the VM, and the surrounding text explicitly highlights no-auth in-guest execution, increasing the danger if inputs are influenced by an untrusted user.
b64=$(printf '%s' '' | base64 -w0)
sudo qm guest exec --timeout 180 --
powershell.exe -NoProfile -NonInteractive -Command
"$d=[Text.Encoding]::UTF8.GetString([Convert]::FromBase64String('$b64')); Invoke-Expression $d" 2>&1
The document explicitly warns operators not to place the Wazuh registration password on the command line, yet the primary example does exactly that by passing it as an MSI property. Command-line arguments are commonly exposed through process listings, logging, EDR telemetry, shell history, Proxmox task traces, and audit tooling, so this can leak a live enrollment secret that could be reused to register rogue agents or interfere with agent trust.
Line 31 states that group creation is the one manager-side prerequisite and that everything else happens in-guest over QGA. Later, Step 4 instructs the operator to verify agent state and inspect /var/ossec/logs/ossec.log on the manager, which contradicts the earlier claim about where the workflow occurs.