Back to skill

Security audit

PiKVM

Security checks for vulnerabilities and agentic risk

Overview

The skill is openly designed for PiKVM remote control, but it needs Review because it can send powerful credentials and commands to unvalidated network destinations and trigger high-impact remote actions.

Install only if you trust the skill and need agent-assisted PiKVM administration. Use a dedicated least-privilege PiKVM account, keep HTTPS certificate verification enabled, avoid passing passwords on the command line, avoid untrusted or plaintext PIKVM_URL values, and require explicit confirmation before power, HID, switch, or virtual-media operations. Treat remote media downloads as sensitive because they make the PiKVM fetch a URL from its own network.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/pikvm_api.py:29
Finding

PiKVM Credentials May Leak Through Cross-Origin Redirects

Content
View full analysis
requests.Response: url = f"{self.base_url}{path}" response = self.session.request( method=method, url=url, params=params, data=data, headers=headers, timeout=self.timeout, verify=self.verify_ssl, stream=stream, ) ``` ### Technical Analysis The client stores the PiKVM username and password in custom session headers and uses `requests.Session.request()` without disabling redirects. The Requests library follows redirects by default. Standard `Authorization` credentials receive special redirect handling, but the custom `X-KVMD-User` and `X-KVMD-Passwd` headers are not guaranteed to be removed when a redirect changes origin. Consequently, a malicious or compromised PiKVM server can redirect an authenticated request to another host and potentially cause the client to forward these custom credential headers. The password may also contain a time-based one-time password because the documentation instructs users to append the current TOTP value directly to the password. ### Attack Path 1. An attacker compromises the configured PiKVM endpoint, controls a substituted endpoint, or otherwise causes the client to connect to a malicious server. 2. The user invokes any supported API operation. 3. The initial server returns an HTTP redirect to an attacker-con ...[truncated 736 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/pikvm_api.py:76
Finding

Privileged Credentials Can Be Sent to Arbitrary or Plaintext Endpoints

Content
View full analysis
PiKVMClient: base_url = args.url or os.getenv("PIKVM_URL") user = args.user or os.getenv("PIKVM_USER") password = args.password or os.getenv("PIKVM_PASS") verify_ssl = not args.insecure if args.insecure is not None else env_bool("PIKVM_VERIFY_SSL", True) use_basic_auth = args.basic_auth if args.basic_auth is not None else env_bool("PIKVM_USE_BASIC_AUTH", False) ``` ```python def add_common_options(parser: argparse.ArgumentParser) -> None: parser.add_argument("--url", help="PiKVM base URL. Defaults to PIKVM_URL.") parser.add_argument("--user", help="PiKVM username. Defaults to PIKVM_USER.") parser.add_argument("--password", help="PiKVM password. Defaults to PIKVM_PASS.") parser.add_argument("--insecure", action="store_true", default=None, help="Disable TLS certificate verification.") parser.add_argument("--basic-auth", action="store_true", default=None, help="Use HTTP Basic Auth instead of X-KVMD headers.") ``` ### Technical Analysis The configured base URL is accepted without validating its scheme, hostname, port, embedded credentials, or relationship to an approved PiKVM endpoint. As a result, the client can transmit full authentication credentials to an arbitrary URL, including a plaintext `http://` endpoint. The `--insecure` option and `PIKVM_VERIFY_SSL=false` configuration also permit HTTPS connections without certificate verification. This removes server authentication and makes credential interception possible for an attacker capable of manipulating DNS or network traffic. These risks are particularly significant because the credentials authorize high-impact remote-management operations and are attached to every API request. ### Attack Pat ...[truncated 1262 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/pikvm_api.py:220
Finding

Remote Virtual-Media Download Exposes an SSRF Primitive

Content
View full analysis
None: params = {"url": args.remote_url} if args.image: params["image"] = args.image print_json(client.post_json("/api/msd/write_remote", params=params)) ``` ```python p = subparsers.add_parser("msd-download-remote") p.add_argument("--remote-url", required=True) p.add_argument("--image") p.set_defaults(func=cmd_msd_download_remote) ``` ### Technical Analysis The `msd-download-remote` command accepts an unrestricted URL and passes it directly to PiKVM's `/api/msd/write_remote` endpoint. The resulting network request is performed by the PiKVM device, not by the local script. No validation limits the URL scheme or destination. In particular, the script does not reject loopback, private, link-local, multicast, or cloud metadata addresses. It also does not enforce an approved hostname list or establish redirect constraints. This provides a server-side request forgery primitive from the PiKVM device's network position. The practical response visibility depends on the behavior of the PiKVM endpoint, but the operation can still reach services that are inaccessible to the user running the client directly. ### Attack Path 1. An attacker convinces an authorized operator or agent to invoke `msd-download-remote` with a crafted URL. 2. The crafted URL targets an internal service, loopback endpoint, link-local metadata service, or attacker-controlled redirector. 3. The script forwards the URL to `/api/msd/write_remote`. 4. The PiKVM device makes the outbound request from its trusted network context. 5. The request reaches a service unavailable from the original client environment. 6. Retrieved content may be stored as a virtual-media im ...[truncated 603 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
scripts/pikvm_api.py:257
Finding

Command-Line Password Option Can Expose Authentication Secrets Locally

Content
View full analysis
`. 2. The shell records the command in history, or the argument appears in process listings or execution telemetry. 3. Another local user, administrator, monitoring system, or log reader obtains the argument. 4. The exposed password is reused to authenticate to the PiKVM device. 5. If the captured value contains a TOTP code, the code may also be usable during its validity window. ### Impact Assessment An attacker can obtain the static PiKVM password and authenticate with the permissions of the affected account. Depending on account privileges, this can provide remote-console visibility, HID input, virtual-media management, switch control, and power operations. Exploitation generally requires access to local process metadata, shell history, or captured execution logs. The TOTP component has a limited lifetime, but the underlying static password remains sensitive. ]]>
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (8)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
80% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · references/api-reference.md (reported line 48)May include surrounding context.

md
- `GET /api/streamer`
- `GET /api/streamer/snapshot`
- `DELETE /api/streamer/snapshot`
- `GET /api/streamer/ocr`

Snapshot supports:

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding

The skill clearly relies on sensitive capabilities: reading credentials from environment variables and making authenticated network requests to a PiKVM device that can power cycle hosts, inject keyboard input, control virtual media, and switch ports. Omitting an explicit tool scope means the runtime may grant broader-than-necessary access or make the skill's trust boundary unclear, which increases the risk of misuse or accidental invocation with powerful side effects.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

This markdown file documents power-control and deletion-capable endpoints such as hard power off/reset and snapshot deletion, but it does not warn that these actions can disrupt systems or remove data. Under the markdown variant of SQP-2, descriptions should disclose behaviors that may affect user data or system integrity.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This code initializes an HTTP session and automatically attaches PiKVM credentials to all requests, either via Basic Auth or custom headers. There is no confirmation prompt, user-facing print/log message, or inline warning explaining that credentials and command data will be transmitted to a remote device.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The atx-power command can issue irreversible or disruptive actions such as off_hard and reset_hard against the remote machine. Although the command name implies power control, the code provides no confirmation, warning text, or explanatory comment to alert users before performing these safety-critical operations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The HID print and shortcut commands send arbitrary keyboard input to the controlled machine, which can execute commands or alter remote state. The file lacks any warning, confirmation, or explanatory disclosure that these actions inject input into another system.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The msd-upload, msd-download-remote, and msd-remove flows transfer image data to the PiKVM or remove remote images, affecting remote storage state. The code does not present any confirmation, warning, or explanatory comment about these potentially destructive or data-affecting operations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

This code creates directories and writes snapshot bytes to a user-specified file path, which is a file-write operation covered by the warning criteria. While the --save-path argument names the destination, there is no explicit note in code comments or help text warning that local files will be created or overwritten.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.