Giter Club home page Giter Club logo

Comments (4)

yuvipanda avatar yuvipanda commented on June 5, 2024 1

Gotta be careful when X-Forwarded-Host unconditionally. See rails/rails#29893 for an example of unforeseen security issues. A bunch of other web frameworks have features that list you explicitly set which IPs to trust X-Forwarded-Host headers from - https://expressjs.com/en/guide/behind-proxies.html.

This might not be a problem here for CORS, but something to carefully consider regardless

from jupyter_server.

afshin avatar afshin commented on June 5, 2024

What you suggest sounds like the correct behavior. It's not part of the standard, but it's a "de facto standard"

from jupyter_server.

rolweber avatar rolweber commented on June 5, 2024

Would it make sense to check if these are set, and if so, to prefer them to the Host header when comparing to Origin?

Definitely not. Any attacker can set headers as they wish, so it's a bad idea to disable security checks based on the fact that some header is present. Explicitly telling Jupyter through the configuration that it is running behind a load balancer, as suggested by @yuvipanda, sounds like the way to go.

from jupyter_server.

rolweber avatar rolweber commented on June 5, 2024

Maybe add logic around this line to use the value from a configured header (Forwarded or X-Forwarded-Host or whatever) in favor of the value from the Host header. The latter should still be used as a fallback in the absence of the configured header, in case somebody is hitting the same server directly instead of through the load balancer.

On second thought, it might still be possible to abuse this by hitting the server directly. Tricky thing.

from jupyter_server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.