mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge pull request #4657 from thornbill/subs-xss
Fix xss in custom subtitles element
This commit is contained in:
commit
5cc91f2ee0
1 changed files with 4 additions and 1 deletions
|
@ -1,3 +1,5 @@
|
|||
import DOMPurify from 'dompurify';
|
||||
|
||||
import browser from '../../scripts/browser';
|
||||
import { Events } from 'jellyfin-apiclient';
|
||||
import { appHost } from '../../components/apphost';
|
||||
|
@ -1317,7 +1319,8 @@ function tryRemoveElement(elem) {
|
|||
}
|
||||
|
||||
if (selectedTrackEvent && selectedTrackEvent.Text) {
|
||||
subtitleTextElement.innerHTML = normalizeTrackEventText(selectedTrackEvent.Text, true);
|
||||
subtitleTextElement.innerHTML = DOMPurify.sanitize(
|
||||
normalizeTrackEventText(selectedTrackEvent.Text, true));
|
||||
subtitleTextElement.classList.remove('hide');
|
||||
} else {
|
||||
subtitleTextElement.classList.add('hide');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue