-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat espace pro #974
base: dev
Are you sure you want to change the base?
Feat espace pro #974
Conversation
Pas encore ouf mais sera plus simple à styler que mui
Ajout des lib react-email @tanstack/form
replyTo: process.env.REPLYTO_EMAIL, | ||
subject: emailDefinition.subject, | ||
html: html, | ||
text: html.replace(/<(?:.|\n)*?>/gm, ''), |
Check failure
Code scanning / CodeQL
Incomplete multi-character sanitization High
<script
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 12 days ago
To fix the problem, we should replace the custom regular expression-based sanitization with a well-tested library that can handle HTML sanitization more effectively. The sanitize-html
library is a popular choice for this purpose. It will ensure that all potentially unsafe HTML tags and attributes are removed, providing a more secure solution.
- Install the
sanitize-html
library. - Import the
sanitize-html
library in the file. - Replace the existing regular expression-based sanitization with a call to
sanitize-html
.
-
Copy modified line R10 -
Copy modified line R48
@@ -9,2 +9,3 @@ | ||
import { logger } from '../helpers/logger'; | ||
import sanitizeHtml from 'sanitize-html'; | ||
|
||
@@ -46,3 +47,3 @@ | ||
html: html, | ||
text: html.replace(/<(?:.|\n)*?>/gm, ''), | ||
text: sanitizeHtml(html, { allowedTags: [], allowedAttributes: {} }), | ||
}); |
-
Copy modified lines R140-R141
@@ -139,3 +139,4 @@ | ||
"yup": "^1.2.0", | ||
"zod": "^3.24.1" | ||
"zod": "^3.24.1", | ||
"sanitize-html": "^2.14.0" | ||
}, |
Package | Version | Security advisories |
sanitize-html (npm) | 2.14.0 | None |
WIP