CVE-2025-27145: Copyparty Copyparty Renders Unsanitized Filenames As Vulnerability

LOW
Advisory Identifier: GHSA-m2jw-cj8v-937r
CVSS 3.6
CWE-79 CWE-83
Published
Advisory Summary

CVE-2025-27145 is a LOW (CVSS 3.6) copyparty renders unsanitized filenames as vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Copyparty libraries in the PyPI ecosystem. The issue involves copyparty renders unsanitized filenames as html when user uploads empty files. Remediation is available by upgrading affected packages to version 1.16.15.

CVE-2025-27145 at a Glance

CVE Identifier CVE-2025-27145
GHSA Identifier GHSA-m2jw-cj8v-937r
Severity LOW
CVSS v3.1 Base Score 3.6
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Copyparty
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 3.6

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N).

Attack Vector Local (AV:L)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2025-27145

To remediate this vulnerability, upgrade all affected Copyparty dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

copyparty fixed: 1.16.15
pip install copyparty>=1.16.15
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show copyparty

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2025-27145, inspect your installed packages using pip:

pip show copyparty

Analyze the terminal output to locate any version of Copyparty in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.16.15), your application is affected.

Note: The pip show copyparty command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Copyparty, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary A [DOM-Based XSS](https://capec.mitre.org/data/definitions/588.html) was discovered in [copyparty](https://github.com/9001/copyparty), a portable fileserver. The vulnerability is considered low-risk. ## Details 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: 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. ## Proof of Concept (POC) 1. Create an empty file named `<img src=x onerror="alert(1)">` 2. Drag-and-drop the file into the browser to initiate an upload 3. The `alert(1)` is executed

CVE-2025-27145 Affected Copyparty Versions

1 component(s)
Fixed Versions:
1.16.15
Product / Package Ecosystem Affected Versions Fixed Version
copyparty
PyPI
< 1.16.15
1.16.15

References

Frequently Asked Questions

What is CVE-2025-27145?
CVE-2025-27145 is a security vulnerability in Copyparty involving copyparty renders unsanitized filenames as HTML when user uploads empty files under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Copyparty versions are affected?
Affected versions include releases prior to 1.16.15 across affected packages: copyparty.
What version fixes CVE-2025-27145?
Upgrading to 1.16.15 (or the latest patched release for your respective branch) resolves the vulnerability.
Is copyparty affected?
Yes, copyparty is affected in releases prior to 1.16.15. Upgrade your dependency to 1.16.15 or later.
What is the CVSS score of CVE-2025-27145?
CVE-2025-27145 has a CVSS v3.1 base score of 3.6 (LOW) with vector string CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N.
What CWE is associated with CVE-2025-27145?
CVE-2025-27145 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check PyPI dependencies for CVE-2025-27145?
Run the dependency tree command: 'pip show copyparty'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-m2jw-cj8v-937r",
  "modified" : "2025-02-26T20:06:56Z",
  "published" : "2025-02-26T20:06:56Z",
  "aliases" : [ "CVE-2025-27145" ],
  "summary" : "copyparty renders unsanitized filenames as HTML when user uploads empty files",
  "details" : "## Summary\n\nA [DOM-Based XSS](https://capec.mitre.org/data/definitions/588.html) was discovered in [copyparty](https://github.com/9001/copyparty), a portable fileserver. The vulnerability is considered low-risk.\n\n## Details\n\nBy 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).\n\nNote: 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.\n\n## Proof of Concept (POC)\n\n1. Create an empty file named `<img src=x onerror=\"alert(1)\">`\n2. Drag-and-drop the file into the browser to initiate an upload\n3. The `alert(1)` is executed",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "copyparty"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.16.15"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/9001/copyparty/security/advisories/GHSA-m2jw-cj8v-937r"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-27145"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/9001/copyparty/commit/438ea6ccb06f39d7cbb4b6ee7ad44606e21a63dd"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/9001/copyparty"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/9001/copyparty/releases/tag/v1.16.15"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79", "CWE-83" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-02-26T20:06:56Z",
    "nvd_published_at" : "2025-02-25T02:15:16Z"
  }
}