T09 · Insecure Skill Coding Practices
- Location
SKILL.md:48- Finding
Unauthenticated Python Code-Execution Service Published on All Host Interfaces
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 48–76
Vulnerability Type: Unauthenticated network-exposed code execution
Risk Level: HighVulnerable code snippet:
bash # Using docker-compose (recommended) docker-compose up -d # Or using docker directly docker run -d --name cad-agent -p 8123:8123 cad-agent:latest servebash curl -X POST http://localhost:8123/model/create \ -H "Content-Type: application/json" \ -d '{ "name": "my_part", "code": "from build123d import *\nresult = Box(60, 40, 30)" }'Technical Analysis
The Docker command publishes container port 8123 through
-p 8123:8123. By default, Docker binds such a published port to all host interfaces rather than only the loopback interface. Consequently, the service may be reachable by other systems allowed to connect to the host.The documented
/model/createendpoint accepts Python source code in thecodeJSON property and executes modeling logic inside the container. No authentication, authorization, request signing, source-code validation, or network access restriction is documented. The combination of a broadly published port and an endpoint intentionally executing caller-controlled Python creates an unauthenticated remote code-execution channel.The server implementation is not included in the audited project, so the presence or strength of any undocumented sandbox cannot be verified. The confirmed exposure should therefore not be assumed safe merely because execution occurs inside a container.
Attack Path
- A user starts the service using the documented
docker runcommand. - Docker publishes TCP port 8123 on the host's available network interfaces.
- An attacker identifies a reachable host exposing port 8123.
- The attacker submits crafted Python through
POST /model/createorPOST /model/modify. - The server executes the submitted code with the privileges and ca ...[truncated 969 chars]
- A user starts the service using the documented
- Remediation
View remediation
Remediation Suggestions
-
Bind the service exclusively to loopback when remote access is unnecessary:
bash docker run -d \ --name cad-agent \ -p 127.0.0.1:8123:8123 \ cad-agent:latest serve -
Require strong authentication and authorization for all code-execution and model-modification endpoints.
-
Place the service behind an authenticated reverse proxy when network access is required.
-
Execute submitted code in a dedicated, disposable sandbox rather than directly in the long-running API process.
-
Run the container as a non-root user and use a read-only root filesystem.
-
Drop all unnecessary Linux capabilities and enable
no-new-privileges. -
Do not mount the Docker socket, host directories, credentials, or other sensitive resources into the container.
-
Disable unnecessary outbound network access from code-execution sandboxes.
-
Enforce strict CPU, memory, process, disk, request-size, and execution-time limits.
-
Validate model names and request fields, and reject unsupported Python syntax or imports where feasible.
-
Document the service's trust boundary and explicitly warn that it must not be exposed to untrusted networks.
-
