OpenCode Hacked: User credentials leaked
twitter.com
twitter.com
The leak was for something called 'OpenCode Console', which is distinct and separate from the OpenCode coding agent. If you're just using the coding agent, you're not affected. 'OpenCode Console' is a service that is similar to OpenRouter, but is much less widely used.
The name 'OpenCode Console' is super confusing, because one might think it means the CLI coding agent. It does not. 'OpenCode Console' has nothing to do with the CLI/TUI coding agent, nor the desktop app version.
The situation is made worse by the fact that 'OpenCode Console' barely has any documentation online, and the official leak announcement does not make the distinction clear at all. The OpenCode team did a terrible job of communicating this, and that's on them.
Today is a bad day for people using 'OpenCode Console'. But most people, probably the vast majority of OpenCode users who are reading this, are not using 'OpenCode Console'.
Or Open Code Rust?
So far, "OpenCode" has gone through several possible definitions:
- OpenCode Terminal / CLI - This is what you get normally. Runs a service in the background and the CLI is your interface.
- OpenCode Desktop - Instead of a CLI, you get a desktop interface.
Most users usually stop here. You just install the app and you connect wherever.
So there's the services where they both make money and make things easier for users:
- OpenCode Console - Basically the serving platform for both Zen and Go, and has expanded to a hosted inference gateway and somewhat similar to OpenRouter or a managed LiteLLM. Has the option to BYOK if you have existing AI platform accounts so it charges those instead of Zen, and that's what got compromised.
- OpenCode Zen - the API service they host if you want to get access to providers but don't want to pay individually per API platform. Similar to OpenRouter. I noticed they're kinda slowly dropping the Zen moniker.
- OpenCode Go - the subscription service that they host that features open weight models and select low-cost models from frontier labs. Has different policies when it comes to privacy and retention compared to Zen.
- OpenCode Black - a limited-time, limited access subscription service that grants access to frontier models. Not sure if this is still alive or not.
If they took payment, they are liable and they must have the ability to refund.
https://docs.github.com/en/code-security/reference/secret-se... has a table with the active partners
If they are acting maliciously, they will take the choice that most hurts you and/or benefits them.
If the key is useless to them and revoking it hurts you, then they would do that.
If the key wasn’t useless to them, then… they would just use it and not revoke it?
Unilaterally decide they should be revoked, without contacting the owner?
And that’s not malicious?
> I think every API key system should have endpoint "invalidate_api_key"
Not this.
What is your alternative idea?
No idea why you’re being so hostile here.
The status quo is clearly the local minima, given the myriad of trade offs and different parties involved.
Be serious.
For example AWS applies a “quarantine” policy that prevents some specific actions[1].
Allowing anyone to report a potentially compromised key is one thing, but allowing anyone to unilaterally revoke a token is another.
1. https://docs.aws.amazon.com/aws-managed-policy/latest/refere...
If it’s that sensitive and there’s access keys accessible to anyone, it could end up much worse. Nobody said it was without inconvenience.
Non-malicious actors using it to bring down a system via revocation are therefore indistinguishable from malicious actors. It’s by definition a malicious act.
That’s why it’s a stupid idea. Non-malicious actors should just contact the company and let them take action. It’s not for an outsider to decide the impact of a leak.
Also GitHub doesn’t revoke the keys. The providers of the key take provider-specific actions, which may or may not be revocation.
So… yeah.
It's in their announcement; it's just not written in a way that people immediately understand.
Run a gateway like GoModel instead of uploading your keys to a vendor to prevent this class of attack in the future.
https://gomodel.enterpilot.io/ (my preferred gateway)
In essence they used OpenCode Zen similar to OpenRouter, where you can BYOK or use theirs and be charged token rates.
https://dev.opencode.ai/console/
It's actually kinda hard to figure out what it is. But it does appear to be different that the CLI
From https://opencode.ai/v2/docs#connect :
> If you’d like easy access to all the best coding models you can try out OpenCode Console.
1. Last Friday I noticed that one of my OPENAI keys had used up my spending limit in the OpenAI Console.
2. Today I got the e-mail from OpenAI quoted below.
3. I haven't got any e-mail from OpenCode about it.
I can’t remember using this OpenCode Console. Can anyone explain to me what happened?Mail from OpenAI:
Subject: OpenCode incident: update on your API keys and reimbursement
Body:
Hello,
We're writing about a security incident reported by OpenCode, a third-party AI coding tool. OpenCode reported unauthorized access to a system that stored customer API keys.
An OpenAI API key associated with your organization, [masked], was identified as affected. The affected OpenAI API keys are no longer active and cannot be used to make new API requests.
API usage is billed to the organization associated with the key, including when an exposed key is used without authorization. As part of our review, we have applied a one-time courtesy adjustment to address the charges associated with the unauthorized usage we identified. (...)
The opencode CLI has no impact.
Headlines are designed to capture attention and readers, how much detail does it need to go into? It's not dishonest or misleading but yes it's attention grabbing.
OpenCode, and the lot, will need to release an open, public, dataset containing the original queries (and other relevant details) that the hacked keys were used for. I'm unwilling to trust those industry players at their word. We need to do our own community analyses.
The way some of this place's employees post and act online, can't say I feel all that bad.
that's why virustotal was flagging it then
run a gateway like LiteLLM or GoModel, don't upload keys to a vendor
- https://gomodel.enterpilot.io/ (my preference)
Hackers breached an Open Code legacy system containing customer keys for openai etc, and ran up large bills against the customer's openai accounts . The tokens were used to train the hacker's ai models (the distillation).
My guess is a more primitive arbitrage / resale attack . Like reselling EBT cards or "free" vpn traffic.
you login to their website, and you are presented with a list of providers where you can click and add your provider api key.
how the key is stored on the backend isn't clear, but it is akin to handing your password or if you know crypto, your private key, to someone and letting them store it for you.
from what i can tell, there are no links within the console to a ToS, Privacy policy or anything else. there are no warnings or documentation about how they store your keys.
someone else in this thread linked to this issue, but this comment is especially insane given that i can't find any privacy policy or tos for the console.
https://github.com/anomalyco/opencode/issues/10416#issuecomm...
I've heard Dax has a number of "social media stunt" kinds of posts and others showing them being rather unprofessional (eg. something that appears to be excessive drinking at a company event)
I would like to see the companies release an open dataset of the attackers queries, such that we can do our own analyses as a community. Public trust is in the xitter with these folks.
https://news.ycombinator.com/item?id=50075319
https://news.ycombinator.com/item?id=50060694
what’s interesting is that all those efforts that go into sandboxing through virtualization wouldn’t have helped here. But the solutions that proxy the api keys and hide them from agents might have worked as a defense in depth.
of course any sensible engineer that uninstalled this 6 months ago and used codex and claude code directly also avoided this, gg
Exterior-compliance proxies, yes, are a good thing; but are also completely unrelated to the fact that OpenCode's hosted solution, that requires having credentials in some fashion, was popped.
Shitting on anyone who uses OpenCode (rather than your preferred vendor-specific product) as not being "sensible" is also completely out of hand and unnecessary.
Our read on the situation is too much eyes and brain free coding, that they assumed the ai redesign of the configuration system was sound. It took a couple of PRs and explanations for them to bring the system to a better place, such that MDM config was respected at the highest priority.
I do give the OpenCode team a lot of credit, at least Aiden, for the handling of this case.
https://github.com/anomalyco/opencode/pull/51337#issuecommen...
I'm now trying to get the Pi harness to support MDM, but it is not going well... see this and please consider sharing your perspectives or support there
> related to a large scale distillation attack
I'm not sure how this adds up. I could understand if this impacted their uptime, but not security.
Are they actually saying a bunch of credentials were stolen and are being used for distillation?
you can learn more from here, they did handle that one much better, all-in-all
I would recommend running your own gateway instead of uploading keys to a vendor. My gateway of choice is GoModel
Account farming is one thing, and nobody apart from who's being distilled cares about that, but draining wallets of other people is a whole other thing.
Use a gateway like LiteLLM or GoModel, don't upload keys to a vendor, they are doing too much eyes and brain free coding this year
- https://gomodel.enterpilot.io/ (my preference)
We do not know if that is what the hacked API keys were used for. Could be distillation, could be API reselling. We will need more transparency into the nature of the requests made by the attacker. I would like to see an open dataset of the queries made with the compromised keys. All of them as originally made, not aggregate stats or another METR report.
The keys could have also been used to resell API access on the black market, again, we need good transparency to know. Considering the upstream parties involved, getting the distillation narrative out there early, without evidence, does fit a larger pattern we have seen from them this year.
They're skipping past the fact thay keys were even accessible by an intruder... Like huh?? They say its only third party keys, but all my opencode keys were deactivated in tbe process... Why is that, were they storing keys in virtually plain text...
Opencode CEO, Dax, brags all day on twitter (in the most narcissistic fashion) about how much they vibecode and how fast they move. Well, it really shows.
Not to mention, Ive tried to cancel my subscriptions and was double charged, they reverted one of them, then I cancelled again and was charged again....
Similarly woke up this morning to find my OpenCode Go API key had been revoked (remaining monthly usage allowance fortunately not touched).
Whether that was precautionary or is evidence of wider data leak, who knows?
Concur that OC's X messaging is mostly 'Marketing by Sounding off like a Dick' and they're certainly not known for having the best documentation either.
It's not like there wouldn't be any other harnesses either. Just switch to literally anything else please.
The other issue: https://news.ycombinator.com/item?id=49655991
I looked at the linked comments, and they seem valid. I mean I dont want to go full tinfoil hat here, but what's the deal? Some people just really like opencode or something?
My read is too much vibemaxxing, not enough critical analyses of the Ai output and (re)designs of various systems in their code base.
Breaking Rule #2 - never blindly trust the output from Ai
---
Hi, We identified unauthorized access to a legacy system that we were in the process of decommissioning. Third party provider keys (eg OpenAI, Anthropic) saved in your workspace may have been exposed. Please revoke and replace those keys through the relevant provider’s dashboard, update any applications using them, and review recent usage for unexpected activity.
We’re sorry this happened and will follow up with any updates.
This was a leak of keys added in a web UI
Me, 68 days ago:
> Beware of the author of tweet, who happens to be author of OpenCode - OpenCode will leak all your data to themselves and to shady 3rd parties. Author feigned ignorance and never fixed the issue. OpenCode among other harnesses is the shadiest of all.
I did have an account but moved off for security reasons.
That is it. It is still private by default
All it "ever did" was send your entire prompt/context to a "free" model for harvesting. The astroturfing in this thread is absurd.
Maybe try a sensible approach first, cause so far this is assumed, for no reason, to be done maliciously. "to steal data" and the like.
Opencode's source code is public, so you can verify any claim against it directly.
During this short period - yes. Unless it finds a valid small model, or you set one yourself - it would use the one provided by zen. or you could disable it with an invalid model altogether. Good gesture for most users and something else to others.
It's *could by the way, as this was only a short window when this was a thing. It went back to not having this fallback pretty fast, i don't think it even lasted a month.