Abstract technical illustration on a dark navy field: a tall narrow gateway structure stands at the centre, drawn as two parallel vertical bars with a narrow gap between them. A thin pale line enters from the left and passes through the gap, where it meets a small curved bracket shape that splays into three separate filaments running to the right, each one arriving at a different small square cell of a faint grid of identical cells filling the right half of the frame. Behind the gateway, a low narrow shelf of small illuminated cylinders fades into the dark, suggesting a store of keys. All light is cyan and cool white, with one small amber accent on the bracket. No text, no people, no organisation logos appear. The OrcaRouter logo is composited in the bottom-right corner.
AI Safety Incidents

Mittwald Breach: A Shell Injection in Its Own MCP Server

Author

jinhao.song

Date Published

Latest models · 20View all models →
Back to all posts

On 7 November 2026 the German web host Mittwald CM Service disclosed that an attacker had entered its platform through its own Model Context Protocol server — the connector that lets customers drive the mStudio hosting panel from AI assistants — and that 56 customer projects had been compromised. The post-mortem Mittwald published on 25 November traced the entry to a shell injection in a single tool: the comment and passphrase arguments of an SSH-key helper were interpolated into a command string and run through execSync, so a crafted comment became a command inside the server's container. That server held a live access and refresh token for every active user, Mittwald employees included. This record is one entry in the AI incident archive, which holds it alongside the other MCP and agent-infrastructure incidents of the past year, each with its own sources, severity grade and confidence flag.

Mittwald CM Service is a North Rhine-Westphalia host that sells mainly to web agencies, and mStudio is the panel where those agencies manage sites, hosting, mail and databases. The MCP server was the newest door on that panel, added so that an assistant could read and change a customer's hosting configuration on their behalf. It is worth being precise about what kind of AI incident this is, because the archive's ai_involvement flag reads "confirmed" for two separate reasons and only one of them is about the attacker: the compromised system was an AI-integration service, and Mittwald says it built that service largely with AI coding agents. Whether the person on the other end was using AI is a different question, and the evidence for it is thinner.

The flaw was in a tool that had no reason to exist

Mittwald's post-mortem, written by Martin Helmich on 25 November, is unusually explicit about the code. One MCP tool generated an SSH keypair when a caller supplied no key of their own. Its two caller-controlled parameters were comment and passphrase. The implementation assembled those values into a string and handed it to Node's execSync, in the shape ssh-keygen -t ed25519 -f "${keyPath}" -N "${passphrase}" -C "${comment}".

The double quotes do not help. Shell command substitution still runs inside double quotes, and a value containing a quote character can close the string and start a new command. A comment such as $(curl ...) was executed by the shell before ssh-keygen ever started. Mittwald classifies the result as a full shell injection, and therefore remote code execution, in the MCP server's container.

Two details in the post-mortem make the bug worse than a careless line. The first is that the function deleted the private key immediately and returned only the public half, so as written it served no purpose — the code was scaffolding that had never been justified. The second is what it left behind. An injected command could force the error path, and the error path skipped cleanup: Mittwald found 161 orphaned keypairs prefixed mcp-eval-key- in the container, and three of them carried attacker traces, including the output of id, the container's hostname and an outbound curl. The prefix is the tell — eval code, in production. The fix it should have had, Mittwald writes, was execFileSync with an argument array, or generating the key in-process with crypto.generateKeyPairSync.

One container, every user's session token

The injection was the way in; the token design is why the way in mattered. Customers authenticated to the MCP server over OAuth2, and the server stored an access token and a refresh token per session so it could act in that user's name against mStudio. Mittwald's own summary of the consequence is the sentence that should be quoted from this incident: "Der MCP-Server hält jederzeit die gültigen Tokens aller aktiven Nutzer*innen" — the MCP server holds the valid tokens of all active users at all times.

That turned one container into every account. The session store was readable from inside the container, the granted scopes were often broad, staff accounts could reach large numbers of production projects, the filesystem was writable, and the container had outbound internet access. Nothing had to be escalated. Whoever held the shell could read the store and choose whose identity to wear, and the first identity chosen, at 16:25 on 27 October, was an employee's.

This is where the blast radius comes from, and where the vendor's own account changed between documents. On 9 November, webhosting.today reported Mittwald's position that customers who had never used the MCP server were unaffected. The 25 November post-mortem widens it: everyone who had used the MCP server was affected, along with the projects their accounts could reach — even where those project owners had never touched MCP at all. A reader who took the earlier guidance as final would have drawn the wrong conclusion about their own exposure.

How agent-written code reached production

Mittwald states that the MCP server was largely built with AI coding agents, and that its review and guardrails were immature. The post-mortem's explanation of why nobody caught the bug is specific rather than apologetic: the code looked plausible, the mcp-eval-key name suggested test code rather than anything that would ship, and no static analysis step flagged an execSync call with interpolated variables. Mittwald calls the result an "unverzeihliche Schwachstelle" — an unforgivable weakness — and says it met MITRE's criteria for that category.

That is an AI-safety claim of a narrow and checkable kind, and it should be read as one. The claim is not that an AI wrote a bug that a human would not have written; execSync with string interpolation is one of the oldest mistakes in Node. The claim is that a pipeline fast enough to produce a working server outran the review that would have caught a known-bad pattern, and that the test-flavoured naming made the bad pattern look intentional. Nothing in either Mittwald document establishes which agent or model was used, how much of the code it produced, or what fraction of the server was reviewed by a person.

The attacker had eleven days and used most of them

The first probe came on the evening of 21 October, while the hosting industry was absorbed by PHP2Shell. On 23 October the attacker behaved like an ordinary customer: registering test accounts, installing extensions, trying simple injections. At 14:58 on 27 October another account was registered; at 15:03 it exploited the tool for a container shell; at 16:25 it began spending stolen tokens.

What followed reads like a patient, mostly unsuccessful campaign that kept finding small openings. On 28 October the attacker started short-lived containers that mounted neighbouring volumes, collected configuration files, keys, database dumps and credential material, then removed the containers — and in some customer projects took over n8n owner accounts along with the key that encrypts stored n8n credentials. On 29 and 30 October it created API tokens, invited its own account as owner of a customer account (the invitation was never accepted), created SSH users in about ten projects, and abused extension webhooks for server-side request forgery, rewriting a webhook URL more than 2,000 times toward internal addresses; Mittwald says only limited metadata came back. On 2 November a routine deployment recreated the MCP container and destroyed the earlier container logs. On 3 and 4 November the attacker re-read the session store, filtered for employee tokens, triggered 78 staff password resets (none were completed), opened a reverse tunnel and scanned the adjacent network without result. Several thousand tokens were taken in total; most had expired, but hundreds were still valid.

Detection came on the morning of 4 November. The first attacker account was blocked at 11:11 and the status page moved to "investigating" at 12:53; the MCP server was shut down, every token revoked, the OAuth client removed, staff mStudio accounts disabled and attacker artefacts deleted. Projects showing traces were locked shortly after midnight, registration was disabled, external forensic specialists were engaged and the authorities were notified — a detail The Record and webhosting.today both carry, and which no regulator has since expanded on: no notice from the BSI or a German data-protection authority appeared in the coverage reviewed for this article. mStudio login and SSH access returned at 10:56 on 7 November, with passkeys offered for the first time.

HTML card titled 'Eleven days, logged to the minute', kicked 'Mittwald MCP server incident · 21 October to 13 November 2026' and subtitled 'Times and figures as published in Mittwald's post-mortem of 25 November 2026. All times are Mittwald's local time.' Two columns. The left column, headed 'The sequence' in blue, carries nine dated rows: 21 October evening, first probes against the MCP tool during the PHP2Shell scramble; 23 October, behaves as an ordinary customer with test accounts, extensions and simple injections; 27 October 14:58, 15:03 and 16:25, an account registered then exploited for a container shell five minutes later, with token use from an employee account beginning at 16:25; 28 October, short-lived containers mount neighbouring volumes and collect configs, keys, database dumps and credential files, with n8n owner accounts taken over in some customer projects; 29 to 30 October, API tokens created, SSH users planted in about 10 projects, one webhook URL rewritten more than 2,000 times toward internal addresses as an SSRF attempt; 3 to 4 November, 78 staff password resets triggered and none completed, the adjacent network scanned without result; 4 November 11:11 and 12:53, first attacker account blocked and status page set to investigating, MCP shut down, all tokens revoked, the OAuth client removed and staff mStudio accounts disabled; 5 to 7 November with 7 November 10:56, compromised projects locked, registration disabled, forensic specialists engaged, authorities notified, mStudio login and SSH restored; 9 to 13 November with 12 November 01:28, a second phase through hosting accounts and WordPress plugins and the Neos zero-day on mittwald.de detected on 12 November and fixed by the Neos project on 13 November. The right column, headed 'The numbers' in amber, carries six tiles: 56 customer projects classified as compromised after forensic examination; 161 orphaned keypairs left in the container, 3 of them holding attacker traces; 78 staff password resets the attacker triggered, none completed; 2,000+ rewrites of one extension webhook URL aimed at internal addresses; 8 hosting accounts whose passwords the attacker used in phase two; 10 min for a self-hosted model to find the decisive log line and code location. A footer reads 'Sources: Mittwald, Postmortem: Wie ein Angreifer über unseren MCP-Server und Neos eindrang, 25 November 2026; Mittwald incident post, 7 November 2026; Neos security advisory GHSA-7wrr-qcrp-4hhf, 13 November 2026. Card rendered by OrcaRouter.' The OrcaRouter logo is composited in the bottom-right corner.

Phase two: the second breach came through the CMS

Mittwald had restored access on 7 November. By 9 November the attacker was back, and the second phase did not touch MCP at all. Disposable accounts, compromised customer-centre hosting accounts, and unpatched WordPress plugins — including the Hotel Booking flaw CVE-2023-5991 and the Avada theme flaw CVE-2022-1386 — were used as a relay. On one customer server the attacker logged in with passwords for eight hosting accounts, planted cronjob webshells, failed to break out of the account isolation, and then succeeded in jumping into a second account once.

Then, at 01:28 on 12 November, Mittwald detected a compromise of its own website. The flaw was in Neos, the CMS behind mittwald.de, by way of the Flow framework underneath it. Flow accepted file uploads for the Neos backend and processed them before checking whether the caller was authenticated, so a single unauthenticated request could place a file in a public directory; the list of blocked extensions had gaps that let .phar through, and Mittwald's hosting environment executed PHP in that directory, which turned an upload flaw into a webshell. Through it the attacker read the site configuration and database, including Neos backend password hashes, overwrote one backend password, created two administrator accounts, opened an outbound tunnel and scanned the neighbouring network without result. The site's content was not altered. Mittwald reported the flaw to the Neos project at 02:33, restricted SSH at 02:51 and disabled mStudio and customer-centre login at 04:10.

This part of the record has the corroboration the MCP part lacks, and it is worth naming precisely because it is the only document in the set that Mittwald did not write. The Neos project published a security advisory on 13 November 2026 under GHSA-7wrr-qcrp-4hhf, rated CVSS 9.8 critical, describing an unauthenticated arbitrary file upload in which "the upload is processed before the security policy of the called action is enforced" and "the list of forbidden file extensions had gaps". It lists Flow up to and including 8.3.21, 8.4.0 to 8.4.6, 9.0.0 to 9.0.9, 9.1.0 to 9.1.4 and 9.2.0 to 9.2.2 as affected, and 8.3.22, 8.4.7, 9.0.10, 9.1.5 and 9.2.3 as fixed — and it credits the finder as mittwald. The advisory does not say the flaw was exploited in the wild, and it carries no CVE identifier. Its dates match Mittwald's account to the day, which is the closest thing to independent verification anywhere in this record.

What is established, what Mittwald infers, and what nobody has shown

The archive grades this record confidence A and does not flag it as disputed, and that is defensible: no party contests that the breach happened, that the entry point was the MCP server, or that 56 projects were compromised. But confidence in the event is not the same as confidence in every sentence attached to it, and the difference is where a reader needs help. Mittwald's own documents are careful about this; the coverage was less so.

HTML card titled 'What the logs prove, and what they only suggest', kicked 'Record 2026-11-07-mittwald-mcp-server-breach · evidence tiers' and subtitled 'Separated by what each claim rests on, not by how plausible it sounds.' Three stacked panels. The first, headed 'Established' in green and subheaded 'Stated by Mittwald with specifics, or confirmed by a third party', lists five items: the entry point was a shell injection in the MCP server's SSH-key tool, where caller-supplied comment and passphrase values were interpolated into a command string run through execSync; the server held a valid access and refresh token for every active user, so one container shell meant every account; 56 customer projects were classified as compromised after forensic examination, and 161 orphaned keypairs were found with 3 containing attacker traces; every MCP user was affected plus the projects their accounts could reach, including projects whose owners never used MCP; and the phase-two Neos flaw is confirmed by the Neos project's own advisory GHSA-7wrr-qcrp-4hhf of 13 November 2026, CVSS 9.8, which credits mittwald. The second panel, headed 'Mittwald's inference' in amber and subheaded 'Stated as a reading of the logs, not as a finding', lists three items: that the attacker used AI tools, inferred from steps seconds apart and heavily parallel activity, with no other evidence offered; that the attacker tried to pass as an authorised penetration-test provider, inferred from maintenance-style SSH account names and rotating proxies; and that the attacker did not reach internal systems, an absence of evidence from Mittwald's own investigation rather than a demonstrated negative. The third panel, headed 'Not established' in red and subheaded 'Absent from every source reviewed', lists four items: no attacker identity and no group attribution; no statement of which data categories left which of the 56 projects, only that all data from 27 October is treated as compromised; no confirmation that customer data was published, since the checks found none; and no regulator statement, with no BSI or data-protection authority notice appearing in the coverage reviewed. A footer reads 'Sources: Mittwald incident post, 7 November 2026; Mittwald post-mortem, 25 November 2026; The Record, 9 November 2026; webhosting.today, 9 November 2026; Neos advisory GHSA-7wrr-qcrp-4hhf, 13 November 2026. Card rendered by OrcaRouter.' The OrcaRouter logo is composited in the bottom-right corner.

The AI attribution deserves its own paragraph, because it travelled further than its evidence. Robert Meyer, Mittwald's managing director, said the attacker appeared to have used AI tools, citing logs in which steps that "would take significantly longer for a human attacker" were seconds apart. The Record, which reported the disclosure on 9 November under the headline "Alleged AI-aided cyberattack", noted that Mittwald provided no other evidence and did not immediately answer how it distinguished AI tools from conventional scripts, which can also move faster than a person clicking. The 25 November post-mortem repeats the inference and adds detail — heavy parallelism, rotating proxies, maintenance-style account names — without adding a method. Nothing Mittwald has published identifies a tool, a model or a technique that would separate AI-assisted operation from well-automated operation.

One question that the first week's coverage opened has since been closed, and it is worth noting because it shows the post-mortem doing real work. On 9 November, The Record reported that it was unclear whether the defect sat in Mittwald's own code or in an open-source MCP library. The 25 November document answers it: the tool was Mittwald's, the string was Mittwald's, and the only third-party component involved was Node's standard library. Clear Function, a software consultancy that reconstructed the incident, frames the broader lesson the same way its own sources do — that the emerging MCP specification already forbids a server from passing through the token it received from the client, and that Mittwald's server was doing something close to the opposite by holding every user's token at once. That is a design observation about a draft standard, not an additional finding about this breach.

What Mittwald changed

The remediation list in the post-mortem is long and mostly architectural, which is the right shape for this failure. The MCP server remains offline with no return date. A future version is specified to run on a read-only filesystem with no outbound network access except to Mittwald's own API, to separate tools from sessions, to issue narrower and shorter-lived tokens, and to log centrally into a SIEM.

Around the code, Mittwald has added mandatory review rules for agent-generated code, expanded CI checks and AI-assisted vulnerability scanning — the direct answer to the execSync that no static analysis saw. Around the accounts, mStudio now offers passkeys, staff MFA rules are stricter, and login requires a captcha plus email confirmation. Extension webhook URLs are validated before use, which closes the SSRF path, and Neos upload directories no longer execute scripts, which closes the webshell path. Mittwald also built a second SIEM with more log sources including customer-centre hosting, put a 24/7 shift team on its alerts from 14 November, began preserving incident-relevant logs separately, and added the ability to disable a single project or function instead of a whole platform — a direct lesson from having had to suspend mStudio and SSH for everyone.

Customers were told to change their mStudio password, enable MFA or passkeys, audit API keys, project tokens, SSH users and SSH keys, rotate third-party credentials, and tell everyone else with access to their projects. For restorations from backup, Mittwald said it would discuss case by case which changes since 27 October to keep. A detail worth flagging for anyone assessing the response: the attacker's tampering included creating SSH users in about ten projects and inviting an account as co-owner in at least one, so an audit that only checks passwords would miss what was actually done.

AI on both sides, and only one account of it is documented

The most striking thing in the post-mortem is not the attacker's tooling. It is the defenders'. Mittwald says a self-hosted D​eepSeek model — the post-mortem does not name the version — identified the decisive request in the access logs and the corresponding location in the source code within ten minutes. AI agents now pre-sort SIEM alerts and take bounded first actions, with humans retaining the final decision. That is a documented, dated, specific use of a model in incident response, described by the organisation that ran it.

Set it against the other side of the same document. The attacker's AI use is inferred from pace. The defenders' AI use is described with a model, a task and a time-to-result. Both claims come from the same authors, in the same post, and they do not carry the same weight — and the one that travelled into headlines was the weaker of the two. For anyone building the case that AI is changing incident response, the ten-minute log triage is the evidence. For anyone building the case that AI is changing attack, this incident is a plausible data point with an unstated method, and the archive is right to record the breach as established while leaving the attribution where Mittwald left it.

Abstract technical illustration on a dark navy field with a faint slate grid: a wide horizontal band of very fine, evenly spaced horizontal lines runs across the middle of the frame, uniformly grey, like rows of machine logs seen from a distance. From the upper left, a narrow cone of cool white light falls on a single short segment of that band and isolates it; the lit segment is joined by a thin vertical thread to a small open square outline above it, and from that square a second thread runs right to a compact cluster of three small solid rectangles. In the lower right corner, a separate dim amber dot emits a few short tapered streaks toward the band, none of which land on the lit segment. No text, no people, no organisation logos appear. The OrcaRouter logo is composited in the bottom-right corner.

What the record will be used for is probably not the shell injection. MCP servers holding upstream credentials for every connected user is a pattern, not a one-off, and the archive's neighbouring entries on command injection in MCP tooling and on token theft from AI coding tools describe the same exposure arriving by different routes. Clear Function's reconstruction makes the point in standards terms: revocation is damage control, because revoking a token does not un-read it. Mittwald's own incident shows what that costs when the token belongs to an employee who can reach production projects — in this case, 56 of them.