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

Security issue #35

Closed
refob opened this issue Jan 1, 2021 · 4 comments
Closed

Security issue #35

refob opened this issue Jan 1, 2021 · 4 comments

Comments

@refob
Copy link

refob commented Jan 1, 2021

topola-viewer is forcing me to put my gedcom files on a public accessible web space. For example this works for me ("https://myserver.net/" is password protected):

https://myserver.net/topola/#/view?indi=I0019&url=http://myserver.net/data.ged

These one will fail with "Failed to load file" or "NetworkError when attempting to fetch resource.":

https://myserver.net/topola/#/view?indi=I0019&url=https://myserver.net/data.ged

https://myserver.net/topola/#/view?indi=I0019&url=http://local.net/data.ged

"http://local.net/" is free accessible to local hosts, but not from the internet due to a firewall.

The motivation for my request is that I'd like to send links to my relatives, but I do not want to make the gedcom data publicly available.

@PeWu
Copy link
Owner

PeWu commented Jan 1, 2021

Here is what I do with my private data -- I add a secret part to the URL. For example, my URL would become something like:

https://myserver.net/d3b07384d113/data.ged

This is not as good as password-protecting a site but good enough for my purposes. See here for a discussion for a discussion about private URLs vs passwords.

To support password-protected files, It should be possible to ask for the user-password before loading the URL. I don't know if it is possible to detect that the URL is password-protected. If not, we could add an additional URL param to Topola Viewer, i.e. ...&url=https://myserver.net/data.ged&askForPassword=true.

@refob
Copy link
Author

refob commented Jan 2, 2021 via email

@PeWu
Copy link
Owner

PeWu commented Jan 3, 2021

Short answer: add &handleCors=false to the URL.

Long answer:

Typically, servers don't allow requests from web sites in other domains. This is why services like https://cors-anywhere.herokuapp.com/ exist that provide a hack around the browser's cross-origin security feature. Topola Viewer by default uses cors-anywhere to fetch data when given a URL. So instead of requesting http://local.net/data.ged, Topola Viewer will actually request https://cors-anywhere.herokuapp.com/http://local.net/data.ged which will fail if it is not accessible from the Internet. To suppress this behavior and make Topola Viewer make direct requests to the given URL, add &handleCors=false to the Topola Viewer URL.

@refob
Copy link
Author

refob commented Jan 3, 2021 via email

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

2 participants