Skip to content

Commit 9b6e2ef

Browse files
committed
fix(frontend): refined sanitization
1 parent 499aa60 commit 9b6e2ef

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

apps/frontend/src/components/ui/servers/LogParser.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,14 @@ const parsedLog = computed(() => {
4747
});
4848
4949
const sanitizedLog = computed(() => {
50-
return DOMPurify.sanitize(parsedLog.value);
50+
return DOMPurify.sanitize(parsedLog.value, {
51+
ALLOWED_TAGS: ["span"],
52+
ALLOWED_ATTR: ["style"],
53+
ALLOWED_CSS_STYLES: {
54+
color: true,
55+
"background-color": true,
56+
},
57+
});
5158
});
5259
</script>
5360

0 commit comments

Comments
 (0)