Skip to content

Commit

Permalink
fix: fix xss attacks caused by security issues in custom web group pa…
Browse files Browse the repository at this point in the history
…nels
  • Loading branch information
moonrailgun committed Sep 10, 2023
1 parent b6d5811 commit 81a062a
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect, useRef, useState } from 'react';
import { Translate } from '../translate';
import { FilterXSS } from 'xss';
import { FilterXSS, getDefaultWhiteList } from 'xss';
import { useWatch } from '@capital/common';
import { GroupExtraDataPanel, NoData, TextArea } from '@capital/component';
import styled from 'styled-components';
Expand All @@ -26,10 +26,9 @@ const EditModalContent = styled.div`

const xss = new FilterXSS({
css: false,
whiteList: { ...getDefaultWhiteList(), iframe: ['src', 'style', 'class'] },
onIgnoreTag: function (tag, html, options) {
if (
['html', 'body', 'head', 'meta', 'style', 'iframe', 'div'].includes(tag)
) {
if (['html', 'body', 'head', 'meta', 'style', 'div'].includes(tag)) {
// 不对其属性列表进行过滤
return html;
}
Expand Down

0 comments on commit 81a062a

Please sign in to comment.