diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-09-16 00:16:31 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-09-16 00:16:31 +0200 |
commit | 2fc19635f6a98c0acbd223b3f9d0028ff2755585 (patch) | |
tree | d296d796ce1392900e477a45cc44a893bdae7ad5 /core/js/js.js | |
parent | d1f7087b6cf1f6c706f3a4f66cb0aa91bd5c28c1 (diff) | |
parent | 2f4a1c9c2c9777a2e225b433573f6473f3b9e0b1 (diff) | |
download | nextcloud-server-2fc19635f6a98c0acbd223b3f9d0028ff2755585.tar.gz nextcloud-server-2fc19635f6a98c0acbd223b3f9d0028ff2755585.zip |
Merge pull request #19014 from owncloud/dont-add-requestheaders-for-cross-domain-requests
Add security hardenings to $.ajax()
Diffstat (limited to 'core/js/js.js')
-rw-r--r-- | core/js/js.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/core/js/js.js b/core/js/js.js index 8d3756ae2ec..de773dc1221 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -1215,6 +1215,20 @@ function object(o) { * Initializes core */ function initCore() { + /** + * Disable automatic evaluation of responses for $.ajax() functions (and its + * higher-level alternatives like $.get() and $.post()). + * + * If a response to a $.ajax() request returns a content type of "application/javascript" + * JQuery would previously execute the response body. This is a pretty unexpected + * behaviour and can result in a bypass of our Content-Security-Policy as well as + * multiple unexpected XSS vectors. + */ + $.ajaxSetup({ + contents: { + script: false + } + }); /** * Set users locale to moment.js as soon as possible |