Back to skill

Security audit

Lybic Sandbox

Security checks for vulnerabilities and agentic risk

Overview

This skill openly teaches agents to manage Lybic cloud sandboxes, including powerful actions that users should supervise carefully.

Install this only if you intend to let an agent operate Lybic cloud sandboxes with your account. Use a least-privileged API key, avoid hardcoding secrets, review commands before deleting projects or sandboxes, and treat HTTP port mappings as internet exposure. Prefer a pinned SDK version in a dedicated environment when possible.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:81
Finding
Unpinned Third-Party SDK Creates a Supply-Chain Risk<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:81-83`; also present in `README.md:46-48` and `examples/README.md:7-11` **Vulnerability Type**: Unpinned third-party dependency **Risk Level**: Medium ### Vulnerable Code ```markdown The Lybic Python SDK must be installed: ```bash pip install lybic ``` ``` Equivalent installation instructions also appear in the other documentation files: ```bash pip install lybic ``` ### Technical Analysis The project instructs users to install `lybic` from the default Python Package Index without specifying an exact reviewed version or verifying package integrity through hashes. As a result, the code installed and subsequently imported may differ from the version originally reviewed. A compromised maintainer account, malicious upstream release, package-index compromise, or dependency takeover could cause arbitrary third-party code to run in the user's Python environment. This risk is especially relevant because the examples import and initialize the SDK while the following credentials are available in environment variables: - `LYBIC_ORG_ID` - `LYBIC_API_KEY` Base64 use elsewhere in the project is not evidence of secret obfuscation or exfiltration. It is used as the documented transport format for process input and output. The supply-chain concern instead arises from trusting a mutable, unpinned package. ### Attack Path 1. An attacker compromises the upstream `lybic` package or publishes a malicious release through a compromised maintainer account. 2. A user follows the documented command: ```bash pip install lybic ``` 3. The package manager resolves the latest available release rather than a previously reviewed version. 4. The malicious package executes code during an applicable installation/build step or when imported by the examples. 5. The package reads accessible environment variables, including the Lybic organization ID and API key. 6. The attacker can exfiltrate those credentials or inv ...[truncated 713 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin the SDK to an exact reviewed version: ```bash python3 -m pip install "lybic==<reviewed-version>" ``` 2. Publish a requirements or lock file containing cryptographic hashes and install with hash enforcement: ```bash python3 -m pip install --require-hashes -r requirements.txt ``` 3. Record the expected package index explicitly and prevent fallback to untrusted indexes where appropriate. 4. Review the pinned package and its transitive dependencies before updating the lock file. 5. Run the SDK in a dedicated virtual environment or container with only the credentials and filesystem access required for the requested task. 6. Scope Lybic API keys to the minimum necessary permissions and rotate them if dependency compromise is suspected. 7. Keep the installation command consistent across `SKILL.md`, `README.md`, and `examples/README.md`. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
examples/06_http_port_mapping.py:15
Finding
User-Supplied Sandbox Identifier Is Embedded in a Shell Here-Document<![CDATA[ ## Vulnerability Details **File Location**: `examples/06_http_port_mapping.py:15-25,32-72` **Vulnerability Type**: Conditional shell command injection **Risk Level**: Low ### Vulnerable Code ```python sandbox_id = input("Enter your sandbox ID (e.g., SBX-xxxx): ").strip() async with LybicClient() as client: print(f"Working with sandbox {sandbox_id}") # Verify sandbox try: sandbox_info = await client.sandbox.get(sandbox_id) print(f"✓ Connected to: {sandbox_info.name}") except Exception as e: print(f"❌ Error: {e}") return # Create a simple HTML file html_code = f""" cat > /tmp/index.html << 'EOF' <!DOCTYPE html> <html> <head> <title>Lybic Sandbox Server</title> </head> <body> <div class="info"> <h1>🎉 Hello from Lybic Sandbox!</h1> <p><strong>Sandbox ID:</strong> {sandbox_id}</p> </div> </body> </html> EOF """ # Create the HTML file result = await client.sandbox.execute_process( sandbox_id, executable="sh", args=["-c", html_code] ) ``` ### Technical Analysis The value of `sandbox_id` originates from interactive input and is interpolated into a string that is passed to `sh -c`. The quoted here-document marker (`<< 'EOF'`) prevents ordinary shell expansion inside the HTML body, but it does not protect against a value containing newline characters and a forged `EOF` terminator. For example, a structurally malicious value could terminate the here-document and append shell commands before starting another valid shell construct. The prior call to `client.sandbox.get(sandbox_id)` significantly limits practical exploitation because the supplied identifier must be accepted by the Lybic API. If the service strictly restricts sandbox identifiers to a safe pattern such as `SBX-` followed by alphanumeric characters, the injection path is not reachable. The example does not enforce or document that constraint locally, however, and therefore r ...[truncated 1505 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Validate the identifier locally before using it in any command context. Use the exact format documented by the Lybic API. For example, if applicable: ```python import re if not re.fullmatch(r"SBX-[A-Za-z0-9_-]+", sandbox_id): raise ValueError("Invalid sandbox ID") ``` 2. Do not use `sh -c` to create the HTML file. Prefer a Lybic file-write or upload API so HTML content is transmitted as data rather than shell source. 3. If process execution is required, send file content through encoded standard input to a fixed executable and fixed arguments. Do not concatenate user-controlled content into a shell program. 4. HTML-escape the identifier before inserting it into an HTML page: ```python from html import escape safe_sandbox_id = escape(sandbox_id, quote=True) ``` HTML escaping addresses markup injection but should be used in addition to eliminating the shell construction. 5. Treat successful remote API validation as a resource-existence check, not as a substitute for local input validation at a shell boundary. 6. Add tests containing newline characters, `EOF`, quotes, semicolons, command substitutions, and other shell metacharacters to verify that none can alter command structure. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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 (10)

Missing User Warnings

Medium
Confidence
88% confidence
Finding
This markdown quick reference includes deletion operations for sandboxes without any accompanying warning about data loss, cleanup impact, or irreversibility. Under the markdown-file criteria, descriptions that omit warnings about actions affecting user data or system state should be flagged.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
The documentation demonstrates creating a public HTTP port mapping and printing a public URL without warning that this exposes a service on the internet. In a sandbox/agent-execution skill, this is more dangerous because users may run ad hoc web apps, admin panels, or debug servers that bind to localhost and incorrectly assume they remain private once mapped.

Missing User Warnings

Medium
Confidence
84% confidence
Finding
The markdown includes a project deletion example with no cautionary text about permanent removal or organizational impact. This omission is relevant because the action may affect stored resources and user data.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The README documents highly capable remote sandbox control features including GUI automation, arbitrary code execution, file transfer, and public port forwarding, but provides no safety guidance, authorization boundaries, or warnings about destructive or externally exposed actions. In an agent skill context, this omission increases the risk that downstream users or autonomous agents will use the capability unsafely, leading to accidental system changes, data exfiltration, or unintended internet exposure.

Lp3

Medium
Category
MCP Least Privilege
Confidence
75% confidence
Finding
The skill describes capabilities that can read and manipulate files, execute code, and perform remote operations, but it does not declare any explicit tool scope or permissions boundary. In an agent ecosystem, missing scope declarations can cause overbroad access or make it harder for the host to enforce least privilege, increasing the risk of unintended local file access or unsafe execution paths.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
The skill explicitly promotes downloading files from URLs, forwarding ports to public URLs, and enabling external access, but it provides no user-facing warning about data exposure, privacy, or the risks of exposing services externally. In a skill that controls cloud sandboxes and GUI automation, this context makes the omission more dangerous because it can facilitate exfiltration, remote exposure of internal services, or unsafe handling of untrusted content.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
This code performs real device interactions including tap, swipe, text entry, and navigation actions on the connected Android sandbox. Although it logs each step, it does not warn the user that these actions may alter application state, submit input, or affect data within apps, which is relevant safety disclosure for automation code.

Autonomous Decision Making

Medium
Category
Excessive Agency
Content
print(f"❌ Error deleting mapping: {e}")
        else:
            print("\n💡 Mapping kept active. You can delete it later or it will be")
            print("   automatically removed when the sandbox is deleted.")


if __name__ == '__main__':
Confidence
80% confidence
Finding
Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Natural-Language Policy Violations

Low
Confidence
84% confidence
Finding
The example configuration sets `endpoint="https://api.lybic.cn"`, which imposes a specific regional endpoint in the natural-language documentation without offering user choice or explaining that the skill is region-specific. This can violate the language/locale policy criterion when a locale constraint is forced implicitly rather than presented as an opt-in or documented requirement.

Missing User Warnings

Low
Confidence
84% confidence
Finding
The skill instructs users to provide organization ID and API key values, including an example of manually passing credentials in code, but it does not warn against hardcoding, logging, or otherwise mishandling secrets. Because this skill enables control over cloud sandboxes and potentially external network exposure, leaked credentials could permit unauthorized sandbox creation, access, or misuse of the associated account.

Static analysis

No suspicious patterns detected.