Possible injection because of sanitize cache
Offen
- Vorherrschende Sprache
- JavaScript
- Sterne
- 814
- Forks
- 37
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript
- Bereich
- frontend, security
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 38/100