{"id":"CVE-2026-59176","kind":"vulnerability","aliases":["CVE-2026-59176"],"related":[],"title":"Functype MCP server: version argument lets a tool call run attacker JavaScript","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.","summary":"The functype MCP server's set_functype_version tool passes an unvalidated version string to pnpm add, so package aliases such as file:, npm: or URLs install an attacker-chosen package. The server then imports that package, so an attacker runs JavaScript with the server's privileges and can read secrets, modify files or stop the server.","severity":"high","cvss":7.8,"epss":null,"exploited":false,"exploited_at":null,"products":[],"ecosystems":[],"tags":["ai-tooling","claude-code","functype","mcp","self-hosted","typescript"],"not_affected_if":["functype-mcp-server-not-installed","version-1.4.4-or-later"],"how_to_check":"- Run `pnpm list functype` or inspect the functype-mcp-server package version in the project to see if it is below `1.4.4`\n- Check whether the MCP server runs with `TRANSPORT_TYPE=httpStream`, which exposes it to the network","fix":"- Upgrade functype-mcp-server to `1.4.4` or later\n- Until upgraded, disable the set_functype_version tool or stop the MCP server from accepting tools/call requests from untrusted clients","status":"open","published_at":"2026-10-28T14:17:04+00:00","first_seen_at":"2026-10-28T14:33:23+00:00","triaged_at":"2026-10-28T14:34:25+00:00","updated_at":"2026-10-28T14:34:25+00:00","category":"ai-tooling","confidence":0.8,"triage":{"at":"2026-10-28T14:34:25Z","model":"claude-haiku-5-5","output":{"fix":"- Upgrade functype-mcp-server to `1.4.4` or later\n- Until upgraded, disable the set_functype_version tool or stop the MCP server from accepting tools/call requests from untrusted clients","reach":"internet","title":"Functype MCP server: version argument lets a tool call run attacker JavaScript","impact":"high","summary":"The functype MCP server's set_functype_version tool passes an unvalidated version string to pnpm add, so package aliases such as file:, npm: or URLs install an attacker-chosen package. The server then imports that package, so an attacker runs JavaScript with the server's privileges and can read secrets, modify files or stop the server.","category":"ai-tooling","nicknames":[],"who_cares":["functype","mcp","typescript","claude-code","self-hosted"],"confidence":0.8,"needs_auth":"no","worst_case":"Attacker runs JavaScript as the MCP server process and reads its secrets","analyst_note":"","how_to_check":"- Run `pnpm list functype` or inspect the functype-mcp-server package version in the project to see if it is below `1.4.4`\n- Check whether the MCP server runs with `TRANSPORT_TYPE=httpStream`, which exposes it to the network","needs_analyst":false,"not_affected_if":["functype-mcp-server-not-installed","version-1.4.4-or-later"],"who_is_affected":"Teams running the functype MCP server, especially in the default stdio mode where any connected MCP client or an AI assistant reading untrusted content can call the tool without authentication. The httpStream transport is non-default but lets network attackers reach the flaw directly. Teams that do not run functype-mcp-server can skip this.","user_interaction":"unknown","needs_special_setup":"no","severity_if_unknown":"high"},"cost_usd":0.000675,"input_tokens":3641,"output_tokens":621,"severity_before":"high"},"analyst_status":null,"analyst_note":null,"search":"'-2026':14A,17A '-59176':15A,18A '1.4.4':100C,268C 'abl':185C 'accept':112C 'access':243C,249C 'add':47B,130C 'afterward':156C 'ai':20B,211C 'ai-tool':19B 'alia':133C 'alias':50B 'also':219C 'arbitrari':145C 'argument':5A 'assist':212C 'attack':11A,60B,71B,172C,244C 'attacker-chosen':59B 'attacker-control':171C 'authent':205C 'call':9A 'caus':143C 'chosen':61B 'claud':23B 'claude-cod':22B 'client':184C 'code':24B 'connect':210C 'control':173C 'cve':13A,16A 'default':203C,235C 'deploy':239C 'document':228C 'dynam':164C 'enabl':201C 'execut':170C,251C 'exploit':195C 'famili':92C 'file':53B,84B,137C,257C 'fix':265C 'flaw':197C 'function':95C 'functyp':1A,25B,32B,37B,89C,103C,109C,127C,154C 'functype-mcp-serv':108C 'functype/cli':162C 'host':29B 'httpstream':238C 'immedi':155C 'import':66B,165C 'indirect':215C 'induc':221C 'initdocsdata':157C 'inject':217C 'instal':57B,152C,168C 'interpol':124C 'invok':191C,223C 'issu':263C 'javascript':12A,73B,174C 'let':6A 'librari':97C 'local':146C,248C 'malici':227C 'mcp':2A,26B,33B,105C,110C,177C,183C 'mode':208C 'modifi':83B,256C 'modul':169C 'network':242C 'network-access':241C 'newli':167C 'non':234C 'non-default':233C 'npm':54B,138C 'packag':49B,62B,68B,132C,149C 'package-alia':131C 'packages/mcp-server/src/index.ts':122C 'packages/mcp-server/src/lib/docs/data.ts':160C 'page':231C 'pass':40B 'path':141C 'pnpm':46B,129C 'prior':98C 'privileg':78B,181C 'process':179C,254C 'program':96C 'prompt':216C 'read':81B,253C 'remot':148C 'request':190C 'requir':247C 'resolv':161C 'run':10A,72B 'secret':82B,255C 'self':28B 'self-host':27B 'send':187C 'server':3A,34B,64B,76B,88B,111C,178C,261C 'set':36B,102C 'stdio':207C 'stop':86B 'string':44B,116C 'success':250C 'suscept':213C 'syntax':134C 'termin':259C 'tool':8A,21B,39B,106C,193C,199C 'tools/call':189C 'transport':236C 'true':158C 'type':237C 'typescript':30B,94C 'unconstrain':114C 'unvalid':42B 'url':56B,139C 'use':117C 'valid':120C 'version':4A,38B,43B,104C,115C,267C 'web':230C 'without':204C 'z.string':119C","nicknames":[],"mitigations":[],"who_affected":"Teams running the functype MCP server, especially in the default stdio mode where any connected MCP client or an AI assistant reading untrusted content can call the tool without authentication. The httpStream transport is non-default but lets network attackers reach the flaw directly. Teams that do not run functype-mcp-server can skip this.","tier":"B","verified":{},"analyst_revisit_at":null,"first_public_at":"2026-10-28T14:17:04+00:00","kev":null,"cvss_vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","cvss_by":"security-advisories@github.com","poc_count":0,"sources":[{"source":"nvd","external_id":"CVE-2026-59176","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-59176","severity":null,"published_at":"2026-10-28T14:17:04+00:00","modified_at":"2026-10-28T14:17:04+00:00","first_seen_at":"2026-10-28T14:33:23+00:00","fetched_at":"2026-10-28T14:33:23+00:00","note":null}],"documents":[],"notice":"Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai"}