VDB
EN
MEDIUM 6.1

GHSA-chqj-j4fh-rw7m

Cross-Site Scripting in dompurify

상세

Versions of `dompurify` prior to 2.0.3 are vulnerable to Cross-Site Scripting (XSS). The package has an XSS filter bypass due to Mutation XSS in both Chrome and Safari through a combination of `<svg>`/`<math>` elements and `</p>`/`</br>`. An example payload is: `<svg></p><style><a id="</style><img src=1 onerror=alert(1)>">`. This allows attackers to bypass the XSS protection and execute arbitrary JavaScript in a victim's browser.

## Recommendation

Upgrade to version 2.0.3 or later. You may also disallow `<svg>` and `<math>` through `dompurify` configurations: ```DOMPurify.sanitize(input, { FORBID_TAGS: ['svg', 'math'] });```

이 버전이 영향받나요?

사용 중인 패키지 버전을 입력하면 즉시 평가합니다.

영향 패키지

npm / dompurify
최초 영향 버전: 0 수정 버전: 2.0.3
수정 npm install dompurify@2.0.3

참고