The Patch Nobody Could Find: OpenCode, MCP, and the Command Injection That Never Got a CVE"

0xZoe
Analysis

a CVE", "article": "Three million downloads a week. Two hundred eleven thousand GitHub stars. Zero CVE identifiers.\n\nThat ratio is the anomaly, and it is the only number in this story that matters. In on-chain forensics, we have a name for a wallet that moves nine figures of volume and never once touches a public block explorer: we call it a ghost, and we treat the absence of a record as evidence in itself. Where early ICO ghosts still haunt the ledger, the missing entry is the finding.\n\nThe same logic applies here. An open-source AI coding agent, distributed through npm at roughly three million installs per week, shipped a command injection rated by its discoverers at CVSS 9.8 β€” and did it without a CVE. The flaw is fixed. The fix is real. The fix is also, for all practical purposes, invisible to every automated system that enterprise security depends on.\n\nI do not cover AI tooling as a beat. I cover ledgers, trust boundaries, and the places where human assumptions outrun machine verification. This is one of those places, and it sits closer to your crypto stack than you think β€” because the agent reading your Solidity is running on the same machine as your deployer key.\n\n## The Context You Need Before the Numbers Make Sense\n\nOpenCode is an open-source AI coding agent maintained under the Anomaly umbrella. It reads your repository, executes shell commands, and β€” critically for this story β€” opens browser windows on your behalf during authentication flows. It speaks MCP, the Model Context Protocol that Anthropic standardized and the industry then quietly canonized. If you have connected an agent to an on-chain data provider, a block explorer API, a DEX quote aggregator, or a custody endpoint in the last eighteen months, you have almost certainly spoken MCP.\n\nMCP works by delegation. A client asks a server: what can you do? The server responds with a discovery document β€” a machine-readable manifest describing its tools, its capabilities, and its authentication endpoints. The client parses that document and acts on it. This is elegant, composable, and structurally identical to letting a stranger fill out your authorization form for you.\n\nOne field in that document is called authorization_endpoint. It is a string. The server writes it. The client reads it and, in the OpenCode implementation, hands it to the operating system to open in a browser.\n\nThe open npm package is the intermediary. It is one of those dependencies nobody thinks about β€” a utility that launches the correct browser on the correct platform. It is also, by its maintainer's own written admission in the README, a package that \"does not make any security guarantees.\" Thousands of downstream projects have built shell-invocation capability on top of a dependency with an explicit disclaimer of safety.\n\nPillar Security found the flaw, reported it privately on August 29, and saw a merge on September 25. Version 1.18.33 of OpenCode shipped with what the project described as three layers of protection. The upstream open package shipped its own escape fix in 11.0.0 on November 15, and then a stricter single-quote wrapper in 11.0.4.\n\nThat is the factual skeleton. Everything interesting is in what happened around it.\n\n## The Attack Chain, and Why the Blacklist Was Never Going to Hold\n\nFollow the path. A discovery document arrives from a remote MCP server. The MCP SDK parses it. The value flows through oauth-provider.ts, into mcp/index.ts, into browser.ts, into open(), and out into PowerShell on Windows.\n\nPowerShell expands $(...) inside double quotes. That is not a bug; that is the language working as designed. So if the URL reaches the shell wrapped in double quotes, anything inside a $(...) subexpression executes. The open package escaped the application name. It did not escape the target URL. An escaping inconsistency inside a single function is the entire vulnerability β€” and it is the kind of inconsistency you only find by reading the code, not by running a scanner.\n\nThe classification is clean: CWE-78 for OS command injection, CWE-88 for argument injection. The discoverers proposed CVSS 9.8. I have no independent way to verify that score, and I will flag that limitation explicitly later, because honesty about source quality is the whole job.\n\nWhat matters more than the score is the defense that failed. The MCP TypeScript SDK, in August 2025, considered an allowlist for http and https schemes and closed the proposal. It shipped a blacklist instead: javascript:, data:, vbscript:.\n\nSit with that for a second. A blacklist is default-allow. An allowlist is default-deny. The proposal that was closed would have structurally prevented this class of attack. The mechanism that shipped instead permitted it, because the payload was a plain, boring, entirely legitimate-looking https:// URL.\n\nOpenCode's own fix added a protocol check. It also passed the payload through, for the same reason: the payload looked fine.\n\nOnly one layer of the three actually worked, and it was not a layer OpenCode wrote. It was the single-quote wrapping in open@11.0.4. Every team that read \"we added scheme validation\" and concluded they were safe is wrong. Every security questionnaire that asked \"did you validate the URL scheme?\" and got a yes is wrong.\n\nThe vulnerable shape is almost embarrassingly small:\n\n``\n// the shape that fails\nopen(authorizationEndpoint); // string β†’ shell β†’ PowerShell\n\n// the shape that holds\nopen('${authorizationEndpoint}'); // single quotes, no expansion\n`\n\nAnd the shape that never had the problem at all:\n\n`\nspawn(browserBinary, [authorizationEndpoint]); // argument vector, no shell\n`\n\nThat second pattern is not a patch. It is an architecture. Four implementations in the same ecosystem use it β€” gemini-cli, Claude Code, github-mcp-server, and Docker's mcp-gateway β€” and none of them were exposed by this class of attack, because there is no shell to inject into. Three others β€” OpenCode, openmcp-client, sequa-mcp β€” concatenate strings and call a shell, and all three have now been hit.\n\nThis is not luck. It is engineering culture, measurable and repeatable. The immune group is composed of projects with mature security teams or hard compliance constraints. The exposed group is community-led and startup-led. 2\n\nThere is a dependency-layer failure stacked on top. Affected OpenCode versions pinned open@10.1.2. The upstream fix landed in 11.0.0 on November 15. Downstream did not follow. This is the ordinary, structural sluggishness of npm's lockfile-plus-semver model β€” the mechanism that makes reproducible builds possible is the same mechanism that makes security fixes arrive months late, or never.\n\nAnd then there is the detection failure, which is the part that should keep a CISO awake.\n\nSoftware composition analysis tools β€” Dependabot, Snyk, Trivy, the entire class β€” match on identifiers. A CVE number. A GHSA advisory. No identifier means no match. No match means no alert. The only signal that reached downstream users was that a dependency version had changed, and that change was described in the changelog as a refactor.\n\n3 Those are not the same condition, and the gap between them is where supply chain risk actually lives.\n\nNow translate that into my world. An AI coding agent runs on a developer's machine. That machine holds source code, Git credentials, cloud API keys, .env files with RPC endpoints and signing keys. In a crypto team, it very often holds a hot wallet keystore and a deployer key, because the person writing the contracts is the person who deploys them. A remote code execution on that machine is not a web-application incident. It is a treasury incident with a lag time.\n\nThe threat model does not even require a malicious server. Domain expiry, registry hijacking, typosquatting on a lookalike MCP endpoint β€” any of these routes deliver the payload on connect. The perimeter is not \"do not connect to untrusted servers.\" The perimeter is \"any server that was ever trusted, at any point, including the one whose domain lapsed last Tuesday.\"\n\nHere is the inventory query I would actually run, and I would run it by hand because no scanner will do it for me:\n\n`sql\n-- Which of our agent installs can reach a shell-launching dependency?\nSELECT repo, dep_name, dep_version, last_updated\nFROM dependency_inventory\nWHERE dep_name IN ('open', 'opn', 'open-url', 'shell-exec')\n AND dep_version < '11.0.4'\nORDER BY weekly_downloads DESC;\n`\n\nThe answer will not come from your SCA dashboard. It will come from a spreadsheet and an afternoon.\n\n## The Contrarian Read: What the Report Cannot Prove\n\nNow I am going to do the thing that makes security vendors uncomfortable, and it is the same thing I did in 2022 when I mapped two billion dollars of hidden undercollateralized positions across ten lending protocols: I am going to separate what the data shows from what the narrative wants it to show.\n\nThe narrative is that OpenCode deliberately concealed a critical vulnerability under the word \"refactor\" to avoid the commercial cost of a CVSS 9.8 in its version history. It is a compelling story. It is also, right now, supported by exactly one source, relayed secondhand, with a timeline that does not close.\n\nThe report states a disclosure date of October 4. The page itself is dated October 19. And one of its own information points claims the vulnerable code was written on December 7, 2025 β€” three weeks after open@11.0.0 shipped its escape fix on November 15. A disclosure in October cannot describe code written in December. Either the date fields were extracted incorrectly, or the report spliced together facts from different windows. In either case, 4\n\nThe \"three consecutive years\" framing has the same problem. The CVEs cited as evidence cluster in July through September 2025. If you date the pattern from the October 2020 issue on the open package, the span is five years, not three. That is rhetoric wearing the costume of statistics, and I have watched enough ICO-era reporting to know how that costume gets reused.\n\nThere is a harder limit. My knowledge cutoff sits at January 2024. I have no internal reference for CVE-2025-6514, CVE-2025-58062, CVE-2025-10619, or Anomaly's handling of any of them. Every statement in this article that treats those identifiers as real is single-source acceptance. I am flagging it because the alternative β€” asserting confidence I have not earned β€” is how bad forensics gets published.\n\nBut here is where the contrarian angle cuts both ways, and this is the part the skeptics miss. 5\n\nA maintainer merging a security patch under a refactor title because the release train is weekly and the advisory process takes three weeks is not committing fraud. They are experiencing a structural conflict between shipping cadence and disclosure cadence. The outcome is identical to concealment: the fix exists, the index does not know, the scanner stays silent, and the downstream instance stays vulnerable. Whether the motive was malice, negligence, or ordinary velocity is a question for a court and a journalist. It is not a question that changes your exposure by a single byte.\n\nAnd the vendor's stated position makes this worse, not better. The line that dealing with a malicious MCP server is \"outside their threat model\" is not a technical denial. It is a threat-model exemption claim. It sits in direct tension with a product whose core function is to automatically connect to remote MCP servers. 6\n\nI would also point at the report's own incentive. Pillar Security published this, and Pillar's conclusion β€” that scheme validation is insufficient β€” points directly at the capability gap that SCA and ASPM products exist to fill. That does not make the finding wrong. It makes the finding a marketing asset as well as a technical document, and readers should price that in the way they price a token audit sponsored by the token's issuer.\n\nThe blind spot I find genuinely alarming is one the report does not address at all. The exposure is described as Windows and WSL. The open package on Linux routes through xdg-open. If the URL reaches sh -c unquoted, the injection path exists on Linux too, just with different syntax. Nobody in this report tested it. Nobody published a PoC for it. 7 If that test comes back positive, every exposure estimate in circulation needs upward revision.\n\nWhales don't announce. They position. And in this case, the position nobody has taken is the one that would tell us how bad this actually is.\n\n## What to Watch, and What to Do Before You Watch It\n\nThree signals will resolve the open questions, and all three are cheap to monitor.\n\nWatch whether OpenCode or Anomaly issues a retroactive CVE or a formal advisory. If they do, this story changes character β€” from an index bypass to a process delay β€” and my read adjusts accordingly. Watch whether mainstream SCA vendors ship non-identifier detection rules for versions at or below 1.18.32. If they do not within a quarter, the industry's claimed coverage of the JavaScript supply chain is systematically overstated, and that is a far bigger finding than one agent's browser handler. Watch whether any researcher publishes a horizontal scan of the top twenty MCP clients' browser-launch paths. My prior is that the string-concatenation pattern is common and underreported, and priors are meant to be tested.\n\nOver a longer horizon, the question moves to the specification. MCP delegates discovery to the server and gives the client no origin-binding requirement for authorization_endpoint. Until the spec forces metadata to be anchored to a verifiable origin, every client that implements discovery faithfully will reproduce this class of flaw. Precision in chaos is the only true advantage β€” and the chaos here is a standard that asks clients to trust a document they cannot authenticate.\n\nFor operators, the instruction is unglamorous and immediate. Do not wait for the alert. Clear your asset inventory by hand and check your open dependency version directly. Prefer agent implementations that use argument vectors over those that concatenate strings into shells, and treat that preference as a hard procurement gate rather than a nice-to-have. Add a line to your vendor questionnaire that asks whether any security fixes have shipped without an identifier β€” because your existing questionnaire, which asks about unpatched critical CVEs, will return a clean bill of health on exactly the systems that deserve suspicion.\n\nThe data doesn't negotiate. It records what was done and stays silent about what was meant. Somewhere in a changelog, a critical fix is filed under the word \"refactor,\" and every automated system downstream of that word has already moved on.\n\nThe real question is not whether your agent can be tricked into running a command. It is whether, six months from now, anyone would ever be able to find out that it was.", "tags": [ "AI Agent Security", "MCP Protocol", "Supply Chain Risk", "OpenCode", "npm Ecosystem", "CVE Disclosure", "Crypto Infrastructure", "On-Chain Forensics", "Vulnerability Analysis", "Developer Tooling" ], "prompt": "Dark editorial illustration, forensic and clinical mood. Center: a tall server rack whose front panel is rendered as a translucent ledger page, rows of faint numeric entries; one single row glows in amber-red where a shell prompt character leaks through the paper. Foreground left: a terminal window showing an unquoted URL string wrapped in double quotes, with a faint subexpression symbol catching the light. Foreground right: a browser window icon split in half, one half intact, one half dissolving into falling code fragments. Background: faint hexagonal network of connected nodes fading into charcoal darkness, suggesting a protocol graph. Palette: charcoal black, slate grey, muted steel blue, single amber accent. Style: high-contrast digital illustration with subtle paper grain, no text, no logos, no human figures, cinematic lighting, 16:9 aspect ratio." } ``