{"id":"CVE-2026-59176","summary":"Functype: MCP set_functype_version Package Alias RCE via Unsanitized pnpm install + Dynamic Import","details":"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@\u003cversion\u003e` 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.","aliases":["GHSA-wcjj-9m6g-2fr2"],"modified":"2026-11-05T02:30:25.554432680Z","published":"2026-10-28T13:08:52.592Z","database_specific":{"cna_assigner":"GitHub_M","cwe_ids":["CWE-829"],"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/59xxx/CVE-2026-59176.json"},"references":[{"type":"WEB","url":"https://github.com/jordanburke/functype/releases/tag/v1.4.4"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/59xxx/CVE-2026-59176.json"},{"type":"ADVISORY","url":"https://github.com/jordanburke/functype/security/advisories/GHSA-wcjj-9m6g-2fr2"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-59176"},{"type":"FIX","url":"https://github.com/jordanburke/functype/commit/c0d58ad9c2a7d15c6117bd3adbbd75de37317dcf"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/jordanburke/functype","events":[{"introduced":"0"},{"fixed":"65296a0ca67a5d3f13e3c28ab93ea52174caa620"},{"fixed":"c0d58ad9c2a7d15c6117bd3adbbd75de37317dcf"}],"database_specific":{"extracted_events":[{"source":"AFFECTED_FIELD","strategy":"StringRangeExpression","range":[{"introduced":"0"},{"fixed":"1.4.4"}]},{"range":[{"fixed":"c0d58ad9c2a7d15c6117bd3adbbd75de37317dcf"}],"source":"REFERENCES_COMMIT"},{"original_tag":"v1.4.4","range":[{"fixed":"65296a0ca67a5d3f13e3c28ab93ea52174caa620"}],"source":"REFERENCES_TAG"}]}}],"versions":["v1.4.3","v1.4.2","v1.4.1","v1.4.0","v1.3.1","v1.3.0","v1.2.2","v1.2.1","v1.2.0","v1.1.0","v0.60.6","pre-monorepo-migration","v0.60.4","v0.60.3","v0.60.2","v0.60.1","v0.60.0","v0.6.0","v0.59.1","v0.59.0","v0.58.1","v0.58.0","v0.57.3","v0.57.2","v0.57.1","v0.57.0","v0.56.0","v0.55.0","v0.54.0","v0.53.0","0.53.0","v0.52.0","v0.51.0","v0.49.0","v0.48.0","v0.47.1","v0.47.0","v0.46.2","v0.46.1","v0.46.0","v0.45.0","v0.44.0","v0.4.3","v0.41.3","v0.41.2","v0.41.0","0.10.0","0.9.5","v0.8.5"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-59176.json"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"}]}