GHSA-gw32-9rmw-qwww svelte is vulnerable to XSS with textarea bind:value
HighCVSS 8.4
- Published
- Updated
- Exploit status
- No public exploit known
Description
Summary
A server-side rendered <textarea> with two-way bound value does not have its value correctly escaped in the rendered HTML.
Details
In SSR, <textarea bind:value={...}> does not have its value escaped when it is rendered into the HTML as <textarea>...</textarea>.
PoC
Put this in a server-side-rendered Svelte component:
<script>
let value = `test'"></textarea><script` + `>alert('BIM');</sc` + `ript>`;
</script>
<textarea bind:value />
Impact
- Only affects SSR
- Needs a
<textarea bind:value>filled by user content via two-way binding
Upgrade path
1 package: 1 fixed.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| npm svelte(npm) | >= 3.0.0, < 3.59.2 | 3.59.2 | Fixed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| npm svelte(npm) | >= 3.0.0, < 3.59.2 | 3.59.2 |
References
- github.com vendor-advisory
- github.com patch
- github.com
- github.com product