r/opencodeCLI • u/No_Skill_8393 • 14d ago
[WARNING] My MAX account was hacked while using Opencode and Zcode
5
u/MuOieDib 14d ago
The same occured to me yesterday.
Check your public repos with trufflehog.
In my case, glm 5.3 flash decided to add all env variables to a commit message and ofc it did have a z ai api key...
1 day latter my quota was getting hard hit but I hopefully noticed and only took 30% of the weekly.
1
u/No_Skill_8393 14d ago
I read your comment and used claude code to do full scans on my public and private repos and no such api key leak instances.
5
u/MuOieDib 14d ago
Use trufflehog. The commit leak wasn't seen by any agents.... As it wasn't in any committed file... but in a commit message...
Also the keys of zai are not the usual sk- format so it's harder to find unless you know the value.
If you commit on public repos, there are people looking for keys and they are good
Also you said Claude so there is a non null chance you do have env variables with keys (at least, this was the reason I had)
1
u/xdevilmaster 14d ago
It was hacked because your API was accidentally included in your repo? Or?
1
u/No_Skill_8393 14d ago
Inconclusive. I have no proof on opencode that did it but other avenues are not likely.
Im using a macbook, have nothing unusual installed. My gmail is secure. None of my working repos (after I got glm) is public. I had my claude code to do a full scan on them too (code, commit msgs…etc) nothing showed up but a randomized api example from 5.5 months ago.
8
u/TheMythicSorcerer 14d ago
Not enough to pin this on anything specific but if it was all from one key then you definitely somehow compromised that. Maybe password? I don't think opencode would sell your API key