T09 · Insecure Skill Coding Practices
- Location
scripts/render.md:20- Finding
Temporary Directory Exposed Through an Unrestricted HTTP Server
- Content
View full analysis
Vulnerability Details
File Location:
scripts/render.md, lines 20–23
Vulnerability Type: Unsafe temporary-file serving and excessive network exposure
Risk Level: MediumVulnerable Code
bash cd /tmp && python3 -m http.server 18800 &Technical Analysis
The rendering instructions start Python's built-in HTTP server from the shared
/tmpdirectory. By default,python3 -m http.serverlistens on all available network interfaces rather than only the loopback interface. It also provides directory listings and serves every readable file beneath its working directory.The generated
/tmp/breakup_card.htmlmay contain sensitive relationship details, quoted conversations, or content extracted from private chat screenshots. Serving all of/tmpunnecessarily exposes both that report and unrelated temporary files belonging to other processes or users.The server is launched in the background and the documented workflow does not retain its process ID or stop it after the screenshot is generated. Consequently, the exposure can continue after rendering is complete. Repeated executions can also leave unmanaged processes or encounter predictable-port conflicts.
Attack Path
- A user submits sensitive relationship information or private chat records to the Skill.
- The Skill incorporates that information into
/tmp/breakup_card.html. - The rendering workflow changes its working directory to
/tmp. - It launches an HTTP server on the predictable TCP port
18800, listening on all interfaces by default. - An attacker with network access to the host connects to
http://HOST:18800/. - The attacker uses the directory listing to identify and download
breakup_card.htmlor other readable temporary files. - Because the server is not terminated by the workflow, the attacker may retain access after the rendering operation has finished.
This exploitation path depends on port
18800being reachable from an attacker-controlled network ...[truncated 859 chars]- Remediation
View remediation
Remediation Suggestions
-
Avoid starting an HTTP server. Load the generated document directly through a local file URL:
python from pathlib import Path page.goto(Path("/tmp/breakup_card.html").as_uri(), wait_until="load") -
Use a private temporary directory. Create a unique directory with owner-only permissions rather than placing sensitive output directly in shared
/tmp:bash workdir="$(mktemp -d)" chmod 700 "$workdir" -
If HTTP is unavoidable, bind only to loopback and serve only the private rendering directory:
bash cd "$workdir" python3 -m http.server 18800 --bind 127.0.0.1 & server_pid=$! -
Terminate the server deterministically. Record the process ID and install cleanup handling before rendering:
bash trap 'kill "$server_pid" 2>/dev/null; rm -rf "$workdir"' EXIT -
Prefer an ephemeral port instead of the fixed port
18800, and pass the selected local URL directly to Playwright. -
Remove sensitive artifacts after delivery, including the HTML, screenshot, and copied media file when retention is not explicitly required.
-
Apply restrictive permissions such as
0600to generated HTML and image files, and ensure no untrusted content can introduce external resource requests during rendering.
-
