hanley
April 12, 2017, 3:45pm
1
In the Security section of the Meteor docs at the bottom of the page there’s a checklist. One of the item says
Don’t use raw HTML inclusion in Blaze unless you really know what you are doing.
The link provided forwards you to the Blaze Community Site , but I can’t find any mention of this security issue.
What exactly is raw HTML inclusion in the context of Blaze, and how is this a security issue?
sashko
April 12, 2017, 3:46pm
2
Look up “cross-site scripting”. Basically if you put raw user-provided HTML on your page users can hack other users by putting JavaScript in there.
1 Like
hanley
April 12, 2017, 3:57pm
3
Thanks for the quick response. So using Blaze.toHTML to render templates is ok. It’s only a security issue if I’m taking actual user input via an input or textarea for example, and then inserting that into the page’s html?
sashko
April 12, 2017, 3:58pm
4
Yes that’s right! And by default Blaze will escape it for you.
hanley
April 12, 2017, 4:19pm
5
Great. Thanks for clarifying.