fix: account for whitespace in style tag regex to prevent XSS

This commit is contained in:
Yash Kumar
2026-09-02 01:44:46 +05:30
parent 58f3714ddc
commit 5606a2bd1e
+1 -1
View File
@@ -82,7 +82,7 @@ Document.getInitialProps = async (
metaTitle = config.metaTitle;
// Remove any </style> tags to prevent XSS breakout
customCss = config.customCss
? config.customCss.replace(/<\/style>/gi, "")
? config.customCss.replace(/<\/\s*style\s*>/gi, "")
: null;
faviconHref = config.faviconUrl || null;
}