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

Variable substitution in DataLinks does not URL encode unsafe characters #22183

Closed
yanscalyr opened this issue Feb 13, 2020 · 1 comment
Closed

Comments

@yanscalyr
Copy link

What happened:
When following a DataLink that contains a variable, the variable will be substituted in without being encoded, which can result in unsafe characters being present in the URL.
Some safe characters will also be backslash escaped automatically which adds additional unsafe characters, and is probably unnecessary in a URL.

Unsafe characters can result in the server rejecting the request.

What you expected to happen:
Variable values would be encoded and not backslash escaped in the URL.

How to reproduce it (as minimally and precisely as possible):

  1. Create a variable with a value containing a backslash \
  2. Create a datalink that references the above variable (for full effect point it to a server using a recent version of Apache Tomcat, as this is how I ran into this issue)
  3. Use the DataLink

Anything else we need to know?:
Depending on where your DataLink is pointing to, some servers encode unsafe values when received, or do not reject the request.

Environment:

  • Grafana version: v6.5.2
  • Data source type & version:
  • OS Grafana is installed on: MacOS Catalina Version 10.15.3
  • User OS & Browser: MacOS Catalina Version 10.15.3, Chrome
  • Grafana plugins:
  • Others:
@sakjur
Copy link
Contributor

sakjur commented Feb 14, 2020

This is similar to #22125, so I'm closing this as a duplicate of that. Would be great if you could add a comment there to put emphasis that it's not about more characters than # 🙂

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

2 participants