mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
SECURITY: Onebox templates' HTML injections.
The use of triple-curlies on Mustache templates opens the possibility for HTML injections.
This commit is contained in:

committed by
Krzysztof Kotlarek

parent
5f20748e40
commit
d78357917c
@ -36,7 +36,7 @@ module Onebox
|
||||
body, excerpt = compute_body(raw["body"])
|
||||
ulink = URI(link)
|
||||
|
||||
labels = raw["labels"].map { |l| { name: Emoji.codes_to_img(l["name"]) } }
|
||||
labels = raw["labels"].map { |l| { name: Emoji.codes_to_img(CGI.escapeHTML(l["name"])) } }
|
||||
|
||||
{
|
||||
link: @url,
|
||||
|
Reference in New Issue
Block a user