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

Status: published. Published: 2026-10-28. Updated: 2026-11-03.

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.

## Remediation

- fix: functype-mcp-server (npm): OSV reports a fixed version 1.4.4. Check the advisory for supported release branches. (source: OSV GHSA-wcjj-9m6g-2fr2) — https://github.com/advisories/GHSA-wcjj-9m6g-2fr2

## Affected products and versions

- jordanburke / functype: < 1.4.4 (affected). Source: CNA: GitHub_M
-  / functype-mcp-server (functype-mcp-server): ≥ 0; < 1.4.4 (affected, semver); OSV events: introduced 0; fixed 1.4.4. Source: OSV GHSA-wcjj-9m6g-2fr2

## Severity and prioritization

- CVSS 3.1: 7.8 (high); CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H; source: CNA: GitHub_M

- CISA KEV: No listing in collected sources

- EPSS: 0.21% as of 2026-11-02; percentile 11.42%

- SSVC: exploitation poc; automatable no; technical impact total; source ADP: CISA-ADP

- Weaknesses: CWE-829

## Exploit evidence

- exploit: https://github.com/jordanburke/functype/security/advisories/GHSA-wcjj-9m6g-2fr2 (ADP: CISA-ADP)

## References

- https://github.com/jordanburke/functype/security/advisories/GHSA-wcjj-9m6g-2fr2 (CNA: GitHub_M; x_refsource_CONFIRM)

- https://github.com/jordanburke/functype/commit/c0d58ad9c2a7d15c6117bd3adbbd75de37317dcf (CNA: GitHub_M; x_refsource_MISC)

- https://github.com/jordanburke/functype/releases/tag/v1.4.4 (CNA: GitHub_M; x_refsource_MISC)

- https://github.com/jordanburke/functype/security/advisories/GHSA-wcjj-9m6g-2fr2 (ADP: CISA-ADP; exploit)

- https://github.com/advisories/GHSA-wcjj-9m6g-2fr2 (OSV / GitHub Security Advisories; advisory)

- https://osv.dev/vulnerability/GHSA-wcjj-9m6g-2fr2 (OSV / GitHub Security Advisories; osv)

## Provenance

- CNA: GitHub_M: https://www.cve.org/CVERecord?id=CVE-2026-59176; retrieved 2026-11-03; source updated 2026-11-03

- OSV / GitHub Security Advisories: https://osv.dev/vulnerability/GHSA-wcjj-9m6g-2fr2; retrieved 2026-11-03; source updated 2026-11-02

- FIRST EPSS: https://api.first.org/data/v1/epss?cve=CVE-2026-59176; retrieved 2026-11-03; source updated Not reported

Revision: 077c8babf54a5c72928da4a90218018cb15f0eb346137f0e0918e392acf96246

Canonical: https://y2.dev/cve/CVE-2026-59176

## Agent and API access

Public CVE pages, Markdown, and JSON are free to read without an account or API key.

- Public catalog: https://y2.dev/cve/index.json. Follow nextCursor with the same search, filters, sort, and limit (1–100). A null cursor marks the end.

- WebMCP: search_cve_disclosures, get_cve_disclosure, get_cve_page_markdown, get_y2_cve_access. Available in compatible browsers.

- Cyber API: https://api.y2.dev/api/v2/cyber/cves and https://api.y2.dev/api/v2/cyber/cves/{cveId}.

- Y2 Pro or Elite: create a workspace API key with the intel:cyber scope and send Authorization: Bearer <Y2_API_KEY>. Setup: https://y2.dev/docs/api/create-key.

- x402: Pay per request without an account or API key. Omit Authorization, read the HTTP 402 PAYMENT-REQUIRED challenge, validate its current requirements, and retry with PAYMENT-SIGNATURE through an authorized payment client. These browser tools never make payments. Guide: https://y2.dev/docs/api/x402.

- OpenAPI: https://y2.dev/api/openapi.yaml. Agent access metadata: https://y2.dev/cve/agent.json.

Collected public records only. Check source status for coverage and freshness.