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

file:// URLs get mangled #16983

Open
hrichardlee opened this issue Mar 5, 2018 · 14 comments
Open

file:// URLs get mangled #16983

hrichardlee opened this issue Mar 5, 2018 · 14 comments
Labels
Feature:FieldFormatters impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort papercut Small "burr" in the product that we should fix. Team:DataDiscovery Discover App Team (Document Explorer, Saved Search, Surrounding documents, Graph)

Comments

@hrichardlee
Copy link

hrichardlee commented Mar 5, 2018

Kibana version: 6.2.2

Elasticsearch version: 6.2.2

Server OS version: Windows Server 2016

Browser version: Chrome 64

Browser OS version: Windows 7

Original install method (e.g. download page, yum, from source, etc.): Download page

Description of the problem including expected versus actual behavior: When there is a URL field that starts with file://, Kibana creates an <a> tag with href="http://myserver/app/file//[etc]" which is not usable.

Steps to reproduce:

  1. Create a document with a field called "test" that has a value, "file://c/temp.txt."
  2. Set the "test" field to be in the URL format
  3. When viewing the document, try to click on the "test" link

This was also reported in the forums https://discuss.elastic.co/t/kibana-url-format-bug-file/121414 (the poster there said they would create an issue, but I haven't been able to find it).

I think the fix for this would just be to add "file://" to whitelistUrlSchemes in https://github.com/elastic/kibana/blob/d06ee13ab83baba86a36ffd69fe6277f845a034c/src/core_plugins/kibana/common/field_formats/types/url.js

Thanks!

@hrichardlee hrichardlee changed the title file URLs get mangled file:// URLs get mangled Mar 5, 2018
@chrisronline
Copy link
Contributor

Yup, this is something we can easily fix. Do you mind opening a PR to address this?

@gmoskovicz
Copy link
Contributor

@chrisronline perhaps we should consider here custom whitelists of specific protocols other than http/https? What do you think?

@chrisronline
Copy link
Contributor

@gmoskovicz Yup, that sounds definitely viable. I don't think there are any concerns with that, but pinging @kobelb and @legrego to double check.

@legrego
Copy link
Member

legrego commented Apr 3, 2018

@chrisronline @gmoskovicz In general I don't have a problem with a custom whitelist, but if we take this route, we may want to blacklist certain protocols from ever being included:

  • javascript: - pseudo-protocol, but we certainly don't want to allow JS to execute
  • chrome:, resource: - both used by Firefox/FF plugins...I'm not very familiar with them, but they don't sound like something we'd want to allow.

I'll look for others if we go forward with the custom whitelist, but those are what immediately came to mind

@gmoskovicz
Copy link
Contributor

@legrego @chrisronline Sounds good to me, but this will still allow things like file, ftp and others.

So we might want to have a whitelist with some blacklisted, that will give the needed functionality.

@alex-kuck
Copy link

I would definitely support the use of blacklisting instead of whitelisting, since we are using custom protocols in order to start our own applications. The current behaviour is quite restrictive.

@chrisronline
Copy link
Contributor

@gmoskovicz @timroes brought up a good point about file:// protocols here. What is the use case for wanting to support this? Are folks starting browsers (and Kibana) with this security restriction disabled?

@gmoskovicz
Copy link
Contributor

@chrisronline in the context of my ask, i wasn't thinking about file:// but a custom protocol for a custom Java application.

@timroes
Copy link
Contributor

timroes commented Jun 18, 2018

@chrisronline I think we might want to stick with http and https as default, but create an setting for whitelisting more protocols. I would suggest, that this setting even goes into kibana.yml, so only an administrator can change it. I think that would be the safest and still allow users to also whitelist file in case they work around the browser security in some way.

We should consume that setting in the markdown visualization and the link field formatter.

@timroes timroes added Team:Visualizations Visualization editors, elastic-charts and infrastructure and removed :Management DO NOT USE labels Nov 27, 2018
@kertal kertal self-assigned this Apr 29, 2019
@Dosant Dosant added Feature:FieldFormatters Team:AppServices and removed Team:Visualizations Visualization editors, elastic-charts and infrastructure labels Jun 16, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-services (Team:AppServices)

@kertal kertal removed their assignment Jun 16, 2021
@exalate-issue-sync exalate-issue-sync bot added impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort labels Jun 16, 2021
@kertal
Copy link
Member

kertal commented Jul 6, 2022

for visibility there are new comments in this issue, so there's still demand for a solution:

#112774

@jeffvestal
Copy link

+1 to adding a whilelist of options.
I would like to be able to have clickable mailto:user@company.co links for example.

@petrklapka petrklapka added Team:DataDiscovery Discover App Team (Document Explorer, Saved Search, Surrounding documents, Graph) and removed Team:AppServicesSv labels Dec 12, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-data-discovery (Team:DataDiscovery)

@GeorgeGkinis
Copy link

GeorgeGkinis commented May 4, 2023

We would also like to be able to click-open mailto:name@domain.com links.

Adding an advanced setting for allowed schemes would not be that hard and leaves the responsibility to the kibana admins.
@timroes kibana.yml config would indeed also be a nice and safer option.

Are there currently any plans on implementing this?
This ticket has been open for 5 years now.

Thanks for a wonderfull and empowering product!

@jughosta jughosta added the papercut Small "burr" in the product that we should fix. label May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:FieldFormatters impact:low Addressing this issue will have a low level of impact on the quality/strength of our product. loe:small Small Level of Effort papercut Small "burr" in the product that we should fix. Team:DataDiscovery Discover App Team (Document Explorer, Saved Search, Surrounding documents, Graph)
Projects
None yet
Development

Successfully merging a pull request may close this issue.