Back to skill

Security audit

Pywayne Cross Comm

Security checks for vulnerabilities and agentic risk

Overview

This skill has a legitimate communication purpose, but its examples encourage broad network exposure and automatic file transfer behavior without enough access-control guidance.

Review before installing or using in shared networks. Bind servers to localhost unless you explicitly need remote access, add authentication and TLS, restrict allowed senders, avoid broad auto-download listeners, quarantine and validate received files, and be deliberate about any local files or folders sent to Aliyun OSS.

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

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:38
Finding
Externally Exposed WebSocket Service Without Documented Authentication or Transport Security<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 38-39 and 62-65 **Vulnerability Type**: Exposed network service with insufficiently documented access and transport controls **Risk Level**: High ### Vulnerable Code ```python server = CrossCommService(role='server', ip='0.0.0.0', port=9898) await server.start_server() ``` The server initialization section repeats the externally exposed configuration: ```python server = CrossCommService( role='server', ip='0.0.0.0', # Listen on all interfaces port=9898, heartbeat_interval=30, # Seconds between heartbeats heartbeat_timeout=60 # Seconds before marking offline ) ``` ### Technical Analysis The documented configuration binds the WebSocket service to `0.0.0.0`, making it reachable through every available network interface unless an external firewall prevents access. The Skill documents a client login operation and an optional `client_id`, but it does not specify credentials, cryptographic client authentication, authorization policies, TLS/WSS, certificate validation, WebSocket origin restrictions, or network access controls. A client ID is an identifier and must not be treated as proof of identity. Because the underlying `pywayne.cross_comm` implementation is not included in the audited project, the presence or absence of internal security controls cannot be verified. Nevertheless, the Skill's recommended deployment exposes the service broadly without requiring those controls. ### Attack Path 1. A user follows the documented example and starts the server on `0.0.0.0:9898`. 2. TCP port 9898 becomes reachable from another host on an exposed network. 3. An attacker connects to the WebSocket endpoint and supplies an attacker-selected or impersonated client ID. 4. If the dependency does not implement additional undocumented authentication, the attacker logs in as a client. 5. The attacker submits messages, requests client-list functionality, or initiates ...[truncated 875 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Bind to `127.0.0.1` by default and require an explicit opt-in to listen on external interfaces. - Require strong client authentication, such as short-lived signed tokens or mutual TLS certificates. - Authorize every operation independently, including sending messages, selecting recipients, listing clients, and transferring files. - Use TLS-protected WebSockets (`wss://`) and document certificate validation requirements. - Reject untrusted WebSocket origins where browser-based clients are supported. - Prevent client-selected identifiers from serving as authentication credentials. - Add connection, authentication, message-rate, message-size, and concurrency limits. - Place externally reachable deployments behind a firewall or authenticated reverse proxy. - Log authentication failures and security-relevant operations without recording credentials or sensitive message contents. - Update the examples so that secure network exposure is the default rather than an optional hardening step. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:145
Finding
Automatic Persistence of Remotely Supplied Files Without Documented Validation<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 70-72 and 145-150 **Vulnerability Type**: Unsafe automatic download of untrusted remote files **Risk Level**: High ### Vulnerable Code The server example automatically downloads every received file matching the message type: ```python @server.message_listener(msg_type=CommMsgType.FILE, download_directory="./downloads") async def handle_file(message): print(f"File downloaded: {message.content}") ``` The file-download control section recommends the same behavior for clients: ```python # Auto-download files to ./downloads @client.message_listener(msg_type=CommMsgType.FILE, download_directory="./downloads") async def handle_file(message): # message.content contains downloaded file path print(f"Downloaded: {message.content}") ``` ### Technical Analysis Specifying `download_directory` causes remotely supplied files to be persisted automatically. The examples do not constrain the sender with `from_client_id`, require user approval, or document any of the following protections: - File-size and storage-quota limits. - Filename and OSS-key normalization. - Canonical destination-path validation. - Path traversal and absolute-path rejection. - Symlink and hard-link protection. - Collision-resistant destination names. - No-overwrite file creation. - Content-type or file-signature validation. - Malware scanning or quarantine. - Per-sender authorization and rate limiting. A remote participant may therefore cause local files to be written merely by delivering a FILE message to a broad listener. Whether path traversal or overwrite is directly exploitable depends on how the unavailable `pywayne.cross_comm` dependency converts OSS keys and remote filenames into local paths. Unrestricted storage consumption and placement of attacker-controlled content remain relevant risks whenever an untrusted sender can reach the listener. ### Attack Path 1. A server or client registers the documented ...[truncated 1656 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Do not automatically download files from arbitrary senders by default. - Require authenticated, authorized senders and use explicit sender allowlists. - Require user or application approval before downloading remotely supplied content. - Generate destination filenames locally rather than trusting remote filenames or OSS keys. - Canonicalize the destination path and verify that it remains beneath the configured download directory. - Reject absolute paths, traversal components, control characters, ambiguous Unicode names, and platform-specific path prefixes. - Open destination files with exclusive creation semantics and disallow overwriting existing files. - Prevent writes through symlinks and other filesystem redirection mechanisms. - Enforce per-file size limits, per-sender quotas, aggregate storage quotas, transfer timeouts, and rate limits. - Validate file signatures and expected content types; quarantine and scan files where appropriate. - Store received files in a non-executable, access-restricted directory isolated from application code and publicly served content. - Prefer the documented no-auto-download mode, exposing the OSS key only until an explicit policy decision authorizes retrieval. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (4)

Credential Access

High
Category
Privilege Escalation
Content
File transfers use Aliyun OSS. Set these environment variables:

```bash
# .env file
OSS_ENDPOINT=your-oss-endpoint
OSS_BUCKET_NAME=your-bucket-name
OSS_ACCESS_KEY_ID=your-access-key
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The documented listener behavior shows automatic downloading of remote file content into a local directory, but it does not clearly warn that untrusted remote content will be written to the filesystem. This increases the risk of users enabling auto-downloads without considering disk-write side effects, malware staging, or unsafe handling of attacker-controlled filenames/content.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The skill explicitly states that sending files, images, and folders will automatically upload local content to Aliyun OSS, but it does not prominently warn that local data is being transmitted to a third-party remote service. In an agent setting, this can lead to unintended exfiltration of sensitive local files or directories if a caller assumes these are local-only transfers.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The skill documents default client ID generation using the device MAC address plus a UUID suffix, which exposes a persistent hardware-derived identifier without explicit user consent. This can enable cross-session tracking, device correlation, and disclosure of sensitive host identity information in environments where anonymity or privacy is expected.

Static analysis

No suspicious patterns detected.