Cross-site Scripting in file-upload-with-preview
This affects the package file-upload-with-preview before 4.2.0. A file containing malicious JavaScript code in the name can be uploaded (a user needs to be tricked into uploading such a file).
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| npm package | file-upload-with-preview | < 4.2.0 | 4.2.0 |
References
- https://nvd.nist.gov/vuln/detail/CVE-2021-23439
- https://github.com/johndatserakis/file-upload-with-preview/pull/40/files?file-filters%5B%5D=.js&hide-deleted-files=true%23diff-fe47b243de17419c0daa22cd785cd754baed60cf3679d3da1d6fe006f9f4a7f0R174
- https://github.com/johndatserakis/file-upload-with-preview
- https://github.com/johndatserakis/file-upload-with-preview/blob/develop/src/file-upload-with-preview.js%23L168
- https://snyk.io/vuln/SNYK-JS-FILEUPLOADWITHPREVIEW-1579492
- CVSS vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N- Weakness (CWE)
CWE-79- Platform
- npm
- Package
file-upload-with-preview- Disclosed
- 07.09.2021
- Updated
- 11.10.2026 10:22
Sources and licenses
OSV / GitHub Advisory Database - GHSA-97pv-4338-r5vp - CC BY 4.0
Vulnerability history: file-upload-with-preview
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.