From 8910e09beb6ea1e053b919ca87d6e697646527cf Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Wed, 9 Jul 2014 12:02:00 +0200 Subject: [PATCH] Disable JSONP by default By default, disable the option to use JSONP in our REST layer closes #6795 --- docs/reference/api-conventions.asciidoc | 18 ++++++++++-------- .../org/elasticsearch/rest/RestController.java | 4 +++- .../options/jsonp/JsonpOptionDisabledTest.java | 8 +++++++- .../options/jsonp/JsonpOptionEnabledTest.java | 3 ++- 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/docs/reference/api-conventions.asciidoc b/docs/reference/api-conventions.asciidoc index ef06dcfbaeb..1e656b5a3e2 100644 --- a/docs/reference/api-conventions.asciidoc +++ b/docs/reference/api-conventions.asciidoc @@ -241,17 +241,19 @@ document indexed. [float] === JSONP -By default JSONP resposes are enabled. All REST APIs accept a `callback` parameter -resulting in a http://en.wikipedia.org/wiki/JSONP[JSONP] result. You can disable +By default JSONP responses are disabled by default. coming[1.3,Previously JSONP was enabled by default] + +When enabled, all REST APIs accept a `callback` parameter +resulting in a http://en.wikipedia.org/wiki/JSONP[JSONP] result. You can enable this behavior by adding the following to `config.yaml`: - http.jsonp.enable: false + http.jsonp.enable: true -Please note, due to the architecture of Elasticsearch, this may pose a security -risk. Under some circumstances, an attacker may be able to exfiltrate data in your -Elasticsearch server if they're able to force your browser to make a JSONP request -on your behalf (e.g. by including a