Skip to content
Fencer Intel
high 8.4

GHSA-gw32-9rmw-qwww json

svelte is vulnerable to XSS with textarea bind:value

published 9mo ago modified 9mo ago

cvss
8.4
version 4.0, the maintainers
cisa kev
Not listed
not in CISA's catalog
epss
—
no score, EPSS covers CVEs only
public exploits
0
none known

Summary

### 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

Patch / fix

  • npm svelte 3.59.2

Is GHSA-gw32-9rmw-qwww in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.

Check with Fencer

CVSS scores

assigned by version score vector
the maintainers 4.0 8.4 CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:L/VA:N/SC:H/SI:H/SA:N

Affected packages

ecosystem package affected fixed in
npm svelte
>=3.0.0, <3.59.2
3.59.2

Classification

Weakness
  • CWE-79 Improper Neutralization of Input During Web Page Generation

References

Sources

Fencer Intel keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.

The maintainers of sveltejs/svelte published their own advisory on GitHub. Reviewed sources take precedence over it.