copyparty renders unsanitized filenames as HTML when user uploads empty files
Description
copyparty, a portable file server, has a DOM-based cross-site scripting vulnerability in versions prior to 1.16.15. The vulnerability is considered low-risk. By handing someone a maliciously-named file, and then tricking them into dragging the file into copyparty's Web-UI, an attacker could execute arbitrary javascript with the same privileges as that user. For example, this could give unintended read-access to files owned by that user. The bug is triggered by the drag-drop action itself; it is not necessary to actually initiate the upload. The file must be empty (zero bytes). Note that, as a general-purpose webserver, it is intentionally possible to upload HTML-files with arbitrary javascript in <script> tags, which will execute when the file is opened. The difference is that this vulnerability would trigger execution of javascript during the act of uploading, and not when the uploaded file was opened. Version 1.16.15 contains a fix.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
copypartyPyPI | < 1.16.15 | 1.16.15 |
Affected products
1Patches
11 file changed · +2 −2
copyparty/web/up2k.js+2 −2 modified@@ -1319,7 +1319,7 @@ function up2k_init(subtle) { if (bad_files.length) { var msg = L.u_badf.format(bad_files.length, ntot); for (var a = 0, aa = Math.min(20, bad_files.length); a < aa; a++) - msg += '-- ' + bad_files[a][1] + '\n'; + msg += '-- ' + esc(bad_files[a][1]) + '\n'; msg += L.u_just1; return modal.alert(msg, function () { @@ -1331,7 +1331,7 @@ function up2k_init(subtle) { if (nil_files.length) { var msg = L.u_blankf.format(nil_files.length, ntot); for (var a = 0, aa = Math.min(20, nil_files.length); a < aa; a++) - msg += '-- ' + nil_files[a][1] + '\n'; + msg += '-- ' + esc(nil_files[a][1]) + '\n'; msg += L.u_just1; return modal.confirm(msg, function () {
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
5- github.com/advisories/GHSA-m2jw-cj8v-937rghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2025-27145ghsaADVISORY
- github.com/9001/copyparty/commit/438ea6ccb06f39d7cbb4b6ee7ad44606e21a63ddghsax_refsource_MISCWEB
- github.com/9001/copyparty/releases/tag/v1.16.15ghsax_refsource_MISCWEB
- github.com/9001/copyparty/security/advisories/GHSA-m2jw-cj8v-937rghsax_refsource_CONFIRMWEB
News mentions
0No linked articles in our index yet.