Live data from Hacker News

Unauthenticated remote code execution in OpenCode

cy.md

31–40 of 155 posts

Re: Unauthenticated remote code execution in OpenCode

#31

WTF, they not just made unauthenticated RCE http endpoint, they also helpfully added CORS bypass for it... all in CLI tool? That silently starts http server??

I'm slightly surprised that the CORS policy wasn't just "*" considering how wide open the server itself was.

Re: Unauthenticated remote code execution in OpenCode

#33
post #18

Huh, I thought opencode was a volunteer project but it looks like it's a business with major backing from major players. Was opencode always set up like this? I could have sworn there was some project with a better governance model, guess not.

You are either thinking of crush, roocode or kilo, they all started around the same time and dont have backing from major players yet.

Re: Unauthenticated remote code execution in OpenCode

#34
post #31

WTF, they not just made unauthenticated RCE http endpoint, they also helpfully added CORS bypass for it... all in CLI tool? That silently starts http server??

I'm slightly surprised that the CORS policy wasn't just "*" considering how wide open the server itself was.

It seems like it was prior to 1.0.216?

Re: Unauthenticated remote code execution in OpenCode

#35
post #31

WTF, they not just made unauthenticated RCE http endpoint, they also helpfully added CORS bypass for it... all in CLI tool? That silently starts http server??

I'm slightly surprised that the CORS policy wasn't just "*" considering how wide open the server itself was.

That's the point, it was!

https://github.com/anomalyco/opencode/commit/7d2d87fa2c44e32...

Re: Unauthenticated remote code execution in OpenCode

#36
post #20

Earlier quoted context omitted.

Congrats on owning this, good job, respect

It's hard to not own it when it's publicly disclosed. Maybe save the accolades for when they actually do something and not just say something.

[flagged]

Re: Unauthenticated remote code execution in OpenCode

#37
This is pretty egregious. And outside the fact the server is now disabled by default, once it's running it is still egregious:

> When server is enabled, any web page served from localhost/127.0.0.1 can execute code

> When server is enabled, any local process can execute code without authentication

> No indication when server is running (users may be unaware of exposure)

I'm sorry this is horrible. I really want there to be a good actual open cross-provider agentic coding tool, but this seems to me to be abusive of people's trust of TUI apps - part of the reason we trust them is they typically DON'T do stuff like this.

Re: Unauthenticated remote code execution in OpenCode

#38
On the one hand, with 1800 open issues and 800 open PRs (most of it probably AI generated slop) makes it a bit understandable for the maintainers to be slow to reply. On the other hand, the vulnerability is so baffling that I'll make sure to stay as far away as possible from this project.

Re: Unauthenticated remote code execution in OpenCode

#40
post #4

hey maintainer here we've done a poor job handling these security reports, usage has grown rapidly and we're overwhelmed with issues we're meeting with some people this week to advise us on how to handle this better, get a bug bounty program funded and have some audits done

Why not just ask Claude to fix the security issues and make sure they don't happen again?

Who knows what created the issues in the first place place
Post reply on HN