]> cat aescling's git repositories - mastodon.git/commitdiff
Fix #457 - escape JSON in INITIAL_STATE (this bug only ever allowed a user to xss...
authorEugen Rochko <eugen@zeonfederated.com>
Thu, 12 Jan 2017 02:54:50 +0000 (03:54 +0100)
committerEugen Rochko <eugen@zeonfederated.com>
Thu, 12 Jan 2017 02:54:50 +0000 (03:54 +0100)
app/views/home/index.html.haml

index 7302491292ca66564a198fd4ea9f63c348f81907..0147f4064b943e299337e7216ba2457973212541 100644 (file)
@@ -1,6 +1,6 @@
 - content_for :header_tags do
   :javascript
-    window.INITIAL_STATE = #{render(file: 'home/initial_state', formats: :json)}
+    window.INITIAL_STATE = #{json_escape(render(file: 'home/initial_state', formats: :json))}
 
   = javascript_include_tag 'application'