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

gluon-status-page-api: improve cross origin policy #1194

Closed
lemoer opened this issue Jul 20, 2017 · 3 comments
Closed

gluon-status-page-api: improve cross origin policy #1194

lemoer opened this issue Jul 20, 2017 · 3 comments

Comments

@lemoer
Copy link
Member

lemoer commented Jul 20, 2017

Access-Control-Allow-Origin: * is maybe a bad idea for the status-page-api, since other websites could derive the geo-location of the wifi client from the status page by accessing the api via ajax.

For reference: similar issue in the wifi of DB

@jplitza
Copy link
Member

jplitza commented Jul 30, 2017

Very true. I see two possible solutions without totally breaking the status page:

  1. We do not send the header at all when the API is called via a "generic" (next_node) address. This makes it impossible to gather information without knowing the address of the node a user is connected to in advance. However, much more logic has to be implemented server-side (we currently simply ignore the Host header AFAIK).
  2. We only send Access-Control-Allow-Origin: $site.next_node.name$. This will only display neighbour data if the status page is originally called via the next_node address (even if you then navigate away from your next node).

@christf
Copy link
Member

christf commented Aug 4, 2017

I like (2). It seems like a small change and it will address the problem. <<<- I changed my mind. I like linking even more.

@neocturne
Copy link
Member

While this will need some transition time, we should simply change the status page to actually link to other nodes' status pages instead of only changing the backend URL when another node is selected, thus avoiding the whole issue.

We could still provide a single Access-Control-Allow-Origin: * endpoint just returning an empty page that can be used to check reachablity (and select a neighbour node's address based on this, like it is already done for the backend URL at the moment).

@neocturne neocturne added this to the 2017.2 milestone Aug 7, 2017
@neocturne neocturne added the 0. type: bug This is a bug label Aug 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants