# CVE-2026-59176: Functype: MCP set_functype_version Package Alias RCE via Unsanitized pnpm install + Dynamic Import


- **Severity:** High 7.8 (`CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Fix available:** Yes
- **Published:** 28 Oct 2026
- **Updated:** 28 Oct 2026
- **Also known as:** GHSA-wcjj-9m6g-2fr2

## What is CVE-2026-59176?

CVE-2026-59176 is a high-severity vulnerability in jordanburke functype, published on 28 Oct 2026. 

### Official description

Functype is a family of TypeScript functional programming libraries. Prior to 1.4.4, the `set_functype_version` MCP tool in `functype-mcp-server` accepts an unconstrained `version` string using only `z.string()` validation in `packages/mcp-server/src/index.ts` and interpolates it into `functype@<version>` for `pnpm add`. Package-alias syntaxes such as `file:`, `npm:`, URLs, or paths can cause an arbitrary local or remote package to be installed as functype. Immediately afterward, `initDocsData(true)` in `packages/mcp-server/src/lib/docs/data.ts` resolves `functype/cli` and dynamically imports the newly installed module, executing attacker-controlled JavaScript with the MCP server process's privileges. Any MCP client able to send a `tools/call` request invoking the tool can exploit the flaw; the tool is enabled by default without authentication in `stdio` mode. A connected AI assistant susceptible to indirect prompt injection can also be induced to invoke it from a malicious document or web page. In non-default `TRANSPORT_TYPE=httpStream` deployments, a network-accessible attacker does not require local access. Successful execution can read process secrets, modify files, or terminate the server. This issue is fixed in `version` 1.4.4.

Weakness: CWE-829 (Inclusion of Functionality from Untrusted Control Sphere)

## Which versions are affected by CVE-2026-59176?

2 open source packages ship an affected version, including functype-mcp-server.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `functype-mcp-server` | npm | All versions | 1.4.4 |
| `functype-mcp-server` | npm | All versions | 1.4.4 |

## How do I fix CVE-2026-59176?

Upgrade functype-mcp-server to 1.4.4 or later.

## Is CVE-2026-59176 being exploited?

There is no known exploitation of CVE-2026-59176 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-59176 and fix it if it is affected.

What it is: CVE-2026-59176 is a high-severity vulnerability in jordanburke functype, published on 28 Oct 2026. 
Exploitation: There is no known exploitation of CVE-2026-59176 in the wild and no public exploit code.

Affected packages and fixed versions:
- functype-mcp-server (npm): affected all versions; fixed in 1.4.4
- functype-mcp-server (npm): affected all versions; fixed in 1.4.4

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-59176/ (Markdown: https://insights.sbomify.com/CVE-2026-59176/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-59176
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-59176
- OSV: https://osv.dev/vulnerability/CVE-2026-59176

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-59176/
Summaries are generated and may contain mistakes; the official description above is the record.
