Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anyone can access the endpoints on nbclassic #159

Open
yacchin1205 opened this issue May 30, 2023 · 0 comments
Open

Anyone can access the endpoints on nbclassic #159

yacchin1205 opened this issue May 30, 2023 · 0 comments

Comments

@yacchin1205
Copy link

yacchin1205 commented May 30, 2023

When I install this extension on nbclassic, anyone can access the endpoints provided by Server Extension without credentials.

This is because the Server Extension uses notebook.base.handlers.IPythonHandler. https://github.com/Jupyter-contrib/jupyter_nbextensions_configurator/blob/master/src/jupyter_nbextensions_configurator/__init__.py#LL18C1-L18C1
As reported to the notebook project jupyter/nbclassic#271 , it seems that nbclassic should use jupyter_server.base.handlers.JupyterHandler. This may be just a bug in nbclassic, but I report it here too.

To Reproduce
To reproduce, please follow the steps below.

  1. Download Dockerfile from https://gist.github.com/yacchin1205/532509f59b1815bdb4624a08db1e4f9c
  2. Build an image: docker build -t jupyter/ipython-handler-authentication-bug .
  3. Run jupyter notebook (former notebook server): docker run --rm -p 8888:8888 -e DOCKER_STACKS_JUPYTER_CMD=notebook jupyter/ipython-handler-authentication-bug
  4. Access the nbextensions configurator endpoint without credentials: curl -vvvv 'http://127.0.0.1:8888/nbextensions/nbextensions_configurator/list' -> It returns 403 Forbidden. (Expected behavior)
  5. Stop the container with Ctrl-C
  6. Run jupyter nbclassic (nbclassic with jupyter-server): docker run --rm -p 8888:8888 -e DOCKER_STACKS_JUPYTER_CMD=nbclassic jupyter/ipython-handler-authentication-bug
  7. Access the nbextensions configurator endpoint without credentials: curl -vvvv 'http://127.0.0.1:8888/nbextensions/nbextensions_configurator/list' -> It returns 200 OK with actual response. (Unexpected behavior)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant