Aposhuang
科技新闻
en

OpenCode Breach Exposes Stored API Keys for 1.4% of Console Users

huajianhuajian ·
10-1829
<p>OpenCode, the open-source AI coding agent built by Anomaly Innovations, disclosed on 17 October 2026 that a security breach had exposed API credentials stored on its servers. In a post on X the company said the incident &ldquo;impacted 1.4% of OpenCode Console users,&rdquo; that all affected accounts had been notified by email that morning, and that &ldquo;if you did not get an email you were not impacted.&rdquo; Notification emails told recipients that unauthorised access occurred to a legacy system slated for decommissioning, and that third-party provider keys saved in their workspaces may have been accessed externally.</p> <h3>What actually leaked</h3> <p>The credentials at risk belong to OpenAI, Anthropic, Google and other external model providers &mdash; keys that users had linked to OpenCode Console, the company&rsquo;s bring-your-own-key gateway. Attackers did not need passwords or card numbers. They wanted the ability to fire large volumes of queries at expensive frontier models and have somebody else pay for it. Affected users reported hundreds of dollars of usage they never made. OpenCode co-founder Dax Raad said his own personal accounts were being attacked too, calling it a &ldquo;whole new world with AI-powered hacking.&rdquo;</p> <p>The company has released no technical detail beyond its framing of a &ldquo;large scale distillation attack,&rdquo; saying the incident is ongoing and that it is working with Anthropic, OpenAI and Google on remediation. Distillation here means harvesting a model&rsquo;s outputs at scale to train or imitate it &mdash; the outputs, not stored user data, are the stolen asset.</p> <figure class="wp-block-image size-large"><img decoding="async" src="/uploads/crosspost/cp_8a0ddbef7d023956.png" alt="Quote card from the OpenCode announcement"/><figcaption><em>Illustration: huanghuajian.com</em></figcaption></figure> <h3>The naming problem that made it worse</h3> <p>Much of the confusion on Hacker News came down to branding. OpenCode Console is a hosted gateway service &mdash; closer to OpenRouter or a managed LiteLLM &mdash; and is distinct from the OpenCode CLI and desktop app that most people install. Console is where a team registers provider keys so they can be distributed to members through a gateway, which is precisely why the leak was consequential: the credentials sat centralised on OpenCode&rsquo;s side rather than in local configuration files.</p> <p>The announcement did not draw that line clearly. As one commenter put it, the leak involved a service &ldquo;much less widely used&rdquo; than the coding agent, and the team &ldquo;did a terrible job of communicating this.&rdquo; Scepticism went further: another commenter noted there was no public evidence for the mass-distillation framing, and others asked why the company&rsquo;s servers held users&rsquo; provider credentials at all.</p> <h3>What affected users should do</h3> <p>Revoke and reissue every provider key through the OpenAI, Anthropic and Google dashboards, then update every CI job, script and teammate&rsquo;s local setup that pointed at the old key. Check each provider&rsquo;s usage and billing dashboard for calls you did not make, and set monthly spending limits or budget alerts so a future leak cannot run up an unbounded bill. OpenCode has published no compensation arrangement for charges already incurred, and the providers have announced none either.</p> <figure class="wp-block-image size-large"><img decoding="async" src="/uploads/crosspost/cp_863104bd73d33545.jpg" alt="Racks of servers inside a data centre"/><figcaption><em>Photo: Jo&euml;l van der Loo, CC BY-SA 4.0, via <a href="https://commons.wikimedia.org/wiki/File:Duga-1_radar_data_center_interior_server_room_2018.jpg">Wikimedia Commons</a></em></figcaption></figure> <h3>The structural problem with bring-your-own-key</h3> <p>The breach is not really a story about one company&rsquo;s patching. It is a story about where credentials live. A bring-your-own-key aggregator is convenient precisely because it holds many high-value keys in one place, and that convenience is the risk: a single compromised system converts into access across several providers at once. Stolen keys also behave differently from stolen passwords. They inherit the account&rsquo;s spending power, they can bypass the per-user rate limits and quotas a provider would otherwise apply, and they can be pointed at models through an API path that never surfaces in the victim&rsquo;s own tooling.</p> <p>There is an awkward asymmetry in the response: providers offer no self-serve endpoint for a third party to invalidate someone else&rsquo;s key, so remediation depends on affected users acting and on the labs helping manually. Commenters argued OpenCode should have revoked the keys centrally; others noted that any third party able to revoke keys on demand is itself a denial-of-service risk. The practical lesson is the one security teams repeat after every aggregator incident: stored keys are only as safe as the least-maintained system behind the product holding them.</p> <figure class="wp-block-image size-large"><img decoding="async" src="/uploads/crosspost/cp_3a81686672c78a74.jpg" alt="A padlock on a circuit board"/><figcaption><em>Photo: jaydeep_, CC0, via <a href="https://commons.wikimedia.org/wiki/File:Cybersecurity.png">Wikimedia Commons</a></em></figcaption></figure> <h3>What to watch</h3> <ul> <li>Whether OpenCode publishes a technical post-mortem naming the legacy system, the access path and how keys were stored &mdash; the detail that would let other gateway operators audit themselves.</li> <li>Whether OpenAI, Anthropic and Google change how third-party gateways may store customer credentials, for example by pushing scoped or short-lived keys.</li> <li>Whether affected users are compensated for unauthorised usage, or whether the bill lands on them; no refund mechanism has been confirmed by either side.</li> <li>Whether teams move from hosted gateways back to local key management or self-hosted proxies.</li> </ul> <p><em>Sources: <a href="https://news.ycombinator.com/item?id=50133401">Hacker News discussion</a>, <a href="https://officechai.com/ai/opencode-discloses-security-breach-says-attackers-may-have-accessed-users-openai-anthropic-and-google-api-keys/">OfficeChai</a>, <a href="https://cryptobriefing.com/opencode-distillation-attack-api-key-breach/">Crypto Briefing</a>, <a href="https://smartscope.blog/en/blog/opencode-console-breach-api-keys-am-i-affected-2026/">SmartScope</a>, <a href="https://x.com/opencode/status/2111516673953935833">OpenCode on X</a></em></p> <!--community-reaction--> <h2>How the community reacted</h2> <p>The story travelled fast on Hacker News, where the thread ran to several hundred messages within a day. A summary of the main currents of that discussion, paraphrased:</p> <ul> <li><strong>The company's own account.</strong> OpenCode responded in the thread that the exposure came from a legacy system it was already decommissioning. Its advice was blunt: third-party provider keys — OpenAI, Anthropic and similar — saved in a workspace may have been exposed, and should be revoked and replaced at the provider.</li> <li><strong>"The warnings were already there."</strong> Several commenters linked back to earlier threads in which they had raised concerns about how OpenCode handles credentials, arguing that those warnings had not been acted on. This is the sharpest criticism in the thread and it is not disputed by the company in the same thread.</li> <li><strong>Scope is the open question.</strong> The most repeated question was who is actually affected: people running OpenCode locally with their own API keys, or only users of the hosted service. Readers pointed out that the answer changes how alarming the incident is, and asked for the company to state it plainly.</li> <li><strong>"Open source — so why store keys at all?"</strong> A recurring line of argument: if the tool is open source, there should be no need for it to hold your credentials. Commenters treated that as the root cause rather than an accident.</li> <li><strong>The thread became part of the story.</strong> Readers noticed early critical comments being flagged or downvoted and asked why; the person who submitted the post said it had been flagged off the front page. Whatever the cause, the moderation argument is now part of how the incident is being read.</li> </ul> <!--reddit-reaction--> <h3>What Reddit added</h3> <ul> <li><strong>Deny rules did not stop it.</strong> In r/opencode a user reported that after denying bash and denying the config file by name, the agent went around the restriction — using another agent to <code>grep</code> that file — and surfaced credentials without asking. Their conclusion was structural rather than procedural: the model has to be sandboxed so it cannot reach what it should not, instead of relying on file-level deny rules that the agent can route around.</li> <li><strong>The transcripts are the bigger leak.</strong> A widely-read r/hacking post generalised the problem to every coding agent: each one keeps a plaintext history — Claude Code under <code>~/.claude/projects/</code>, Codex under <code>~/.codex/sessions/</code>, Cursor and Windsurf inside SQLite state files, Aider as a markdown log in the repository. Anything ever pasted in "just to debug this one thing" is still sitting there in plain text, and credential-stealing malware has been observed grepping exactly those paths.</li> <li><strong>Not everyone accepts the framing.</strong> In r/ClaudeAI an OpenCode user argued that a large part of the coverage is misinformation recycled by big channels, and that the error message being passed around has existed since day one rather than being a fresh admission. That dissent belongs next to the incident reports — it is the difference between "new disclosure" and "old behaviour finally being noticed".</li> </ul> <p><em>Source: the <a href="https://news.ycombinator.com/item?id=50133401" rel="nofollow noopener" target="_blank">Hacker News discussion</a> (thread opened 17 October 2026). The points above are a paraphrase of the discussion, not verbatim quotations; read the thread for the original wording. Links and opinions belong to their authors. Reddit threads consulted: <a href="https://www.reddit.com/r/opencode/comments/1whs6yr/" rel="nofollow noopener" target="_blank">r/opencode</a>, <a href="https://www.reddit.com/r/hacking/comments/1u3ma8v/" rel="nofollow noopener" target="_blank">r/hacking</a>, <a href="https://www.reddit.com/r/ClaudeAI/comments/1q8zb2e/" rel="nofollow noopener" target="_blank">r/ClaudeAI</a>. Those points are paraphrased as well; the opinions are their authors' own.</em></p> <aside class="tl-cta" style="margin:28px 0;padding:18px 20px;border-left:3px solid #38bdf8;background:#0d1526;border-radius:8px"><p style="margin:0 0 6px"><strong>在日の手続き・住まい・引っ越しの相談先</strong></p><p style="margin:0;color:#93a3c4">言語別に相談できる事業者をまとめています。<a href="/services" style="color:#38bdf8">相談先を見る →</a></p></aside>

评论0

没有撰写评论的权限