Back to skill

Security audit

Billy — SAPCONET SSH Bridge

Security checks for vulnerabilities and agentic risk

Overview

The skill is disclosed as an SSH helper, but it needs review because it connects to a default remote SAPCONET host and one message template can execute unintended remote shell commands from message text.

Install only if you intend to use this exact SAPCONET SSH target or will set SAPCONET_TARGET yourself. Treat the scripts as unfinished templates, review every remote command before running them, and do not pass untrusted or externally supplied message text to msg-sapconet.sh until the remote command construction is fixed.

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 (1)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/msg-sapconet.sh:9
Finding
Remote Command Injection Through Unescaped Message Input## Vulnerability Details **File Location**: `scripts/msg-sapconet.sh`, lines 9–13 **Vulnerability Type**: Remote shell command injection **Risk Level**: High ### Vulnerable Code ```bash SAPCONET_TARGET="${SAPCONET_TARGET:-neill@100.110.24.44}" MESSAGE="$1" # Placeholder: replace with actual SAPCONET inbox command # Keep NO_REPLY discipline for automated messages. ssh "${SAPCONET_TARGET}" "echo 'TODO: send inbox message: ${MESSAGE}'" ``` ### Technical Analysis The script places the first command-line argument into `MESSAGE` and directly interpolates it into a double-quoted SSH command. Although the remote `echo` argument is surrounded by single quotes, the message itself is not escaped. The SSH client sends the resulting command string to a shell on the remote SAPCONET host. An attacker-controlled single quote can terminate the intended quoted argument, after which shell metacharacters can introduce additional commands. Local quoting does not protect the value once it has been incorporated into remote shell source. For example, a message shaped like the following can break out of the intended `echo` operation: ```text '; id; echo ' ``` This vulnerability exists even though the current operation is described as a placeholder. Invoking the script with untrusted message content is sufficient to reach the vulnerable command. ### Attack Path 1. An attacker obtains influence over the message passed as the script's first argument. 2. The attacker includes a single quote, command separator, and arbitrary shell command in that message. 3. The script stores the payload unchanged in `MESSAGE`. 4. Line 13 interpolates the payload into the SSH command string. 5. SSH submits the constructed string to the remote login shell. 6. The remote shell interprets the injected syntax and executes the attacker's command in addition to the intended `echo`. A representative invocation is: ```bash bash scripts/msg-sapconet.sh "'; id; echo '" ``` Conceptually, this produces a ...[truncated 689 chars]
Remediation
## Remediation Suggestions Do not construct remote shell source by interpolating untrusted message content. Use a fixed remote command and transfer the message through standard input or a safely defined data channel. For example, where the eventual inbox command accepts standard input: ```bash printf '%s' "$MESSAGE" | ssh -- "${SAPCONET_TARGET}" 'fixed-inbox-command --message-from-stdin' ``` Additional hardening measures should include: 1. Replace the placeholder with a fixed, reviewed remote executable rather than dynamically generated shell syntax. 2. Ensure the remote program treats the supplied message strictly as data. 3. If standard input cannot be used, encode the message locally, decode it in a fixed remote command, and avoid evaluating decoded content as shell code. 4. Avoid relying solely on character blacklists. If business requirements permit, enforce an explicit length limit and allowlist for acceptable message characters as defense in depth. 5. Restrict `SAPCONET_TARGET` to approved hosts and users where the execution environment permits attacker-controlled environment variables. 6. Configure the remote SSH key with least privilege, potentially using an authorized-keys forced command that exposes only the required inbox operation. 7. Add tests covering single quotes, semicolons, command substitutions, newlines, and shell metacharacters to verify they are handled only as message data.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Tp4

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding
The description claims templates for bird reads, Puppeteer runs, and inbox messaging workflows. The code actually performs active SSH connections to a hardcoded/default remote host, checks hostname/date, prints a placeholder instead of running a bird read, and verifies Node/Chromium availability rather than running Puppeteer. There is no inbox messaging functionality present. The primary purpose is closer to remote connectivity/environment validation than the broader workflow/template set described.

Description-Behavior Mismatch

Medium
Confidence
94% confidence
Finding
The manifest claims the skill provides standard SSH command templates for several concrete SAPCONET workflows. In this file, the implemented behavior is limited to checking connectivity, printing host identity/date, echoing a TODO instead of a bird read, and checking for Node/Chromium; there is no actual bird read, Puppeteer run, or inbox messaging workflow implemented.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The script automatically initiates SSH connections to a hard-coded remote host and executes commands without any interactive warning, confirmation, or strong host-validation controls visible in the script. In a skill context, this is more dangerous because users may run it as a routine helper and unknowingly contact an external system, potentially leaking metadata, trusting an unexpected host key, or performing unintended actions on remote infrastructure.

Static analysis

No suspicious patterns detected.