-
Notifications
You must be signed in to change notification settings - Fork 22
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
fix(frontend): security XSS / image tag #4030
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A la fin on utilise quand meme dangerouslySetInnerHTML
?
Je vois plusieurs exemple avec html-react-parser, c'était pas mieux ?
@@ -2329,7 +2329,9 @@ exports[`<FicheMT /> should render 1`] = ` | |||
<div | |||
class="c54 c55" | |||
> | |||
<div> | |||
<div | |||
class="" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c'est bizarre que ça rajoute une class vide
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oui, c'est vrai, bonne question
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
En vrai, c'est dû au parsing fait par le xss, qui essaye de retirer le plus de choses externes. Mais en soit, relou si ça génère des <div class="" ..
dans la prod
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dans la prod, il me semble que ça ne génère pas cela, donc pour moi c'est ok j'ai l'impression
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c'est juste qu'avant on l'ajoutait pas et maintenant oui
Oui, mais on passe des propriétés qui ont été au préalable parse
Sur la doc de html-react-parser :
Ok 👍 |
packages/code-du-travail-frontend/__tests__/__snapshots__/fiche-ministere-travail.test.js.snap
Outdated
Show resolved
Hide resolved
packages/code-du-travail-frontend/src/common/__tests__/__snapshots__/Answer.test.js.snap
Outdated
Show resolved
Hide resolved
Les |
ok pour moi. Dommage pour les class vides mais c'est pas primordial du tout. @m-maillot tu peux review la PR du coup |
🎉 Deployment for commit fe8f3f3 : IngressesDocker images
Debug
|
Co-authored-by: Martial Maillot <[email protected]>
fix #4028
fix #3560
Note : une fois mergé, il faudra vérifier que maintenant la page est valide :
https://validator.w3.org/nu/?doc=https%3A%2F%2Fcode-du-travail-numerique-master.dev.fabrique.social.gouv.fr%2Fmodeles-de-courriers%2Frupture-du-contrat-en-periode-dessai-a-linitiative-du-salarie
Si c'est bon, on peut passer à OK la RGAA 8.2 P10