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: Disable JSONP by default #6795

Closed
wants to merge 3 commits into from
Closed

Conversation

kimchy
Copy link
Member

@kimchy kimchy commented Jul 9, 2014

By default, disable the option to use JSONP in our REST layer

By default, disable the option to use JSONP in our REST layer
closes elastic#6795
@@ -140,7 +140,7 @@ public RestFilterChain filterChain(RestFilter executionFilter) {

public void dispatchRequest(final RestRequest request, final RestChannel channel) {
// If JSONP is disabled and someone sends a callback parameter we should bail out before querying
if (!settings.getAsBoolean("http.jsonp.enable", true) && request.hasParam("callback")){
if (!settings.getAsBoolean("http.jsonp.enable", false) && request.hasParam("callback")){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the "http.jsonp.enable" setting be moved to a constant?

@dakrone
Copy link
Member

dakrone commented Jul 9, 2014

LGTM, left a minor comment.

@dakrone
Copy link
Member

dakrone commented Jul 9, 2014

Actually, docs/reference/api-conventions.asciidoc needs to be updated as well to reflect this change.

@kimchy
Copy link
Member Author

kimchy commented Jul 9, 2014

@dakrone pushed fixes to relevant comments

@dakrone
Copy link
Member

dakrone commented Jul 9, 2014

LGTM, +1

@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should put a note that this was changed in 1.3

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aye!, will fix

@kimchy
Copy link
Member Author

kimchy commented Jul 9, 2014

@s1monw fixed doc

@s1monw
Copy link
Contributor

s1monw commented Jul 9, 2014

LGTM

@s1monw s1monw removed the review label Jul 9, 2014
@kimchy kimchy closed this in 8910e09 Jul 9, 2014
kimchy added a commit that referenced this pull request Jul 9, 2014
By default, disable the option to use JSONP in our REST layer
closes #6795
@kimchy kimchy deleted the disable_jsonp branch July 9, 2014 19:17
@clintongormley clintongormley changed the title Disable JSONP by default Security: Disable JSONP by default Jul 16, 2014
@clintongormley clintongormley added the :Core/Infra/REST API REST infrastructure and utilities label Jun 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants