diff --git a/src/theme/Footer/Links/Simple/index.js b/src/theme/Footer/Links/Simple/index.js index 8b34d9b7b..b9c9ed77f 100644 --- a/src/theme/Footer/Links/Simple/index.js +++ b/src/theme/Footer/Links/Simple/index.js @@ -1,5 +1,7 @@ import React from 'react'; import LinkItem from '@theme/Footer/LinkItem'; +import DOMPurify from 'dompurify'; // Import DOMPurify + function Separator() { return ยท; } @@ -9,7 +11,7 @@ function SimpleLinkItem({item}) { className="footer__link-item" // Developer provided the HTML, so assume it's safe. // eslint-disable-next-line react/no-danger - dangerouslySetInnerHTML={{__html: item.html}} + dangerouslySetInnerHTML={{__html: DOMPurify.sanitize(item.html)}} // Sanitize HTML /> ) : (