Skip to content

Commit c1365f2

Browse files
committed
fix: fix xss problem when render iframe
1 parent d57a878 commit c1365f2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

client/web/src/components/Markdown/render.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ export const Markdown: React.FC<{
4646
),
4747
iframe: (props) => {
4848
let src = props.src;
49+
50+
if (src?.includes('javascript')) {
51+
return <div>not support run javascript</div>;
52+
}
53+
4954
if (src && src.includes('?')) {
5055
src += '&autoplay=0'; // make sure media autoplay is false
5156
}

0 commit comments

Comments
 (0)