Vulnerability disclosure: JupyterHub's proxied code-server sessions have no authentication and can be taken over #173

Closed
opened 2022-08-04 17:53:54 +00:00 by a · 0 comments
Owner

This security vulnerability has been fixed. It is unknown if it was exploited in the past.

In exohub, you can easily start a code-server session proxied by jupyter-server-proxy, which starts code-server on a random port and redirects you to the proxied code-server session. Since code-server has no GET authentication support, we disabled authentication for code-server entirely when we set it up about 10 months ago (really bad idea, I know).

Attackers can scan our open ports and find the code-server's port and access the code-server without any authentication 😱.

I totally forgot about this bad decision for a few months, and then recently when I was investigating JupyterHub's security after #172, I rediscovered the bug and quickly fixed it by enabling authentication for code-server. Now when you try to access the code-server, code-server will generate a random password in ~/.config/code-server/config.yaml, and it'll tell you instructions to find the password in the file and type it in.

Since code-server was rarely used anyways, I think it's very unlikely that this vulnerability was exploited in the past. An attacker also would not be able to find or change the victim's password and gain further access to their account.

**This security vulnerability has been fixed. It is unknown if it was exploited in the past.** In exohub, you can easily start a code-server session proxied by [jupyter-server-proxy](https://github.com/jupyterhub/jupyter-server-proxy), which starts code-server on a random port and redirects you to the proxied code-server session. Since [code-server has no GET authentication support](https://github.com/coder/code-server/pull/2428), we disabled authentication for code-server entirely when we set it up about 10 months ago (really bad idea, I know). Attackers can scan our open ports and find the code-server's port and access the code-server without any authentication 😱. I totally forgot about this bad decision for a few months, and then recently when I was investigating JupyterHub's security after #172, I rediscovered the bug and quickly fixed it by enabling authentication for code-server. Now when you try to access the code-server, code-server will generate a random password in `~/.config/code-server/config.yaml`, and it'll tell you instructions to find the password in the file and type it in. Since code-server was rarely used anyways, I think it's very unlikely that this vulnerability was exploited in the past. An attacker also would not be able to find or change the victim's password and gain further access to their account.
a added the
bug
security
labels 2022-08-04 17:53:54 +00:00
a added this to the (deleted) project 2022-08-04 17:53:54 +00:00
a closed this issue 2022-08-04 17:53:58 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: exozyme/exozyme#173
No description provided.