Back to skill

Security audit

one line HTTP static server

Security checks for vulnerabilities and agentic risk

Overview

This is a legitimate static-server helper, but several ready-to-run examples can expose local files or run mutable third-party code without enough warning.

Review this skill carefully before installing. Use it only from a dedicated non-sensitive directory, prefer localhost bindings such as 127.0.0.1, avoid the inline Node.js and Java examples, and pin or preinstall third-party tools instead of letting an agent run mutable registry commands automatically.

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

T09 · Insecure Skill Coding Practices

Error
Location
references/nodejs.md:62
Finding

Arbitrary Local File Disclosure in the Inline Node.js Server

Content
View full analysis
{require('fs').createReadStream('.'+req.url).pipe(res)}).listen(8000)" ``` The accompanying note only states that the implementation does not handle errors, MIME types, or directory listings. It does not warn that request paths are used unsafely. ### Technical Analysis The server concatenates the attacker-controlled `req.url` value directly with `"."` and passes the result to `fs.createReadStream`. It does not: - Parse and decode the URL safely. - Normalize the resulting filesystem path. - Verify that the resolved path remains inside the intended document root. - Reject traversal components. - Prevent symbolic-link escapes. - Restrict the listener to the loopback interface. A path such as `./../../etc/passwd` is resolved by the operating system outside the current working directory. In addition, `listen(8000)` listens on the unspecified address, which generally exposes the server on all available interfaces. ### Attack Path 1. A user starts the documented inline Node.js server in a directory containing files intended for local preview. 2. The process opens port 8000 without explicitly restricting it to loopback. 3. An attacker with network access sends a path-preserving HTTP request containing traversal components, for example: ```bash curl --path-as-is http://target-host:8000/../../etc/passwd ``` 4. The server constructs the filesystem path by evaluating `"." + req.url`. 5. `fs.createReadStream` follows the traversal outside the intended document root. 6. The selected file is streamed to the attacker if it is readable by the Node.js process. ### Impact Assessment An attacker may read files accessible to the account running Node.js. Dependin ...[truncated 502 chars]
Remediation
View remediation
{ try { const pathname = decodeURIComponent(new URL(req.url, "http://localhost").pathname); const candidate = path.resolve(root, "." + pathname); if (candidate !== root && !candidate.startsWith(root + path.sep)) { res.writeHead(403); return res.end("Forbidden"); } const canonical = fs.realpathSync(candidate); if (canonical !== root && !canonical.startsWith(root + path.sep)) { res.writeHead(403); return res.end("Forbidden"); } fs.createReadStream(canonical) .on("error", () => { res.writeHead(404); res.end("Not found"); }) .pipe(res); } catch { res.writeHead(400); res.end("Bad request"); } }).listen(8000, "127.0.0.1"); ``` ]]>

T09 · Insecure Skill Coding Practices

Error
Location
references/java.md:39
Finding

Arbitrary Local File Disclosure in the Inline Java Server

Content
View full analysis
{ var path = Path.of("." + exchange.getRequestURI().getPath()); var bytes = Files.readAllBytes(path); exchange.sendResponseHeaders(200, bytes.length); exchange.getResponseBody().write(bytes); exchange.close(); }); server.start(); } } ``` ### Technical Analysis The request URI path is concatenated directly with `"."` and converted to a filesystem path. The implementation does not normalize the path or verify that it remains beneath an approved document root. The subsequent `Files.readAllBytes(path)` operation therefore accepts paths containing parent-directory traversal components. The implementation also does not protect against symbolic links that point outside the served directory. `new InetSocketAddress(8000)` creates a wildcard listener rather than explicitly binding to loopback. Consequently, the vulnerable handler may be accessible to other network hosts. ### Attack Path 1. A user saves and executes the documented `Server.java` example. 2. The Java process listens on port 8000 on available network interfaces. 3. An attacker sends a path-preserving request containing parent-directory components. 4. The server creates a path using: ```java Path.of("." + exchange.getRequestURI().getPath()) ``` 5. The filesystem resolves the traversal components outside the current directory. 6. `Files.readAllBytes` reads the targeted file. 7. The server responds with HTTP status 200 ...[truncated 544 chars]
Remediation
View remediation
{ try { String requestPath = exchange.getRequestURI().getPath(); Path candidate = root.resolve("." + requestPath).normalize(); if (!candidate.startsWith(root)) { exchange.sendResponseHeaders(403, -1); exchange.close(); return; } Path canonical = candidate.toRealPath(); if (!canonical.startsWith(root) || !Files.isRegularFile(canonical)) { exchange.sendResponseHeaders(403, -1); exchange.close(); return; } long length = Files.size(canonical); exchange.sendResponseHeaders(200, length); try (var input = Files.newInputStream(canonical); var output = exchange.getResponseBody()) { input.transferTo(output); } } catch (NoSuchFileException exception) { exchange.sendResponseHeaders(404, -1); exchange.close(); } catch (Exception exception) { exchange.sendResponseHeaders(400, -1); exchange.close(); } }); ``` ]]>

T08 · Insecure Dependencies

Warning
Location
SKILL.md:29
Finding

Execution of Unpinned Third-Party Packages and Mutable Remote Artifacts

Content
View full analysis
new(root=>".");' -p 8000` | Yes | `cpan Plack` | | Perl (Brick) | `perl -MHTTP::Server::Brick -e '$s=HTTP::Server::Brick->new(port=>8000);$s->mount("/"=>{path=>"."});$s->start'` | Yes | `cpan HTTP::Server::Brick` | | Perl (Mojo) | `perl -MMojolicious::Lite -MCwd -e 'app->static->paths->[0]=getcwd;app->start' daemon -l http://*:8000` | No | `cpan Mojolicious::Lite` | | Docker (Nginx) | `docker run --rm -v "$PWD":/usr/share/nginx/html:ro -p 8000:80 nginx` | Configurable | Docker | | Docker (PHP) | `docker run -it --rm -v "$PWD":/app -w /app -p 8000:8000 php:8.2-cli php -S 0.0.0.0:8000` | No | Docker | | PowerShell (Pode) | `Start-PodeStaticServer -Port 8000 -FileBrowser -Address 0.0.0.0` | Yes | `Install-Module Pode` | ``` Related mutable-source examples also appear in: - `references/nodejs.md:3-53` - `references/deno.md:3-40` - `references/go.md:3-13` - `references/docker.md:3-38` - `references/rust.md:3-65` ### Technical Analysis The comman ...[truncated 2222 chars]
Remediation
View remediation
-p 8000 go run github.com/goware/webify@ -port 8000 . deno run --allow-net=127.0.0.1:8000 --allow-read=/absolute/served/directory jsr:@std/http@/file-server docker run --rm \ -v "$PWD":/usr/share/nginx/html:ro \ -p 127.0.0.1:8000:80 \ nginx@sha256: ``` The placeholders must be replaced with versions and digests that have been independently reviewed and approved. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (59)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

Binding Mojolicious to http://*:8000 listens on all interfaces, which can expose the local filesystem-backed static directory to other hosts on the network. Because the example also serves the current working directory, a user can unintentionally publish local files beyond their machine with a single copy-pasted command.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README provides multiple one-line static server commands but does not warn that they expose the current directory or selected files over HTTP. In an agent skill context, this is more dangerous because an agent may execute the command automatically and unintentionally publish sensitive local files, project secrets, or internal content.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding

The README recommends npx http-server -p 8000 without pinning a specific package version. Because npx resolves and may fetch the latest package from the registry at execution time, users can be exposed to unexpected or malicious upstream changes, typosquatting, or supply-chain compromise.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
90% confidence
Finding

The Docker example uses nginx without a tag or digest, which defaults to a moving target image. This makes builds and executions non-reproducible and can expose users to compromised or incompatible upstream image updates.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The README suggests using 0.0.0.0 for LAN access without warning that this makes the server reachable from other devices on the network. In the context of a skill whose purpose is to start ad hoc file servers, omitting this warning materially increases the chance of accidental data exposure beyond the local machine.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
93% confidence
Finding

The CORS example again references npx http-server --cors without a pinned version. This repeats the same supply-chain risk: invoking an unpinned package can cause an agent or user to run newly published code they did not review.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill teaches users to serve the current or specified directory but does not prominently warn that this can expose files, directory listings, and embedded secrets to other users or devices depending on bind address and environment. In a copy-paste skill, omission of this warning materially increases the chance of accidental data exposure.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

The skill recommends npx http-server without pinning a package version. Because npx resolves and may fetch the latest package at execution time, users can be exposed to upstream supply-chain compromise or unexpected behavior changes, which is especially risky in an agent skill that presents commands as ready-to-run guidance.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding

The skill recommends npx serve without a pinned version, allowing the fetched code to vary over time. In practice this creates a supply-chain risk surface where a compromised or newly malicious release could be executed directly by users following the skill.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
94% confidence
Finding

The npx node-static command is unpinned and may execute whatever version the registry resolves at runtime. This is dangerous because transient package execution bypasses normal dependency review and can introduce arbitrary code execution through a malicious or compromised package release.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill includes commands and guidance for binding to 0.0.0.0, which makes the server reachable from other hosts, but it does not provide an explicit warning about network exposure. This is dangerous because users may unintentionally publish local files on a LAN or broader network, especially in containerized, cloud, or port-forwarded environments.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
93% confidence
Finding

This repeated npx http-server reference is a true supply-chain risk for the same reason as the table entry: the package version is unspecified and may change at runtime. Within a command-oriented skill, such guidance is likely to be copied directly and executed.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
93% confidence
Finding

This repeated npx http-server reference is a true supply-chain risk for the same reason as the table entry: the package version is unspecified and may change at runtime. Within a command-oriented skill, such guidance is likely to be copied directly and executed.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
92% confidence
Finding

The common-options guidance references npx http-server --cors without pinning a version. This preserves the same upstream package execution risk while also encouraging a network-facing configuration that users may apply directly.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The documentation recommends serving the current directory over HTTP and explicitly notes that directory listing is enabled, but it does not warn that this can expose sensitive local files, dotfiles, build artifacts, or credentials if run from the wrong location. In a skill/reference context, users may copy-paste the command directly, making accidental data exposure a realistic risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The examples show how to start a static HTTP server, including directory serving and directory listings, but do not warn that doing so can expose local files to a network and unintentionally publish sensitive content. In reference documentation, this omission can lead users to run the server on reachable interfaces or over broad directories without understanding the exposure, especially since one example explicitly binds to a non-loopback address.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The documentation explicitly shows how to bind a static file server to 0.0.0.0 and notes that directory listing is enabled, but it does not warn that this exposes local files to other hosts on the network. In a reference skill, users may copy commands verbatim, so omitting cautions about interface binding, served path selection, and directory listing increases the chance of accidental data exposure.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding

Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding

Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding

Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding

Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding

Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding

Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding

Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
75% confidence
Finding

Docker image references without a specific tag (:latest is implicit) or digest (@sha256:...) can be silently replaced by a malicious image.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.