Back to skill

Security audit

printer-control

Security checks across malware telemetry and agentic risk

Overview

This is a real Windows printer-control skill, but its PowerShell fallback builds commands from user-controlled printer names, file paths, and text in ways that can be unsafe.

Install only if you need Windows printer automation and are comfortable with local PowerShell fallback behavior. Prefer the pywin32 path, confirm the exact printer and any default-printer change before running commands, and avoid using untrusted printer names, file paths, or text until the PowerShell calls are refactored to use safe parameter binding or strict validation.

SkillSpector

By NVIDIA
Vulnerability Patterns
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (8)

subprocess module call

Medium
Category
Dangerous Code Execution
Content
# Note: PowerShell printing is limited, may not work for all file types
            """
            
            result = subprocess.run(
                ['powershell', '-Command', ps_script],
                capture_output=True,
                text=True,
Confidence
98% confidence
Finding
This PowerShell subprocess executes a dynamically constructed script that embeds the user-supplied printer name directly into the command text. An attacker who can control the printer argument could inject PowerShell syntax and execute arbitrary commands in the context of the script.

subprocess module call

Medium
Category
Dangerous Code Execution
Content
}}
            """
            
            result = subprocess.run(
                ['powershell', '-Command', ps_script],
                capture_output=True,
                text=True,
Confidence
99% confidence
Finding
This subprocess call runs a dynamically generated PowerShell script containing both file_path and printer_name, which originate from command-line input. Because these values are inserted directly into quoted PowerShell code without safe escaping, a crafted argument can break out of the string and trigger arbitrary PowerShell command execution.

subprocess module call

Medium
Category
Dangerous Code Execution
Content
Remove-Item $tempFile -Force
        """
        
        result = subprocess.run(
            ['powershell', '-Command', ps_script],
            capture_output=True,
            text=True,
Confidence
91% confidence
Finding
This subprocess call passes a dynamically constructed PowerShell script containing user-influenced values such as printer_name and text. The attempted escaping is ad hoc and incomplete for PowerShell semantics, creating a realistic risk of command/script injection or unintended command behavior if crafted input breaks out of the intended string context.

subprocess module call

Medium
Category
Dangerous Code Execution
Content
}} | ConvertTo-Json
        """
        
        result = subprocess.run(
            ['powershell', '-Command', ps_script],
            capture_output=True,
            text=True,
Confidence
97% confidence
Finding
This PowerShell subprocess executes a dynamically constructed script containing the user-controlled printer name inside double quotes. Because PowerShell performs subexpression expansion inside double-quoted strings, a printer name containing characters like $(...) or embedded quote/script syntax can alter the script and potentially achieve command injection.

subprocess module call

Medium
Category
Dangerous Code Execution
Content
$printer | Set-Printer -Default
        """
        
        result = subprocess.run(
            ['powershell', '-Command', ps_script],
            capture_output=True,
            text=True,
Confidence
95% confidence
Finding
This PowerShell invocation embeds the user-controlled printer_name directly into a script string passed to `powershell -Command`. Although `subprocess.run` is called without `shell=True`, the dangerous interpretation happens inside PowerShell, so a crafted printer name containing quotes or PowerShell syntax could break out of the string and execute arbitrary commands.

Missing User Warnings

Medium
Confidence
98% confidence
Finding
The fallback PowerShell path embeds the printer name directly into the script without safe escaping or parameterization. In this skill context, the printer name comes from command-line input and may be attacker-controlled, making command execution through PowerShell a realistic risk if crafted input reaches this path.

Unvalidated Output Injection

High
Category
Output Handling
Content
Remove-Item $tempFile -Force
        """
        
        result = subprocess.run(
            ['powershell', '-Command', ps_script],
            capture_output=True,
            text=True,
Confidence
92% confidence
Finding
The PowerShell script is assembled from externally supplied text and printer identifiers, then executed via powershell -Command. Because the script mixes data and code, malformed or adversarial input can alter script execution, potentially causing arbitrary command execution under the privileges of the running process; the printing context does not reduce that risk because the skill accepts raw text input and interacts with the OS.

Unvalidated Output Injection

High
Category
Output Handling
Content
$printer | Set-Printer -Default
        """
        
        result = subprocess.run(
            ['powershell', '-Command', ps_script],
            capture_output=True,
            text=True,
Confidence
97% confidence
Finding
The finding is valid because untrusted input from `--printer` is inserted into a PowerShell script string without escaping or validation. In the context of a system-management skill, this is more dangerous because the script is explicitly intended to modify system configuration and may be run with elevated privileges, amplifying arbitrary command execution impact.

VirusTotal

64/64 vendors flagged this skill as clean.

View on VirusTotal

Static analysis

No suspicious patterns detected.