elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.69k stars 8.11k forks source link

[BUG] Node attributes aren't escaped in API requests #57203

Open magnuslarsen opened 4 years ago

magnuslarsen commented 4 years ago

Elasticsearch version (bin/elasticsearch --version): 7.5.2

Plugins installed: [] None

JVM version (java -version):

/usr/share/elasticsearch/jdk/bin/java --version
openjdk 13.0.1 2019-10-15
OpenJDK Runtime Environment AdoptOpenJDK (build 13.0.1+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 13.0.1+9, mixed mode, sharing)

OS version (uname -a if on a Unix-like system): Linux elasticsearch1 4.15.0-76-generic elastic/elasticsearch#86-Ubuntu SMP Fri Jan 17 17:24:28 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Description of the problem including expected versus actual behavior: In ILM policy, after setting node attribution for shard awareness, clicking View a list of nodes attached to this configuration results in an error, if the node attribute contains an / (forward slash) I expect to see which nodes have said key :)

Steps to reproduce:

  1. Create a node.attr.node: "hot/warm"
  2. Create an ILM policy, enabling Warm phase
  3. In the warm phase, set Select a node attribute to control shard allocation to node: hot/warm
  4. Click on View a list of nodes attached to this configuration => Error is shown
  5. Opening the request in a new window (url taken from the request): https://kibana:5601/api/index_lifecycle_management/nodes/node:hot/warm/details fails, but encoding the / in the node.attr key, resolves the issue: https://kibana:5601/api/index_lifecycle_management/nodes/node:hot%2Fwarm/details

Provide logs (if relevant):

elasticmachine commented 4 years ago

Pinging @elastic/es-ui (Team:Elasticsearch UI)