🐛 Fix security concern

This commit is contained in:
Alejandro Alonso 2022-05-17 12:56:06 +02:00
parent 5c2b5f7cda
commit 216b510900

View file

@ -94,9 +94,10 @@
{:keys [content]} shape {:keys [content]} shape
{:keys [tag]} content {:keys [tag]} content
svg-root? (and (map? content) (= tag :svg)) svg-root? (and (map? content) (= tag :svg))
svg-tag? (map? content) svg-tag? (map? content)
svg-leaf? (string? content)] svg-leaf? (string? content)
valid-tag? (contains? usvg/svg-tags-list tag)]
(cond (cond
svg-root? svg-root?
@ -104,12 +105,12 @@
(for [item childs] (for [item childs]
[:& shape-wrapper {:shape item :key (dm/str (:id item))}])] [:& shape-wrapper {:shape item :key (dm/str (:id item))}])]
svg-tag? (and svg-tag? valid-tag?)
[:& svg-element {:shape shape} [:& svg-element {:shape shape}
(for [item childs] (for [item childs]
[:& shape-wrapper {:shape item :key (dm/str (:id item))}])] [:& shape-wrapper {:shape item :key (dm/str (:id item))}])]
svg-leaf? (and svg-leaf? valid-tag?)
content content
:else nil)))) :else nil))))