patch XSS, injection vuln

This commit is contained in:
2026-02-14 16:30:21 +00:00
parent d89b08c58f
commit 7c87edc28a
6 changed files with 44 additions and 16 deletions

View File

@ -1,3 +1,4 @@
import DOMPurify from 'isomorphic-dompurify';
import React, { useState } from 'react';
import { FormattedMessage } from 'react-intl';
@ -57,7 +58,7 @@ const About: React.FC<IAbout> = ({ slug }) => {
<div>
<Card variant='rounded'>
<div className='prose mx-auto py-4 dark:prose-invert sm:p-6'>
{pageHtml && <div dangerouslySetInnerHTML={{ __html: pageHtml }} />}
{pageHtml && <div dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(pageHtml, { USE_PROFILES: { html: true } }) }} />}
{alsoAvailable}
</div>
</Card>