Possible injection because of sanitize cache
Ouverte
- Langage dominant
- JavaScript
- Étoiles
- 814
- Forks
- 37
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
Basically it's possible to inject dirty html:
```js
const striked = 'test';
console.log(
{striked}
);
console.log(
test
);
console.log(
{striked}
);
```
This is the output:
```html
<strike>test</strike>
test
test
```
Expected output:
```html
<strike>test</strike>
test
<strike>test</strike>
```
After rendering `
test
`, it caches `test` and doesn't sanitize it anymore. It can be seen live [here](https://codepen.io/remziatay/pen/YzroqLm?editors=1010) as well. Just because something was rendered before, it shouldn't mean that it's sanitized.
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Start with the JavaScript reproduction in the issue and compare its three renders with the linked CodePen. Trace the sanitizer cache behavior responsible for reusing the previously rendered content; done means the third render escapes the string like the first while preserving the direct HTML render.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- javascript
- Domaine
- frontend, security
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 38/100