Cross-Site Scripting in webtorrent
Versions of webtorrent prior to 0.107.6 are vulnerable to Cross-Site Scripting. webtorrent servers started with torrent.createServer() lists a torrent's title and files in the index page without sanitization. This allows attackers to execute arbitrary JavaScript in the victim's browser through files with names containing the malicious payload. The issue is mitigated due to the fact that the server only allows fetching data pieces from the torrent.
Recommendation
Upgrade to version 0.107.6 or later.
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| npm package | webtorrent | < 0.107.6 | 0.107.6 |
References
- https://nvd.nist.gov/vuln/detail/CVE-2019-15782
- https://github.com/webtorrent/webtorrent/pull/1714
- https://github.com/webtorrent/webtorrent/commit/7e829b5d52c32d2e6d8f5fbcf0f8f418fffde083
- https://hackerone.com/reports/681617
- https://github.com/webtorrent/webtorrent/compare/v0.107.5...v0.107.6
- https://snyk.io/vuln/SNYK-JS-WEBTORRENT-460351
- https://www.npmjs.com/advisories/1158
- CVSS vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N- Weakness (CWE)
CWE-79- Platform
- npm
- Package
webtorrent- Disclosed
- 04.09.2019
- Updated
- 11.10.2026 10:22
Sources and licenses
OSV / GitHub Advisory Database - GHSA-gjh4-fcv3-whpq - CC BY 4.0
Vulnerability history: webtorrent
All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.
This is the only known vulnerability of this package.
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.