Dangerous "Theia IDE Docker" browser application. #16880
Replies: 4 comments
|
Hi @JacekHoleczek, thanks for starting this discussion! 👋 The Theia community will take a look soon. In the meantime, you might find helpful information in: 💙 Eclipse Theia is built and maintained by a community of contributors and sponsors. If Theia is valuable to your work, consider sponsoring the project. For professional support, training, or consulting services, learn more about available options. |
|
Hey @JacekHoleczek, thanks for raising this discussion :)
Well, that's a relative term. In the end, the Theia IDE is a fully fledged code editor, with access to system resources (terminals, etc.) that "normal" web apps do not have. Anyone who runs the editor should be aware that anyone who can access the UI is able to essentially take over the whole underlying machine/container.
That's a good point. AFAIK there is no open issue for this currently, so please go ahead and file a feature request for this. There has been little need in the past for this, see below.
Yes, this is intentional. Theia is a single-tenant application, meaning that one server instance is for one user exclusively; This is entirely by design. You will find some discussions in GitHub, or I can just leave this here. VS Code and forks (Coder for example) follow the same design. Historically, the Theia browser version has been used by companies that run Theia servers on Kubernetes (or similar orchestrator software) clusters, where they can easily spin up/down a new pod for a user on demand. The team has been working on theia cloud which does this as well. Usually, you would also put another layer of authentication on top of that to ensure that only the "correct" user has access to their workspace/server instance. This has historically alleviated the need for token based authentication within Theia. |
|
I now understand that the "Theia IDE Docker" It seems there exist (at least) two " |
|
I can't see the problem here. A docker container is at first an isolated application environment. It is not dangerous. The argument about the authentication is not a problem of theia. If you run for example an apache web server you could argue the same way. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Discussion
I am using a (multiuser) Ubuntu 22.04 / x86_64 machine.
While playing with the official "Theia IDE Docker"
browserapplication, I noticed that it is very dangerous.I pulled the newest (as of 2026.01.24) official image using:
[...]$ apptainer pull ghcr.io/eclipse-theia/theia-ide/theia-ide:1.67.100Then I can run it using:
[...]$ apptainer run /.../theia-ide_1.67.100.sifor by simply executing:
[...]$ /.../theia-ide_1.67.100.sifI noticed the following problems.
Maybe you could add some reasonable authentication mechanism (effective by default at application startup)?
browserapplication starts as:2026-01-24T...Z root INFO Theia app listening on http://0.0.0.0:3000.It means it is open to the whole world (now see point 1. above again).
That is extremely dangerous, especially if I were using Docker. See the "My code-server got hacked; I have no idea how" discussion for the "code-server".
I noticed that it is sufficient to add the "
--port" option when starting the container, and then it automatically switches to "localhost", e.g., when using:[...]$ /.../theia-ide_1.67.100.sif -pI get:
2026-01-24T...Z root INFO Theia app listening on http://127.0.0.1:3000.Of course, the same happens when I explicitly use the "
--hostname" option, too.Maybe you could make the "
localhost" the default setting?/tmp" (owned by "me"):drwxr-xr-x me:me ... /tmp/theia_uploaddrwxr-xr-x me:me ... /tmp/github-remotedrwxr-xr-x me:me ... /tmp/http-remoteIt means that other users will not be able to run their own
browserapplications (on the same machine).Maybe you could create all subdirectories with the "
$(id --user)" appended to their names?For example, I noticed that, when I connect to the
browserapplication using Firefox, and then quit Firefox, it creates a "user-specific" subdirectory:drwxr-xr-x me:me ... /tmp/vscode-typescript$(id --user)All reactions